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 plugin: incorrect counter retrieval for summary and histogram types #1336

Closed
tobischo opened this issue Jun 6, 2016 · 1 comment

Comments

@tobischo
Copy link
Contributor

tobischo commented Jun 6, 2016

Bug report

System info:

Telegraf 0.13.1

Steps to reproduce:

  1. Setup a service with prometheus /metrics endpoint
  2. Load data metrics endpoint of that service

Expected behavior:

When parsing the output anything with a _count should be properly parsed into the count field of the telegraf.Metric

Actual behavior:

The count value stays 0 and is sent with 0 in every dataset.
e.g.

http_request_duration_seconds,code=200,host=localhost,method=get,path=/metrics,url=http://localhost:4007/metrics 0.5=0.003071558,0.9=0.003609577,0.99=0.003609577,count=0,sum=0.009393333 1465218854910415916

Additional info:

There are actually tests for this, but they test it in the same wrong way, namely by expecting 0.
See for test data:

http_request_duration_microseconds_count{handler="prometheus"} 9

See for (invalid) expectation:

The issue appears to be caused by selecting the wrong prometheus metrics type when filling the telegraf.Metric

See

fields["count"] = float64(m.GetHistogram().GetSampleCount())
where actually the wrong type is selected for count but not for sum.

@sparrc
Copy link
Contributor

sparrc commented Jun 10, 2016

closed by #1337

@sparrc sparrc closed this as completed Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants