Skip to content

Commit

Permalink
fix comments for unit support
Browse files Browse the repository at this point in the history
Signed-off-by: Arianna Vespri <[email protected]>
  • Loading branch information
vesari committed Dec 2, 2023
1 parent 88a6d8b commit 53a2259
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions expfmt/openmetrics_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ import (
// Prometheus to OpenMetrics or vice versa:
//
// - Counters are expected to have the `_total` suffix in their metric name. In
// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
// line. A counter with a missing `_total` suffix is not an error. However,
// the output, the suffix will be truncated from the `# TYPE`, `# HELP` and `# UNIT`
// lines. A counter with a missing `_total` suffix is not an error. However,
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
// output.
//
// - No support for the following (optional) features: `# UNIT` line, `_created`
// - The `# UNIT` line is optional, but if populated, the unit has to be present in the metric
// name as its suffix (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit)
//
// - No support for the following (optional) features: `_created`
// line, info type, stateset type, gaugehistogram type.
//
// - The size of exemplar labels is not checked (i.e. it's possible to create
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ require (
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

replace github.com/prometheus/client_model => github.com/vesari/client_model v0.0.0-20231118150741-19723af61627
replace github.com/prometheus/client_model => github.com/vesari/client_model v0.0.0-20231202151802-003f160da988
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/vesari/client_model v0.0.0-20231118150741-19723af61627 h1:pJsecGZFkJIN3ipp7fS8hLDK0Dcnk2JVxXds3Dev3dQ=
github.com/vesari/client_model v0.0.0-20231118150741-19723af61627/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/vesari/client_model v0.0.0-20231202151802-003f160da988 h1:uGmTMMEergUEb2pEH90ZLVSBGvDqN16P12UsBjEQp0Y=
github.com/vesari/client_model v0.0.0-20231202151802-003f160da988/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down

0 comments on commit 53a2259

Please sign in to comment.