Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ user_fee_token_deployer: 0x2AC5278D230f88B481bBE4A94751d7188ef48Ca2

While not a named account, 0x3f1eae7d46d88f08fc2f8ed27fcb2ab183eb2d0e is funded on all test chains.

## Metrics

To run the metrics stack (Prometheus + Grafana) read the instructions in the [metrics/README.md](metrics/README.md) file.

## Contact

Discord - [Arbitrum](https://discord.com/invite/5KE54JwyTs)
Expand Down
36 changes: 36 additions & 0 deletions metrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Arbitrum Nitro Metrics

You can run this docker compose file it will run

- prometheus
- grafana
- setup the default dashboard

The default username/password is `admin`/`admin`.

## Run the metrics services

Simply start docker compose in this `metrics/` folder:

```sh
docker compose up
```

## Enable metrics on Nitro node

Don't forget to run the Nitro node with metrics exporting on, to do so add the following flags to your Nitro node startup command:

```sh
--metrics --metrics-server.addr=0.0.0.0
```

> ⚠️ Warning: Using 0.0.0.0 is recommended for cross-platform compatibility,
especially when accessing metrics from Docker, Linux, WSL, or remote containers.

## View the Dashboard

View the dashboard at http://localhost:3000

## How to add more grafana dashboards

To add more grafana dashboards you can drop json files into the `grafana/dashboards/` folder.
31 changes: 31 additions & 0 deletions metrics/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
ports:
- 9090:9090
extra_hosts:
- "host.docker.internal:host-gateway"
grafana:
image: grafana/grafana
container_name: grafana
restart: unless-stopped
volumes:
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- ./grafana/dashboards:/var/lib/grafana/dashboards
ports:
- 3000:3000
extra_hosts:
- "host.docker.internal:host-gateway"

volumes:
prometheus_data:

networks: {}
12 changes: 12 additions & 0 deletions metrics/grafana/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: "Offchain Labs"
orgId: 1
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
1 change: 1 addition & 0 deletions metrics/grafana/dashboards/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"annotations":{"list":[{"builtIn":1,"datasource":{"type":"grafana","uid":"-- Grafana --"},"enable":true,"hide":true,"iconColor":"rgba(0, 211, 255, 1)","name":"Annotations & Alerts","type":"dashboard"}]},"editable":true,"fiscalYearStartMonth":0,"graphTooltip":0,"id":0,"links":[],"panels":[{"datasource":{"type":"prometheus","uid":"PBFA97CFB590B2093"},"fieldConfig":{"defaults":{"color":{"mode":"palette-classic"},"custom":{"axisBorderShow":false,"axisCenteredZero":false,"axisColorMode":"text","axisLabel":"","axisPlacement":"auto","barAlignment":0,"barWidthFactor":0.6,"drawStyle":"line","fillOpacity":0,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"insertNulls":false,"lineInterpolation":"linear","lineWidth":1,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"auto","showValues":false,"spanNulls":false,"stacking":{"group":"A","mode":"none"},"thresholdsStyle":{"mode":"off"}},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"green","value":0},{"color":"red","value":80}]}},"overrides":[]},"gridPos":{"h":8,"w":12,"x":0,"y":0},"id":1,"options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},"pluginVersion":"12.2.0","targets":[{"datasource":{"type":"prometheus","uid":"PBFA97CFB590B2093"},"editorMode":"builder","expr":"arb_block_transactions_count","legendFormat":"__auto","range":true,"refId":"A"}],"title":"Arb Block Transactions Count","type":"timeseries"}],"preload":false,"refresh":"5s","schemaVersion":42,"tags":[],"templating":{"list":[]},"time":{"from":"now-30m","to":"now"},"timepicker":{},"timezone":"browser","title":"Example dashboard","uid":"adq7lsl","version":2}
9 changes: 9 additions & 0 deletions metrics/grafana/datasource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://host.docker.internal:9090
isDefault: true
access: proxy
editable: true
13 changes: 13 additions & 0 deletions metrics/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
global:
scrape_interval: 4s
scrape_timeout: 4s
evaluation_interval: 10s

scrape_configs:
- job_name: "nitro"
metrics_path: /debug/metrics/prometheus
static_configs:
- targets:
- host.docker.internal:6070
labels:
instance: local_node
2 changes: 1 addition & 1 deletion rollupcreator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bookworm-slim
FROM node:20-trixie-slim
RUN apt-get update && \
apt-get install -y git docker.io python3 make gcc g++ curl jq
ARG NITRO_CONTRACTS_BRANCH=main
Expand Down
2 changes: 1 addition & 1 deletion scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Base build environment
FROM node:20-bookworm-slim AS base
FROM node:20-trixie-slim AS base
WORKDIR /workspace
COPY ./package.json ./yarn.lock ./
RUN yarn
Expand Down
4 changes: 3 additions & 1 deletion scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ function writeConfigs(argv: any) {
"node": {
"bold": {
"rpc-block-number": "latest",
"assertion-posting-interval": "10s"
"assertion-posting-interval": "10s",
"assertion-confirming-interval": "10s",
"parent-chain-block-time": 1,
},
"staker": {
"dangerous": {
Expand Down
2 changes: 1 addition & 1 deletion test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

: ${NITRO_NODE_VERSION:=offchainlabs/nitro-node:v3.9.2-52e8959}
: ${NITRO_NODE_VERSION:=offchainlabs/nitro-node:v3.9.6-91bf578}
BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8

# nitro-contract workaround for testnode
Expand Down
2 changes: 1 addition & 1 deletion tokenbridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bookworm-slim
FROM node:20-trixie-slim
RUN apt-get update && \
apt-get install -y git docker.io python3 make gcc g++ curl jq
ARG TOKEN_BRIDGE_BRANCH=main
Expand Down