Skip to content

Commit

Permalink
fix(metrics): labels need to be lowercase underscore format (#1574)
Browse files Browse the repository at this point in the history
## Description

The current metrics names/labels are not compatible with the OpenMetrics
format and prometheus declines to ingest them.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [ ] Documentation updates if relevant.
- [ ] Tests if relevant.
  • Loading branch information
Arqu authored Oct 4, 2023
1 parent 37df325 commit 81c6f04
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion iroh-gossip/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Iroh Gossip"
"gossip"
}
}
2 changes: 1 addition & 1 deletion iroh-net/src/derp/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Derpserver"
"derpserver"
}
}
2 changes: 1 addition & 1 deletion iroh-net/src/magicsock/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Magicsock"
"magicsock"
}
}
2 changes: 1 addition & 1 deletion iroh-net/src/netcheck/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Netcheck"
"netcheck"
}
}
2 changes: 1 addition & 1 deletion iroh-net/src/portmapper/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Portmap"
"portmap"
}
}
2 changes: 1 addition & 1 deletion iroh-sync/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"iroh-sync"
"iroh_sync"
}
}
2 changes: 1 addition & 1 deletion iroh/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Default for Metrics {

impl Metric for Metrics {
fn name() -> &'static str {
"Iroh"
"iroh"
}
}

Expand Down

0 comments on commit 81c6f04

Please sign in to comment.