- Launch a local metrics server, which exposes the metrics data via the
/metricsendpoint.
You can choose one of the following:
-
Collection Node:
go run module/metrics/example/collection/main.go -
Execution Node:
go run module/metrics/example/execution/main.go -
Verification Node:
Note: Running example with
-happypathflag examines the metrics collection on a real happy path of verification node.go run --tags=relic module/metrics/example/verification/main.go -
Consensus Node:
go run module/metrics/example/consensus/main.go
The above commands each launch a metrics server on localhost with port 9090
- Install the prometheus server
brew install prometheus
- Launch the prometheus server to scrape the metrics from our local metrics server
prometheus --config.file=module/metrics/example/prometheus.yml
-
Open the prometheus UI in your browser http://localhost:9090/graph
-
Go to the "Graph" tab to query and verify the collected metrics data type
consensus_cur_view, and press "Enter" to view the metrics data over time