Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus: Remove unit suffix for unit 1 #4131

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

- The `go.opentelemetry.io/otel/exporters/prometheus` exporter do not add `_ratio` suffix for unit "1" anymore when unit suffix feature is enabled. (#4131)

## [1.16.0/0.39.0] 2023-05-18

This release contains the first stable release of the OpenTelemetry Go [metric API].
Expand Down
1 change: 0 additions & 1 deletion exporters/prometheus/exporter.go
Expand Up @@ -313,7 +313,6 @@ func sanitizeRune(r rune) rune {
}

var unitSuffixes = map[string]string{
"1": "_ratio",
"By": "_bytes",
"ms": "_milliseconds",
}
Expand Down
6 changes: 3 additions & 3 deletions exporters/prometheus/testdata/gauge.txt
@@ -1,6 +1,6 @@
# HELP bar_ratio a fun little gauge
# TYPE bar_ratio gauge
bar_ratio{A="B",C="D",otel_scope_name="testmeter",otel_scope_version="v0.1.0"} .75
# HELP bar a fun little gauge
# TYPE bar gauge
bar{A="B",C="D",otel_scope_name="testmeter",otel_scope_version="v0.1.0"} .75
# HELP otel_scope_info Instrumentation Scope metadata
# TYPE otel_scope_info gauge
otel_scope_info{otel_scope_name="testmeter",otel_scope_version="v0.1.0"} 1
Expand Down
6 changes: 3 additions & 3 deletions exporters/prometheus/testdata/without_scope_info.txt
@@ -1,6 +1,6 @@
# HELP bar_ratio a fun little gauge
# TYPE bar_ratio gauge
bar_ratio{A="B",C="D"} 1
# HELP bar a fun little gauge
# TYPE bar gauge
bar{A="B",C="D"} 1
# HELP target_info Target metadata
# TYPE target_info gauge
target_info{service_name="prometheus_test",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="latest"} 1