hassio-addons / addon-grafana

Grafana - Home Assistant Community Add-ons
https://addons.community
MIT License
220 stars 61 forks source link

Problem with flux #274

Closed inhuman closed 2 years ago

inhuman commented 2 years ago

Problem/Motivation

I try to use flux for query from influxdb and one of fields is json and i want to parse it

Flux guide says that i must use "experimental/json" package

For testing i use this query

`import "experimental/json"

from(bucket: "homeassistant/autogen") |> map( fn: (r) => { jsonStr = "{\"test\": \"123\"}"
data = json.parse(data: bytes(v: jsonStr)) return { str: data } } ) |> yield()`

When i do this, i receive the error 500 Internal Server Error: type error 1:1-1:27: unknown import path: "experimental/json"

But package "experimental" works fine

Expected behavior

Package "experimental/json" imports and works

Actual behavior

500 Internal Server Error: type error 1:1-1:27: unknown import path: "experimental/json"

Steps to reproduce

  1. Install grafana and influx addons
  2. ADd board in grafana, add panel and set query like this ` import "experimental/json"

from(bucket: "homeassistant/autogen") |> map( fn: (r) => { jsonStr = "{\"test\": \"123\"}"
data = json.parse(data: bytes(v: jsonStr)) return { str: data } } ) |> yield() `

Proposed changes

May be need to update grafana version

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

inhuman commented 2 years ago

issue not resolved