One way would be to add a window node after the derivative to buffer the 
data. Something like 

// Use this segment to replace the whole deadman section, this is 
equivalent but will process batches of 5m at a time. 
  |stats(10s)
            .align()
        |derivative('emitted')
            .unit(10s)
            .nonNegative()
        |window()
            .period(5m)
            .every(5m)
        |alert()        .stateChangesOnly(stateChangesOnly)
        .durationField(durationField)
        .levelTag(levelTag)
        .messageField('message')
        .message(message)
        .log(log)
        .email(email)
        .to(to)
            .crit(lambda: "emitted" <= 100.0)


This still may not do exactly what you want since it will only lag the data 
at the beginning of the window by 5m and the data at the end of the window 
will only lag by a few seconds.

If you would like you could submit a feature request on github for a `lag` 
node that would lag the data by a specified amount.


On Wednesday, February 15, 2017 at 6:47:25 AM UTC-7, ambro...@gmail.com 
wrote:
>
> Hello,
>
> i have a problem with Deadman tool of  kapacitor.
>
> To import data into influxdb i use "influx -import -path=filename 
> -precision=ns" every minute. But the duration of the import is 5 minutes 
> (big file). So i have 5 minutes of a dead zone (in the worst case) for the 
> deadman tool and he throws an alert because i have set threshold Deadman 
> tool to alert at 0.0 on a period of one minute for each host and name 
> (group by host,name).
>
> It is possible to shift listen's tool Deadman  less than 5 minutes from 
> real time ?
>
>
> Probes,host=host1,name=name1 status=1
>
> ------ My tick -----
>
> var db = 'telegraf'
>
> var rp = 'autogen'
>
> var measurement = 'probe'
>
> var messageField = 'message'
>
> var message = 'Probe "{{ index .Tags "name" }}" on the server "{{ index 
> .Tags "host" }}" is {{.Level}} '
>
> var groupBy = ['host', 'name']
>
> var outputDB = 'kapacitor'
>
> var outputRP = 'autogen'
>
> var stateChangesOnly = 10m
>
> var durationField = 'duration'
>
> var levelTag = 'level'
>
> var outputMeasurement = 'alerts_probe_deadman'
>
> var threshold = 0.0
>
> var period = 1m
>
> var email = 'kapaci...@dns.en'
>
> var to = 'myem...@dns.en'
>
> var log = '/tmp/alerts.log'
>
> var data = stream
>     |from()
>         .database(db)
>         .retentionPolicy(rp)
>         .measurement(measurement)
>         .groupBy(groupBy)
>     |shift(3m)
>
> var trigger = data
>     |deadman(threshold,period)
>         .stateChangesOnly(stateChangesOnly)
>         .durationField(durationField)
>         .levelTag(levelTag)
>         .messageField('message')
>         .message(message)
>         .log(log)
>         .email(email)
>         .to(to)
> trigger
>     |influxDBOut()
>         .create()
>         .database(outputDB)
>         .retentionPolicy(outputRP)
>         .measurement(outputMeasurement)
>
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
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/f38e862e-01cc-4ed8-bc11-fef03531686d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to