Regarding prometheus graps

26 views
Skip to first unread message

PK

unread,
Oct 7, 2021, 4:59:10 AM10/7/21
to Prometheus Users
I am monitoring an application. For which Prometheus server is scraping the matrices at the endpoint along with the timestamp.
But in prometheus graph It is not getting displayed for timestamps that are differ in millisecond. For eg:
metric_name{name:"abc"} val1  1633586593322    // 2021-10-07T06:03:13.322Z
metric_name{name:"abc"} val2  1633586593578    //2021-10-07T06:03:13.578Z
metric_name{name:"abc"} val3  1633586593983    //2021-10-07T06:03:13.983Z
metric_name{name:"abc"} val4  1633586594322    //2021-10-07T06:03:14.322Z
metric_name{name:"abc"} val5  1633586595322    //2021-10-07T06:03:15.322Z

In The Prometheus graph, it is not showing the second and third time-series data(the second and third are occurring at the same second as the first one but in millisecond is different).  It is showing the first, fourth, and fifth time-series data.

Bjoern Rabenstein

unread,
Oct 7, 2021, 7:35:24 AM10/7/21
to PK, Prometheus Users
You needed a very high resolution graph to see all those samples. Note
that for a graph, a range query is performed, see
https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries

The step parameter in this query is chosen to match the resolution of
the graph (or even longer if you aren't interested in rendering as
many points as your screen has pixels). I doubt that any grafing
frontend will ever query a step of shorter than 1s.

In any case, you just get one point per step, and it will be the most
recent sample before each point in time.

If you want to inspect the samples actually in the TSDB, you can use
the following trick:

- Go to the "Table" view of the Prometheus Graph UI.
- Type a query like the following:
metric_name{name:"abc"}[10m]
- You'll see essentially a dump of all the samples in the last 10m.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in

PK

unread,
Oct 9, 2021, 11:54:24 PM10/9/21
to Prometheus Users
Thank you.
Reply all
Reply to author
Forward
0 new messages