Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more options for alerts output #93

Closed
schmurfy opened this issue Dec 15, 2015 · 5 comments
Closed

more options for alerts output #93

schmurfy opened this issue Dec 15, 2015 · 5 comments
Milestone

Comments

@schmurfy
Copy link

it would be nice to be able to store them in influxdb to keep an history and it would also be nice to be able to retrieve at a given time a list of active alerts to display them in a frontend or somewhere else.

I am not sure how they are currently stored but it seems rather volatile to me, I want to be able to say in two months: this alert on this hosts was triggered 4 times and here is when and at which value.

Here is an idea of what it might looks taken from the mailing list

var alert = .alert()
                        ... // define levels etc
alert
   .influxDBOut() // send alert data to InfluxDB
      .database('alerts') ....
alert
   .httpOut('alert_events') // create local cache of alert data
@miili
Copy link

miili commented Dec 20, 2015

An implementation of alarm().influxDBOut() eventhandler could look like this:

stream...
    .alert()
        .influxDBOut()
             .database('events')
             .retentionpolicy('default')
             .measurement('alarms') // alarm series
             # Alarm published as values/tags in dedicated alarm series
             .id()      // value from AlertNode
             .tags()    // tags from StreamNode
             .level()   // tag from AlertNode (info/warning/critical)
             .message() // value from AlertNode
             .time()

@barryheap
Copy link

+1

@schmurfy
Copy link
Author

I started this and still want it but I don't know enough about kapacitor internals or latest influxdb (I use it daily but an old version) to really help move it forward, if someone has a clear idea on how this would look especially on the influxdb side since @miili already gave a first idea on the kapacitor side it would be great.

Here is some ideas of how I would like to query the stored alerts on influxdb:

  • how many alerts got triggered but this particular application on a given period
  • what are the alerts currently active
  • what is the mean/median/min/max resolution time for a specific alert type

@nathanielc
Copy link
Contributor

nathanielc commented Apr 14, 2016

@schmurfy

#465 now allows for storage of alert data in InfluxDB

how many alerts got triggered by this particular application on a given period

Something like this will now work: select count(level) from alerts where level != 'OK' and time > now() - 5m group by app

what are the alerts currently active

Similarly select last(level) from alerts where group by app

what is the mean/median/min/max resolution time for a specific alert type

This one is a bit harder since calculating the amount of time between points is not possible. But is a requested feature #384

@schmurfy
Copy link
Author

great, thanks !

nathanielc added a commit that referenced this issue Jun 9, 2016
…47a777

bbd5bb6 Make struct decoding also handle empty Primitives
66416ff Decode empty Primitives into nullable values successfully
5b80cc5 Clean up slice decoding handling
75869ce Unify two switch arms
1946733 Properly encode struct fields having toml tags without a name
0e5f512 Don't treat non-empty strings of whitespace as empty for omitempty
e27e134 add bool empty option
a4eecd4 Remove extra lexer advance
0c4ce10 In Decode, reuse slices when possible
dacf173 Merge remote-tracking branch 'yourkarma/master'
166915e Merge pull request #82 from mjibson/fix-decode-omit
3e3bd42 Don't panic when failing to parse a timestamp
001f7af Fix no-op utf-8 validity test
2678c1e Add tests for ignored fields
2fe0945 Flesh out anonymous field encoding
4cc516a Merge remote-tracking branch 'shawnps/gofmt'
f772cd8 Merge pull request #112 from stapelberg/inaccessible-go1.6
77ccfcd Bugfix: update check for inaccessible fields for Go 1.6
312db06 Merge pull request #93 from bep/parse-panic
782628a gofmt -s
5c4df71 Merge pull request #108 from kezhuw/fix_endless_loop
c3bcd45 Fix endless loop in table name lexing
851e5be Panic instead of os.Exit for illegal state situations in parser
110f954 Make new destination slice when length doesn't match.
54c24c1 Use correct name during decode with omit options
056c9bc Merge pull request #81 from bbuck/omitempty
aa708eb Clean up, remove zero as 'empty' and add 'omitzero' option
d918309 Support for omitempty, as well as tests for omitempty.
443a628 Merge pull request #72 from binary132/fix-readme
9baf8a8 Updated link for TOML v0.2.0
f706d00 Support quoted keys.
7eda3e2 Remove escape for '/'.
0f9db13 Forbid '#' in table names.
a6db6cf Simplify lexer for Unicode escapes and add support for `\U`.
3644d30 Fix typo. Thanks @ChrisHines
32ee81d Various formatting fixes. 80 cols.
0eaa740 Fix #66.
3883ac1 Merge pull request #59 from fromonesrc/patch-1
237e946 Merge pull request #57 from gisakulabs/UnmarshalTOML
b2c5eb4 Merge pull request #61 from halostatue/multiline
1956abe Implement multiline strings and raw multiline strings.
73199af Support single-line raw strings.
71fac5b Fixed comment typo
ac8879e Fix readme typo on Decode method
67ade19 Modified the `Unmarshaler` interface to `.UnmarshalTOML(v interface{})`
bc95534 Added support for UnmarshalTOML() interface.

git-subtree-dir: vendor/github.com/BurntSushi/toml
git-subtree-split: 747a77770ca4730759d5944e3a7fe869d452648b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants