我可以使用 Grafana table 列出所有向 Prometheus 报告的节点吗?
Can I use a Grafana table to list all nodes reporting to Prometheus?
我使用 Node Exporter Server Metrics 仪表板可视化来自 prometheus 的服务器指标。
我想构建一个 table 来列出报告特定作业的所有节点,并 link 向该节点的服务器指标仪表板发送报告。
我一直在尝试执行如下查询:up{job="telemetry-node"}
。问题是 return 只是值 "1"
,因为节点已启动,所以 table 想要列出时间序列数据,我无法找出一个查询return 关于节点的信息,我可以在 table.
中显示
我通过将 Legend Format
设置为 {{instance}}
以在 table 中将实例名称列为 Metric
,以一种 hacky 的方式实现了这一点,设置 override relative time
到 1s
,并使用列样式隐藏 Time
和 Value
。我真的很想找到更好的解决方案。
通过适当的解决方案或我上面的 hackjob,我可以将 table 的内容格式化为另一个仪表板的 link 吗?我看到我可以在 General
设置中设置 Drilldown Link
但这似乎是针对面板的,而不是 table.
中的个别条目
感谢您的帮助!
似乎有一个非常early version of a plugin that can link table rows 可以做你想做的事情(但我还没有尝试过那个)。
开箱即用的 Grafana 可以做什么:
- 使用查询
label_values(instance)
创建一个 template variable for your dashboard,为您提供所有实例。并将其设置为 "multiple values" 并设置为 "include all values" 以使用下面的重复选项。您可以稍后隐藏它并将其作为 URL 参数传递。
- 有一行或任何面板 repeats itself using the template variable
- 在每个面板上,您可以添加一个 Drilldown Link。在文本面板中,您可以直接创建 HTML link。您可以将模板变量的当前值传递给 link.
我使用 Node Exporter Server Metrics 仪表板可视化来自 prometheus 的服务器指标。
我想构建一个 table 来列出报告特定作业的所有节点,并 link 向该节点的服务器指标仪表板发送报告。
我一直在尝试执行如下查询:up{job="telemetry-node"}
。问题是 return 只是值 "1"
,因为节点已启动,所以 table 想要列出时间序列数据,我无法找出一个查询return 关于节点的信息,我可以在 table.
我通过将 Legend Format
设置为 {{instance}}
以在 table 中将实例名称列为 Metric
,以一种 hacky 的方式实现了这一点,设置 override relative time
到 1s
,并使用列样式隐藏 Time
和 Value
。我真的很想找到更好的解决方案。
通过适当的解决方案或我上面的 hackjob,我可以将 table 的内容格式化为另一个仪表板的 link 吗?我看到我可以在 General
设置中设置 Drilldown Link
但这似乎是针对面板的,而不是 table.
感谢您的帮助!
似乎有一个非常early version of a plugin that can link table rows 可以做你想做的事情(但我还没有尝试过那个)。
开箱即用的 Grafana 可以做什么:
- 使用查询
label_values(instance)
创建一个 template variable for your dashboard,为您提供所有实例。并将其设置为 "multiple values" 并设置为 "include all values" 以使用下面的重复选项。您可以稍后隐藏它并将其作为 URL 参数传递。 - 有一行或任何面板 repeats itself using the template variable
- 在每个面板上,您可以添加一个 Drilldown Link。在文本面板中,您可以直接创建 HTML link。您可以将模板变量的当前值传递给 link.