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 to honour parsed timestamp #2593

Closed
djjorjinho opened this issue Mar 29, 2017 · 3 comments
Closed

Prometheus plugin to honour parsed timestamp #2593

djjorjinho opened this issue Mar 29, 2017 · 3 comments
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@djjorjinho
Copy link
Contributor

Parser is gathering the metric timestamp here:
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/prometheus/parser.go#L89

But then it gets ignored and the current time is used instead:
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/prometheus/prometheus.go#L148

Expected behavior:

When I expose a prometheus metric with a timestamp like the example:

# HELP test_metric Metric read from /tmp/node_exporter/textfile/test_metric.prom
# TYPE test_metric untyped
test_metric{label="value"} 1.0 1490802350

I expect the test output to be something like the example:

test_metric,label=value,url=http://localhost:3002/metrics value=1.0 1490802350000000000

Actual behavior:

The output timestamp uses the current time

test_metric,label=value,url=http://localhost:3002/metrics value=1.0 1490809413000000000
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Mar 29, 2017
@danielnelson danielnelson added this to the 1.3.0 milestone Mar 29, 2017
@danielnelson
Copy link
Contributor

@djjorjinho Should be an easy fix now that you have it all figured out, do you want to make up a PR?

@djjorjinho
Copy link
Contributor Author

djjorjinho commented Mar 29, 2017 via email

@djjorjinho
Copy link
Contributor Author

@danielnelson I've created #2596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants