github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/metrics/example/README.md (about) 1 ## Running an example that shows metrics data? 2 3 1. Launch a local metrics server, which exposes the metrics data via the `/metrics` endpoint. 4 5 You can choose one of the following: 6 7 - Collection Node: 8 ``` 9 go run module/metrics/example/collection/main.go 10 ``` 11 12 - Execution Node: 13 ``` 14 go run module/metrics/example/execution/main.go 15 ``` 16 - Verification Node: 17 18 Note: Running example with `-happypath` flag examines the metrics collection on a real 19 happy path of verification node. 20 ``` 21 go run module/metrics/example/verification/main.go 22 ``` 23 - Consensus Node: 24 ``` 25 go run module/metrics/example/consensus/main.go 26 ``` 27 The above commands each launch a metrics server on localhost with port 9090 28 29 2. Install the prometheus server 30 ``` 31 brew install prometheus 32 ``` 33 34 3. Launch the prometheus server to scrape the metrics from our local metrics server 35 ``` 36 prometheus --config.file=module/metrics/example/prometheus.yml 37 ``` 38 39 4. Open the prometheus UI in your browser 40 http://localhost:9090/graph 41 42 5. Go to the "Graph" tab to query and verify the collected metrics data 43 type `consensus_cur_view`, and press "Enter" to view the metrics data over time