I am trying to run a task that calculates status up and down percentages from a bucket ‘gantry’. I have defined the thresholds in another bucket ‘thresholds’ with static data. How can i retrieve the info from the ‘thresholds’ bucket and use it in my current task?
This is a snippet. Here, instead of hardcoding 60.0, I want to retrieve it from the _value column from the thresholds bucket. Is it possible in InfluxDB?
gw_combined_uptime
|> map(
fn: (r) =>
({
_time: now(),
_measurement: “pg_status”,
_field: “uptime_percentage”,
facility: “Gateway”,
Metric_area: “Mechatronics”,
parent_grouping: “Gantry_System”,
status: if r._value >= 60.0 then “up” else “down”,
_value: if not exists r._value or r._value == 0 then 0.0 else r._value,
}),
)
}