From e3d0bea84b9211201c0b7c210c359ab4172db89a Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Mon, 11 Mar 2024 15:11:02 -0700 Subject: [PATCH] fixup: Add mention of metrics configuration to tmpnet README --- tests/fixture/tmpnet/README.md | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/fixture/tmpnet/README.md b/tests/fixture/tmpnet/README.md index 3fbe2e39504..3371b668667 100644 --- a/tests/fixture/tmpnet/README.md +++ b/tests/fixture/tmpnet/README.md @@ -231,3 +231,44 @@ The process details of a node are written by avalanchego to `[base-data-dir]/process.json`. The file contains the PID of the node process, the URI of the node's API, and the address other nodes can use to bootstrap themselves (aka staking address). + +## Metrics + +### Prometheus configuration + +When nodes are started, prometheus configuration for each node is +written to `~/.tmpnet/prometheus/file_sd_configs/` with a filename of +`[network uuid]-[node id].json`. Prometheus can be configured to +scrape the nodes as per the following example: + +```yaml +scrape_configs: + - job_name: "avalanchego" + metrics_path: "/ext/metrics" + file_sd_configs: + - files: + - '/home/me/.tmpnet/prometheus/file_sd_configs/*.yaml' +``` + +### Viewing metrics + +When a network is started with `tmpnet`, a grafana link for the +network's metrics will be emitted. + +The metrics emitted by temporary networks configured with tmpnet will +have the following labels applied: + + - `network_uuid` + - `node_id` + - `is_ephemeral_node` + - `network_owner` + +When a tmpnet network runs as part of github CI, the following +additional labels will be applied: + + - `gh_repo` + - `gh_workflow` + - `gh_run_id` + - `gh_run_number` + - `gh_run_attempt` + - `gh_job_id`