influxdata / influxdata/kapacitor
Unable to get host name from the aggregation query on the tag name.
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hi Nathaniel,
Below is my code to determine the anomaly in cpu_idle measurement.
I am writing the log into the measurement 'cpu_idle_anomaly'.
On doing an aggregation query on the tag name, i am not getting the host name which i need to enter in cpu_idle_anomaly.
`var one_min_old = batch
|query('SELECT mean(value), stddev(value) from sensu."default".cpu_idle group by host')
.offset(10s)
.period(10s)
.every(10s)
.align()
|shift(10s)
var new = batch
|query('SELECT mean(value) from sensu."default".cpu_idle group by host')
.period(10s)
.every(10s)
.align()
one_min_old
|join(new)
.as('one_min_old','new')
|alert()
.crit(lambda: (abs("new.mean" - "one_min_old.mean") > ( 1.0 * "one_min_old.stddev")))
.log('/tmp/test1.log')
|influxDBOut()
.database('sensu')
.retentionPolicy('default')
.measurement('cpu_idle_anomaly')`
Can u please help?
Contributor guide
Research direction
Start by reproducing the aggregation query using the provided TICKscript, focusing on the group-by-host query, join, and influxDBOut stages. Trace whether the host tag remains available after the join and output to cpu_idle_anomaly; done when the host is preserved or the limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100