influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

task runs manually but not scheduled

Open xhejtman opened this issue 2 years ago • 2 comments

Hello,

I have community influx 2.6.1, with the following task:

import "join"

option task = {name: "cq_cerit_cpu_used_perc_by_cluster", every: 1h, offset: 10m}

data_avail =
    from(bucket: "pbs-cerit")
        |> range(start: -3h, stop: now())
        |> filter(fn: (r) => r["_measurement"] == "av_state")
        |> filter(fn: (r) => r["_field"] == "cpu_avail")
        |> group(columns: ["cluster"])
        |> aggregateWindow(fn: sum, every: 1m)

data_used =
    from(bucket: "pbs-cerit")
        |> range(start: -3h, stop: now())
        |> filter(fn: (r) => r["_measurement"] == "av_state")
        |> filter(fn: (r) => r["_field"] == "cpu_used")
        |> group(columns: ["cluster"])
        |> aggregateWindow(fn: sum, every: 1m)

data_perc =
    join.tables(
        method: "inner",
        left: data_used,
        right: data_avail,
        on: (l, r) => l._time == r._time,
        as: (l, r) => ({l with avail: r._value}),
    )
        |> filter(fn: (r) => r["avail"] > 0 and r["_value"] >= 0)
        |> map(fn: (r) => ({r with _value: r._value * 100.0 / r.avail}))

data_perc
    |> aggregateWindow(fn: mean, every: 1h)
    |> map(fn: (r) => ({r with _field: "percent", _measurement: "cpu_used_perc_by_cluster"}))
    |> to(bucket: "pbs-cerit-agr")

it works ok, if I run it manually, but nothing is produced when running schedulled. If I remove the aggregateWindow(fn: mean, every: 1h), it works even schedulled.

Is this a bug?

xhejtman avatar Mar 22 '23 17:03 xhejtman

I have almost exactly the same problem. Did you find a solution to this?

RalphCodesTheInternet avatar Aug 21 '24 11:08 RalphCodesTheInternet

nope

xhejtman avatar Aug 21 '24 11:08 xhejtman