bitcoin-dev-project / bitcoin-dev-project/warnet

If I add additional metrics for Prometheus/Grafana, the default metrics are no longer populated

Open
#693 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
149
Forks
83
Avg merge
4d 8h
Merged PRs (30d)
2

Description

I added some additional metrics, e.g. related to fee rate, and found that the default metrics were no longer populated.

That is, in specifying metrics such as the following in my `network.yaml`, the default Grafana dashboard no longer had any data. I was expecting and metrics I specified to be in addition/additive to the default metrics

```
metrics: fee_estimate_1=estimatesmartfee(1)["feerate"] fee_estimate_2=estimatesmartfee(2)["feerate"] fee_estimate_6=estimatesmartfee(6)["feerate"] fee_estimate_24=estimatesmartfee(24)["feerate"]
```

So if the user wishes to add additional metrics and maintain the default metrics, they must currently add the default metrics to their metrics specification:

```
metrics: blocks=getblockcount() inbounds=getnetworkinfo()["connections_in"] outbounds=getnetworkinfo()["connections_out"] mempool_size=getmempoolinfo()["size"] fee_estimate_1=estimatesmartfee(1)["feerate"] fee_estimate_2=estimatesmartfee(2)["feerate"] fee_estimate_6=estimatesmartfee(6)["feerate"] fee_estimate_24=estimatesmartfee(24)["feerate"]
```

Should any metrics provided by the user be additive to the default metrics? Or is the current behaviour ok - user has full control over what metrics are collected. The main downside of the latter is that the user will have empty Grafana Dashboards:

Image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the metrics specification in network.yaml is parsed and how default metrics are passed to Prometheus and the Grafana dashboard. Compare behavior with and without user-defined metrics; done means custom metrics are retained alongside the defaults and the default dashboard remains populated.

Written by the indexing model from the issue text.

Assessment

Tech stack
grafana, prometheus, python
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.