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

How can I set timestamp to metric? #330

Closed
odg0318 opened this issue Jul 28, 2017 · 2 comments
Closed

How can I set timestamp to metric? #330

odg0318 opened this issue Jul 28, 2017 · 2 comments

Comments

@odg0318
Copy link

odg0318 commented Jul 28, 2017

Hi.

I want to set timestamp to some metrics. In my usage, I gather previous metrics(1 or 2 days ago) and save them with the time. It seems like that it is not supported now and I know that the feature is supported in prometheus exposition format.(https://prometheus.io/docs/instrumenting/exposition_formats/)

metric_name [
  "{" label_name "=" `"` label_value `"` { "," label_name "=" `"` label_value `"` } [ "," ] "}"
] value [ timestamp ]

I will wait for great response.

@juliusv
Copy link
Member

juliusv commented Aug 2, 2017

There's #187 out to allow and implement this for ConstMetrics (which are mostly used in exporters for proxying existing third-party state). I don't think there's a plan to allow setting custom timestamps for normal instrumentation, as that makes less sense and you have less scrape-time hook control there. So I'm closing this in favor of the existing issue.

@juliusv juliusv closed this as completed Aug 2, 2017
@odg0318
Copy link
Author

odg0318 commented Aug 3, 2017

Thanks!

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