繁体   English   中英

查询以在 Grafana 中显示标签值(使用 prometheus)

[英]Query to show label values in Grafana (using prometheus)

我有以下格式的指标:

code_smells_count{BLOCKER="176",CRITICAL="52",MAJOR="3784",instance="localhost:8080",job="my-metrics",domainId="65",domain="Sales",product="EmployeeSales",project_key="employee-sales"} 5000

我正在尝试编写一个仅在仪表中显示BLOCKER值的查询。

我试过:

sum(code_smells_count{product="[[product]]"})by (BLOCKER)

但这不起作用,因为它返回code_smells_count{product="[[product]]" ,而我只想要BLOCKER="176"

有什么建议?

谢谢

在 Grafana 中,您可以通过以下方式显示标签的值:

  1. 可视化:单一统计
  2. 查询:格式应该是table
  3. 可视化:然后应该显示要显示的标签的下拉菜单(默认名称)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM