Including timestamp in metric
See original GitHub issueHello,
I’d like to include the timestamp in the metric according to the Prometheus documentation: https://prometheus.io/docs/instrumenting/exposition_formats/
metric_name [
"{" label_name "=" `"` label_value `"` { "," label_name "=" `"` label_value `"` } [ "," ] "}"
] value [ timestamp ]
I’d like that feature for the following reason: Some exporters take a while to gather certain information. Therefore I would like to run them asynchronously, not only when the endpoint is scraped. To guarantee that the metrics are as accurate as possible, I’d like to include the timestamp with the metric.
Currently, I don’t think this is possible.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Adding timestamps to Gauge Metric - Google Groups
Hi everyone, I am new to prometheus. I am using type Gauge. I wanted to get the timestamp along with the value. It...
Read more >Prometheus metrics with timestamp - Stack Overflow
Solution: Perform regular query and filter the timestamp value from timestamps array. The response is a JSON output which consists of ...
Read more >How to Use a Prometheus Label as a Timestamp for Grafana
I want to make a graph with label 'date' by X-axis and metric value by Y-axis. There should be value points for different...
Read more >Metric With Timestamp : r/PrometheusMonitoring - Reddit
I was reading the book “Prometheus Up and Running” and the author mentioned that it is possible to expose a metric with a...
Read more >Is there any way to POST metrics with custom timestamp value?
For metrics, no, there is no way to specify a timestamp other than the time that the POST is received by New Relic's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have question regarding the timestamp value type. The prometheus docs say:
Looking at the python parser and its tests floats (I think microseconds) are used for the timestamps.
What is the right format / type? Am I missing something?
A workaround is proposed here: https://github.com/prometheus/client_python/issues/588#issuecomment-1054724554