最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Grafana showing InfluxDB field name with tag value after it - Stack Overflow

programmeradmin0浏览0评论

I'm new to Grafana and currently trying to show stats for a given week on a dashboard with InfluxDB as the source. I'm using a query as below to retrieve a metric for visualization where a grafana variable is passed to the query for the week to show. This is stored in InfluxDB as a tag, so tag("week", "2") for example. The issue i have is that grafana creates the field as the field name + the tag value, so 'in_use 2' for example. This means when selecting the field for the visualization it doesn't give the option for just 'in_use' and doesn't update.

from(bucket: "my_bucket")

  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "memory")
  |> filter(fn: (r) => r["week"] == "${week}")
  |> filter(fn: (r) => r["_field"] == "in_use" or r["_field"] == "total")

Anyone know how to get round this or what i'm doing wrong?

发布评论

评论列表(0)

  1. 暂无评论