Skip to content

Commit 53a2259

Browse files
committed
fix comments for unit support
Signed-off-by: Arianna Vespri <[email protected]>
1 parent 88a6d8b commit 53a2259

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

expfmt/openmetrics_create.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ import (
4747
// Prometheus to OpenMetrics or vice versa:
4848
//
4949
// - Counters are expected to have the `_total` suffix in their metric name. In
50-
// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
51-
// line. A counter with a missing `_total` suffix is not an error. However,
50+
// the output, the suffix will be truncated from the `# TYPE`, `# HELP` and `# UNIT`
51+
// lines. A counter with a missing `_total` suffix is not an error. However,
5252
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
5353
// output.
5454
//
55-
// - No support for the following (optional) features: `# UNIT` line, `_created`
55+
// - The `# UNIT` line is optional, but if populated, the unit has to be present in the metric
56+
// name as its suffix (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit)
57+
//
58+
// - No support for the following (optional) features: `_created`
5659
// line, info type, stateset type, gaugehistogram type.
5760
//
5861
// - The size of exemplar labels is not checked (i.e. it's possible to create

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ require (
3232
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3333
)
3434

35-
replace github.com/prometheus/client_model => github.com/vesari/client_model v0.0.0-20231118150741-19723af61627
35+
replace github.com/prometheus/client_model => github.com/vesari/client_model v0.0.0-20231202151802-003f160da988

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
4242
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
4343
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
4444
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
45-
github.com/vesari/client_model v0.0.0-20231118150741-19723af61627 h1:pJsecGZFkJIN3ipp7fS8hLDK0Dcnk2JVxXds3Dev3dQ=
46-
github.com/vesari/client_model v0.0.0-20231118150741-19723af61627/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
45+
github.com/vesari/client_model v0.0.0-20231202151802-003f160da988 h1:uGmTMMEergUEb2pEH90ZLVSBGvDqN16P12UsBjEQp0Y=
46+
github.com/vesari/client_model v0.0.0-20231202151802-003f160da988/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
4747
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
4848
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
4949
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

0 commit comments

Comments
 (0)