Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana-PostgreSql Macro didn't work #6

Open
theodofi opened this issue Dec 21, 2022 · 1 comment
Open

Grafana-PostgreSql Macro didn't work #6

theodofi opened this issue Dec 21, 2022 · 1 comment

Comments

@theodofi
Copy link

I just create new panel in a dashboard with the same syntax from anohter panel and it doesn't work. for example I copied query from withdraw by peer panel in Top By prefixes dashboard, the query is SELECT $__timeGroup(interval_time, $__interval) as time, sum(withdraws), p.PeerName as metric FROM stats_chg_bypeer l JOIN v_peers p ON (p.peer_hash_id = l.peer_hash_id) WHERE $__timeFilter(interval_time) AND l.peer_hash_id in ($peer_hash) group by peername,time order by time

I create new panel, and paste that query to it. It comes error db query error: pq: syntax error at or near "$". I suspect grafana macros for Postgresql is not working while I create new panel in a dashboard. Any solution?
image

@theodofi theodofi changed the title Grafana-PosgreSql Macro didn't work Grafana-PostgreSql Macro didn't work Dec 21, 2022
@TimEvens
Copy link
Contributor

There is a button on the same line as the datasource (where you expanded the Query Options) on the right with the label "Query Inspector". When you click this, it'll open a panel showing the rendered query, with the macros changed to query syntax. What does the rendered query show there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants