Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Prometheus surfacer outputs incorrect TYPE line in histogram #364

Closed
ykawamot opened this issue Feb 12, 2020 · 3 comments
Closed

Prometheus surfacer outputs incorrect TYPE line in histogram #364

ykawamot opened this issue Feb 12, 2020 · 3 comments
Assignees
Milestone

Comments

@ykawamot
Copy link

In prometheus docs,
https://prometheus.io/docs/instrumenting/exposition_formats/#histograms-and-summaries
histogram type has a TYPE line for x and three metrics x_sum, x_count and x_bucket.
However, prometheus surfacer outputs a TYPE line for each metrics.

My configuration:

probe {
  name: "http-probe-test"
  type: HTTP
  targets {
    host_names: "example.com"
  }

  latency_unit: "ms"
  latency_distribution {
    explicit_buckets: "10,100,1000"
  }
}

Expected:

#TYPE latency histogram
latency_sum{ptype="http",probe="http-probe-test",dst="example.com"} 45896.18931099989 1581510329070
latency_count{ptype="http",probe="http-probe-test",dst="example.com"} 4644 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="10"} 4598 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="100"} 4644 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="1000"} 4644 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="+Inf"} 4644 1581510329070

Actual:

#TYPE latency_sum histogram
latency_sum{ptype="http",probe="http-probe-test",dst="example.com"} 45896.18931099989 1581510329070
#TYPE latency_count histogram
latency_count{ptype="http",probe="http-probe-test",dst="example.com"} 4644 1581510329070
#TYPE latency_bucket histogram
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="10"} 4598 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="100"} 4644 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="1000"} 4644 1581510329070
latency_bucket{ptype="http",probe="http-probe-test",dst="example.com",le="+Inf"} 4644 1581510329070
@manugarg manugarg self-assigned this Feb 18, 2020
@manugarg
Copy link
Contributor

@ykawamot Thanks a lot for reporting this. This indeed looks like a bug. I'll try to submit a fix soon.

manugarg added a commit that referenced this issue Feb 19, 2020
See #364 for the background.

= For distributions, don't record derived metrics: <metric>_sum, <metric>_count, <metric>_bucket as independent metrics. Instead of that, store derived metric names in the data keys.

Screenshot: http://screen/aqVaeUPJ2ff
PiperOrigin-RevId: 295877661
manugarg added a commit that referenced this issue Feb 19, 2020
See #364 for the background.

= For distributions, don't record derived metrics: <metric>_sum, <metric>_count, <metric>_bucket as independent metrics. Instead of that, store derived metric names in the data keys.

PiperOrigin-RevId: 295877661
@manugarg
Copy link
Contributor

9a0f182 fixes it. New release is due next week.

@manugarg manugarg added this to the v0.10.7 milestone Feb 19, 2020
@ykawamot
Copy link
Author

Thank you, I confirmed that is working correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants