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

相关推荐
LoneEon4 天前
Ubuntu 部署 ClickHouse:高性能分析型数据库(附shell脚本一键部署↓)
数据库·clickhouse
恒悦sunsite4 天前
Ubuntu之apt安装ClickHouse数据库
数据库·clickhouse·ubuntu·列式存储·8123
散一世繁华,颠半世琉璃6 天前
Prometheus+Grafana轻松实现SpringBoot应用监控
spring boot·grafana·prometheus
LoneEon8 天前
Ubuntu 系统安装 Prometheus+Grafana(附shell脚本一键部署↓)
ubuntu·grafana·prometheus
Coco_淳10 天前
K8s平台部署Grafana + Loki + Promtail日志收集系统
kubernetes·grafana·日志·loki
文人sec10 天前
性能测试-jmeter15-性能项目计划流
分布式·jmeter·性能优化·grafana·prometheus·模块测试
Knight_AL10 天前
Spring Cloud Gateway 实战:全局过滤器日志统计与 Prometheus + Grafana 接口耗时监控
spring boot·spring cloud·grafana·prometheus
问道飞鱼11 天前
【大数据技术】ClickHouse配置详细解读
大数据·clickhouse·配置信息
麦兜*11 天前
Redis监控告警体系搭建:使用Redis Exporter + Prometheus + Grafana
java·spring boot·redis·spring·spring cloud·grafana·prometheus