swift-server / swift-prometheus

Prometheus client library for Swift

Home Page:https://swiftpackageindex.com/swift-server/swift-prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of dimensions produces empty metric

freef4ll opened this issue · 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