Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

"Metric request error" when displaying InfluxDB data using FLUX query language in grafana #127

Open
lchtbruno opened this issue Sep 11, 2020 · 3 comments

Comments

@lchtbruno
Copy link

lchtbruno commented Sep 11, 2020

I want to join tables, but I get a metric request error. The data consists of two measurements, with a time and value column.

data_1 = from(bucket:"telegraf/autogen")
  |> range(start:-1h)
  |> filter(fn: (r) =>
    r._measurement == "Dev502_Room6_Temp_ME_AI20" and
    r._field == "value")

data_2 = from(bucket:"telegraf/autogen")
  |> range(start:-1h)
  |> filter(fn: (r) =>
    r._measurement == "Dev502_Room6_Hum_ME_AI21" and
    r._field == "value")

join(tables: {key1: data_1, key2: data_2}, on: ["_time", "_field"], method: "inner")
@ryantxu
Copy link
Member

ryantxu commented Sep 14, 2020

Do each queries work independently? and you only get the error when the join query? If so, can you post the full error?

If the data is not sensitive, can you post the CSV results you see when executing the same query directly against influx?

@ryantxu
Copy link
Member

ryantxu commented Sep 14, 2020

What version are you using? Flux is now supported in grafana core -- try 7.2beta for best results :)

@lkathke
Copy link

lkathke commented Oct 28, 2020

I am getting the same error, I'm testing it with two equal querys:

left = from(bucket: "har/autogen")
|> range(start: -12h)
|> filter(fn: (r) =>
r._measurement == "BezugPV"
)

right = from(bucket: "har/autogen")
|> range(start: -12h)
|> filter(fn: (r) =>
r._measurement == "BezugPV"
)

join(
tables: {l:left, r:right},
on: ["_time"]
)

When I run one query alone, I get the data:
expected
I was also wondering, if the column name "value ee40c9..." is expected behavior?

On running the join, I get:
err

Am I missing something or does join not work?
I am using Grafana v7.2.2 and influxdb 1.8.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants