query to plot graph to monitor endpoints

37 views
Skip to first unread message

Keshav Sinha

unread,
Jan 24, 2024, 11:07:22 AM1/24/24
to Prometheus Users
Hi Team,

I need help creating a query where I can plot the graph at the X-axis denotes (URL UP /Down Status) and on the Y-Axix denotes response time in per sec

please help me to create something like this 

sample graph i added here 


WhatsApp Image 2024-01-24 at 21.00.33.jpeg

Brian Candler

unread,
Jan 24, 2024, 12:48:03 PM1/24/24
to Prometheus Users
I don't think it's a question of "creating a query" unless you've already got this data in Prometheus - and if you have, you need to show what metrics you have before anyone can advise on queries against them.

If you're not already collecting the data then that would be the starting point. If the data is coming from web server logs then you could look at mtail or grok_exporter. If you're going to add native instrumentation to your web server then you have more options. 

For response latency, remember that one collection interval can cover many requests: do you want the graph to show the mean response time, the median, the 99th percentile, something else? You might want to consider collecting data in histograms to allow for richer querying.

Up/down is generally a more straightforward: a metric like 0/1. Again you'll have to decide where and how to collect it.

Visualizations require a separate front-end like Grafana. The timeline view should be doable. However, the Grafana community would be a better place to ask questions about Grafana.
Reply all
Reply to author
Forward
0 new messages