[+] add Single Query Details prom dashboard, fixes #1169#1179
Conversation
|
Hi @0xgouda , i have set up a single-query Prometheus dashboard for review, I only included 2 panels for now to make sure the logic is correct before i build the rest. |
|
Looks good, please continue. No need to create the dashboard for v11. |
Pull Request Test Coverage Report for Build 22163235022Details
💛 - Coveralls |
|
@0xgouda i think it is ready now, unless you need to implement new panels other than the already exiting ones in pg dashboard |
4aff950 to
a632cdf
Compare
|
@Bishoywadea, Thanks for your time!
|
|
@0xgouda i could make a PR for making |
I will update the pg dashboard very soon, and then I will fix it.
yeah we probably should, but this would require careful consideration for the scraping interval and the metric fetch interval so |
hmm, yes i think converting them all will be more complex than i thought, i’ll think about it more and propose a solution, then we could make an issue to convert all of it, but first i think we need something global to coordinate the fetch and scrape time intervals across all the project (i still don't know how just brainstorming with you) |
There is no global right answer; each metric has its own fetching interval (real-time critical metrics are fetched more frequently, and heavy ones can be fetched up to every The old way (current one) was to let users specify the aggregation interval but it's not very good. Actually, I am in the process of refactoring most of the prom dashboards, and I am considering this. |
|
Okay good luck with it, and i will keep my eye on the issues to see if i could help |
|
hi @0xgouda just checking in on the status of this PR i addressed all the previous feedback is there anything else need me to do before this can be merged? |
79c40f3 to
f1b3af8
Compare
|
Hi @Bishoywadea
|
ok no problem but do you mean convert
this is gaurd to prevent division by zero |
Yeah use |
@0xgouda related to this comment in the below image shows that querying with
|
|
Just use |
|
hi @0xgouda sorry for responding late i was busy please reconsider it again or give me additional details like what is the logic do you want the prom query to be ? |
pg_stat_statements will already store the fields as counters, so if we have 2 entities one with |
8a1e257 to
f1b3af8
Compare
It works for me; probably there is a problem with your gathered data, let me inspect. but otherwise I will just add a couple more panels and by tomorrow or so, this should be ready for merging. |
|
You probably have both because are you using the debug preset? or how are you running pgwatch? |
|
but i think all things are clear now and i got why the other databases are not getting duplicated query id because when i saw the mode of metrics presets of them now it is set on full |
|
ok that is the problem. So yeah, please use the full preset instead. But also, this is a problem on our behalf, we shouldn't let the debug preset cause some dashboards to be broken, so I probably have to update it to not include both |
Single Query Details prom dashboard, fixes #1169
…oard for Prometheus
…tails dashboard for Prometheus
…Details dashboard for Prometheus
…oard for Prometheus
…tom `$agg_interval` and correct average runtime calculation.
1. change panels ordering 2. don't use `sum by()` 3. add `Execution time per call` panel
ea439a1 to
71e8c6f
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new Prometheus-focused Grafana dashboard to drill into metrics for a single pg_stat_statements query, and wires it into the existing Query Performance Analysis dashboard via data links (addressing #1169).
Changes:
- Added new “Single Query Details (Prometheus)” dashboard for per-query investigation using
dbname+queryid. - Added “View Query Details” data links across relevant panels in “3. Query Performance Analysis (Prometheus)” to deep-link into the new dashboard with the right variables/time range.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| grafana/prometheus/v12/single-query-details-prometheus.json | New dashboard for detailed per-query Prometheus metrics (calls, timings, buffer/IO, temp usage, etc.). |
| grafana/prometheus/v12/3-query-performance-analysis-prometheus.json | Adds per-series data links to open the new single-query dashboard pre-populated with dbname/queryid. |











Add
Single query detailsprom dashboard:Add link to the dashboard in the
Query Performance Analysisprom dashboard for investigating individual queriesCloses: #1169