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 fix inf bucket count #15287

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
11 changes: 11 additions & 0 deletions .chloggen/prometheus-fix-inf-bucket-count.yaml
@@ -0,0 +1,11 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: prometheusremotewriteexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix value of `+Inf` histogram bucket to be equal to total count

# One or more tracking issues related to the change
issues: [4975]
2 changes: 1 addition & 1 deletion cmd/configschema/go.mod
Expand Up @@ -510,7 +510,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_golang v1.13.1-0.20221013115219-dcea97eee2b3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion cmd/configschema/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exporter/prometheusexporter/go.mod
Expand Up @@ -7,7 +7,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.62.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.62.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.62.0
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/client_golang v1.13.1-0.20221013115219-dcea97eee2b3
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.37.0
github.com/prometheus/prometheus v0.38.0
Expand Down
4 changes: 2 additions & 2 deletions exporter/prometheusexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -510,7 +510,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_golang v1.13.1-0.20221013115219-dcea97eee2b3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions pkg/translator/prometheusremotewrite/helper.go
Expand Up @@ -344,10 +344,7 @@ func addSingleHistogramDataPoint(pt pmetric.HistogramDataPoint, resource pcommon
if pt.Flags().NoRecordedValue() {
infBucket.Value = math.Float64frombits(value.StaleNaN)
} else {
if pt.BucketCounts().Len() > 0 {
cumulativeCount += pt.BucketCounts().At(pt.BucketCounts().Len() - 1)
}
infBucket.Value = float64(cumulativeCount)
infBucket.Value = float64(pt.Count())
}
infLabels := createAttributes(resource, pt.Attributes(), settings.ExternalLabels, nameStr, baseName+bucketStr, leStr, pInfStr)
sig := addSample(tsMap, infBucket, infLabels, metric.Type().String())
Expand Down
2 changes: 1 addition & 1 deletion processor/spanmetricsprocessor/go.mod
Expand Up @@ -58,7 +58,7 @@ require (
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_golang v1.13.1-0.20221013115219-dcea97eee2b3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions processor/spanmetricsprocessor/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testbed/go.mod
Expand Up @@ -165,7 +165,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_golang v1.13.1-0.20221013115219-dcea97eee2b3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion testbed/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.