Try this:
stream
// Select just the queue count measurement from our database.
|from()
.database('service')
.retentionPolicy('default')
.measurement('httpjson_flash_conversion_workers')
|window()
.period(5m)
.every(5m)
|median('queued')
.as('queued')
|alert()
.id('IronWorker Conversions Queue')
.message('{{ .ID }} is {{ .Level }} messages queued:{{ index
.Fields "queued" }}')
.info(lambda: "queued" > 100)
.warn(lambda: "queued" > 250)
.crit(lambda: "queued" > 500)
.stateChangesOnly()
// Whenever we get an alert write it to slack
.slack()
.channel('#dev')
On Thursday, September 1, 2016 at 9:11:22 AM UTC-6, Bubba Hines wrote:
>
> I currently have tick script like so:
>
>
> stream
> // Select just the queue count measurement from our database.
> |from()
> .database('service')
> .retentionPolicy('default')
> .measurement('httpjson_flash_conversion_workers')
> |alert()
> .id('IronWorker Conversions Queue')
> .message('{{ .ID }} is {{ .Level }} messages queued:{{ index
> .Fields "queued" }}')
> .info(lambda: "queued" > 100)
> .warn(lambda: "queued" > 250)
> .crit(lambda: "queued" > 500)
> .stateChangesOnly()
> // Whenever we get an alert write it to slack
> .slack()
> .channel('#dev')
>
>
> I'd like to convert it so that it alerts when the median message count has
> been above the levels for a period of time (demonstrating that the queue is
> backed up), say 5 minutes. I'm struggling to comprehend how the .window()
> and .median() nodes can be combined to achieve this. I'd certainly
> appreciate any assistance and pointers to documentation demonstrating
> something like this.
>
--
Remember to include the InfluxDB version number with all issue reports
---
You received this message because you are subscribed to the Google Groups
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit
https://groups.google.com/d/msgid/influxdb/1bd78194-4973-4bb0-9078-dd64f2e3244e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.