[-] fix quoting $databases var in pgbouncer dashboard#1349
Merged
0xgouda merged 5 commits intocybertec-postgresql:masterfrom Apr 3, 2026
Merged
[-] fix quoting $databases var in pgbouncer dashboard#13490xgouda merged 5 commits intocybertec-postgresql:masterfrom
$databases var in pgbouncer dashboard#13490xgouda merged 5 commits intocybertec-postgresql:masterfrom
Conversation
with the default use of the $databases variable in Grafana, the quoting is wrong when there is only one DB selected by the user.
Collaborator
|
Can you share before and after screenshots? |
Contributor
Author
|
Before this fix, there is just empty panels with an error:
The query is just : select
floor(extract(epoch from time)/120)*120 AS "time",
avg((c - c_lag) / extract(epoch from time - time_lag)) as tps
from (
select
(data->>'total_xact_count')::int8 as c, lag((data->>'total_xact_count')::int8) over w as c_lag,
time, lag(time) over w as time_lag
from pgbouncer_stats
where data->>'database' in (dotclear) and dbname = 'pgb_spokane' and time BETWEEN '2026-04-03T07:09:03.82Z' AND '2026-04-03T07:24:03.82Z'
window w as (order by data->>'database', time)
) x
where c >= c_lag and time > time_lag
group by 1
order by 1You can see the value dotclear which should be quoted. Grafana manage that with a format option : https://grafana.com/docs/grafana/latest/visualizations/dashboards/variables/variable-syntax/ which gives : ${databases:singlequote} which fix this problem. best regards, |
0xgouda
approved these changes
Apr 3, 2026
$databases var in pgbouncer dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
with the default use of the $databases variable in Grafana, the quoting is wrong when there is only one DB selected by the user.
AI & Automation Policy
AI/automation tools used (leave blank if none):