kapacitor icon indicating copy to clipboard operation
kapacitor copied to clipboard

Alerts when kapacitor is restarted

Open thiagocorredor opened this issue 4 years ago • 6 comments

Good morning all,

We are facing an issue on kapacitor, related with alerts:

Everytime that the kapacitor service is restarted, we are receiving several INFO, WARNING and CRITICAL alerts.

But these alerts are not necessary, because the previous status were not changed.

Do you know the reason of this?

thiagocorredor avatar May 12 '20 13:05 thiagocorredor

Can you provide example: tickscript

reactcker avatar May 13 '20 13:05 reactcker

Hi,

This is occurring with all tick scripts.

One example:

var client = 'Client Name'

var measurement = 'lwsn_web_transaction'

stream |from() .measurement(measurement) .groupBy('hostname') |window() .period(1s) .every(0s) |last('inquire_time_taken_status') .as('inquire_time_taken_status') |stateCount(lambda: "inquire_time_taken_status" == 0) .as('status_service_down') |stateCount(lambda: "inquire_time_taken_status" == 1) .as('status_service_up') |eval(lambda: if("inquire_time_taken_status" == 0, 'DOWN', 'UP')) .as('status_service') .keep('inquire_time_taken_status', 'status_service', 'status_service_down', 'status_service_up') |alert() .id('{{ .Name }}') .message('Alert - {{ index .Tags "hostname" }} - Portal Status alert is in a {{ .Level }} state.') .details( '''

Hello!
If you have some question about the alert(s) below, or if you need some assistance as well, please open a ticket

 

Client Name: ''' + client + '''
Hostname: {{ index .Tags "hostname" }}
Level: {{ .Level }}
When: {{ .Time }}
Service Status: {{ index .Fields "status_service" }}
Details: {{ index .Tags "inquire_time_taken_error_message" }}
''' ) .info(lambda: "status_service_up" >= 3) .crit(lambda: "status_service_down" >= 3) .stateChangesOnly() .noRecoveries() .topic(measurement) .levelField('level') .IdTag('idtag') .MessageField('message') .email('tsilva@xxxxxx.com') |influxDBOut() .create() .database('xxx') .retentionPolicy('default') .measurement('events') .tag('kapacitor', measurement) .tag('client_name', client)

------ Original Message ------ From: "reactcker" <[email protected]mailto:[email protected]> To: "influxdata/kapacitor" <[email protected]mailto:[email protected]> Cc: "thiagocorredor" <[email protected]mailto:[email protected]>; "Author" <[email protected]mailto:[email protected]> Sent: 13-May-20 10:07:44 AM Subject: Re: [influxdata/kapacitor] Alerts when kapacitor is restarted (#2336)

Can you provide example: tickscript

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/influxdata/kapacitor/issues/2336#issuecomment-627971528, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA77FZCH73NI662VF75JXP3RRKLSBANCNFSM4M62JWDQ.

thiagocorredor avatar May 13 '20 13:05 thiagocorredor

Also, is there a reason to kapacitor service restart automatically every night?

thiagocorredor avatar May 13 '20 13:05 thiagocorredor

Sorry for the lateness in reply. Hmm it is not odd that kapacitor triggers several INFO, WARNING and CRITICAL alerts every time it meets the condition. Odd is kapacitor getting restart every nigh. Did you look for memory issues might be causing kapacitor to restart?

reactcker avatar May 18 '20 08:05 reactcker

Good morning,

I will check about memory issues.

But my question is: Is there a way to avoid kapacitor sending alerts everytime it is restarted?

I mean, a way to save/keep the status of every task, so even restarting kapacitor, it only send alerts if the status change in the future?

Thanks

------ Original Message ------ From: "reactcker" <[email protected]mailto:[email protected]> To: "influxdata/kapacitor" <[email protected]mailto:[email protected]> Cc: "thiagocorredor" <[email protected]mailto:[email protected]>; "Author" <[email protected]mailto:[email protected]> Sent: 18-May-20 5:28:05 AM Subject: Re: [influxdata/kapacitor] Alerts when kapacitor is restarted (#2336)

Sorry for the lateness in reply. Hmm it is not odd that kapacitor triggers several INFO, WARNING and CRITICAL alerts every time it meets the condition. Odd is why it is getting restarted, did you look for memory issues might be causing kapacitor to restart?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/influxdata/kapacitor/issues/2336#issuecomment-630027923, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA77FZD4YKSSZL655TVMZW3RSDWRLANCNFSM4M62JWDQ.

thiagocorredor avatar May 18 '20 13:05 thiagocorredor

Actually, this is the real issue:

https://github.com/influxdata/kapacitor/issues/2668

thiagocorredor avatar Dec 22 '21 21:12 thiagocorredor