swift-server/swift-prometheus

Use of dimensions produces empty metric

freef4ll opened this issue · 0 comments

If one creates a Gauge or a Counter with dimensions, an exported value actually contains 2 metrics, this when visualized in Grafana will also result in 2 graphs, one which displays the initial 0 value and one with the actual metric:

let g = Gauge(label: "test_gauge", dimensions: [("abc", "123")])
g.record(10)

This will produce the output of:

# TYPE test counter
test_gauge 0
test_gauge{abc="123"} 10

The issue is slightly touched on in #77

Potential fix/workaround might be master...ordo-one:SwiftPrometheus:gauge_label