You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Grafana 7.2.1中显示Windows Node Exporter的version标签值?

Troubleshooting: Displaying Windows Node Exporter's version Label in Grafana 7.2.1

Got it, let's work through this step by step—since you're trying to pull that version tag from windows_os_info and display it alone in Grafana 7.2.1, here are actionable fixes and checks to try:

  • First, confirm Prometheus is actually receiving the version label
    Head over to your Prometheus UI (usually at http://<your-prometheus-ip>:9090) and run the query windows_os_info. Look at the results—do you see the version tag listed under the labels for the metric? If not, double-check your Windows Node Exporter config: make sure the os collector is enabled (it should be by default, but sometimes custom configs disable it), and that you're running a Node Exporter version that exposes this tag.

  • Pick the right Grafana panel type
    Graph panels are for time-series data, so they won't work well for showing a single static label value. Instead, use either a Stat Panel or Text Panel:

    • Stat Panel Setup:
      1. Create a new Stat panel and select your Prometheus data source.
      2. In the query editor, enter windows_os_info{instance="<your-node-exporter-instance>"}—replace the instance filter with your actual Node Exporter address (like win-server-01:9182) to avoid returning multiple series (which would cause aggregation and hide the label).
      3. Go to Panel Options > Value and set it to Last (since this is a static value that doesn't change over time).
      4. Under Value Options, you can customize how it displays—toggle "Show value labels" if you want to see the version key alongside the value, or adjust the formatting to just show the version string.
    • Text Panel Setup:
      1. Create a new Text panel and switch to Markdown mode.
      2. Use Grafana's template syntax to pull the label value directly:
        Windows OS Version: {{ query_result("windows_os_info{instance=\"your-node-exporter-instance\"}") | label_value("version") }}
        
        Note: In Grafana 7.2.1, this template function should work, but if you hit issues, you can also use the Explore panel to copy the exact label value and hardcode it temporarily (though dynamic is better).
  • Fix aggregation issues
    If your query returns multiple time series (e.g., multiple Windows servers), Grafana will automatically aggregate results (like averaging or summing), which strips out labels. Always add an instance filter to narrow it down to a single server so the label stays intact.

  • Verify your Grafana data source config
    Double-check your Prometheus data source in Grafana: go to Configuration > Data Sources, select your Prometheus source, and click Test to confirm connectivity. If the test fails, fix the URL or authentication settings first—no data will show up if Grafana can't reach Prometheus.

  • Use the Explore panel to debug
    Open Grafana's Explore tab (the compass icon in the left sidebar), select your Prometheus data source, and run windows_os_info. If you can see the version label here, the problem is in your panel configuration. If you don't see it here, the issue is upstream—either Node Exporter isn't sending it, or Prometheus isn't scraping it correctly.

内容的提问来源于stack exchange,提问作者james

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 15:32:32