grafana + clickhouse模板变量使用all

在使用dashboard的模板变量时,选择all时,如下clickhouse查询语句查询,无法解析正确执行:

sql 复制代码
SELECT orderId,OrderJsonStr FROM xdatabase."xxxx_table" WHERE   ( createTime  >= $__fromTime AND createTime <= $__toTime )  AND orderId IN (${orderId}) ORDER BY orderId DESC LIMIT 300

优化为:

sql 复制代码
SELECT orderId,OrderJsonStr FROM xdatabase."xxxx_table" WHERE   ( createTime  >= $__fromTime AND createTime <= $__toTime )  AND $__conditionalAll(orderId IN (${orderId:singlequote}), $orderId) ORDER BY orderId DESC LIMIT 300

可正常执行,选择all时语句变为 1=1

参考

ClickHouse Plugin for Grafana - 2.0 Release

相关推荐
W_son14 小时前
14.Grafana 监控看板实战:新建、调优、变量配置全流程
grafana·prometheus
BullSmall2 天前
Prometheus监控栈安全加固全攻略
安全·grafana·prometheus
JasonChen@6664 天前
prometheus静态监控static_config案例四(10)
grafana·prometheus
JasonChen@6666 天前
prometheus静态监控static_config案例二(8)
grafana·prometheus
IT古董12 天前
Grafana 企业级可观测性平台:从零基础到生产级实战完整教程
grafana
闲云野鹤在人间17 天前
Prometheus入门|搭建Prometheus+Node‑Exporter+Grafana完整主机监控平台
grafana·prometheus
Flynn Liang18 天前
Apache Superset 重要特性详解(三):语义层 / 权限 / 缓存 / 嵌入的实战最佳实践(2026 版)
大数据·clickhouse·数据可视化·架构设计·superset·数据分析平台
何中应25 天前
Grafana如何共享面板
运维·grafana·可观测
陈年老古董1 个月前
ClickHouse 单机搭建记录
hive·笔记·学习·clickhouse·硬件架构
何中应1 个月前
Grafana如何安装插件
运维·grafana·可观测