Commit graph

23 commits

Author SHA1 Message Date
Nick Satterly
2a6632b78f Fix multiple linting errors 2023-03-21 00:15:34 +01:00
Nick Satterly
bc0de15765 Update READMEs 2020-11-20 22:39:32 +01:00
Nick Satterly
222c4ae224
Use UTC now() as influxdb timestamp () 2018-09-11 17:31:02 +02:00
Nick Satterly
d0e510ca50 Bump influxdb to 5.4.2 2018-03-21 09:54:07 +00:00
Nick Satterly
d1fbf679b5
Bump influxdb plugin to use version 5.0.0 () 2018-03-21 09:53:38 +00:00
Nick Satterly
6c15db4c51 Update plugins for Release 5.0 2017-09-17 16:22:46 +01:00
Matteo Cerutti
34554c3d17 * add alert tags to influxdb point
* send alert status changes to influx
2017-09-12 10:52:34 +01:00
Nick Satterly
4128e87474 Write alerts to single Influxdb 'event' measurement series only
See "Don't have too many series" for more info...
https://docs.influxdata.com/influxdb/v1.2/concepts/schema_and_data_layout/#don-t-have-too-many-series
2017-05-19 22:26:42 +01:00
Nick Satterly
d5e183bb9b Merge pull request from thehilll/influxdb-single-measurement
Allow InfluxDB plugin to use a single measurement
2017-05-19 22:01:58 +01:00
thehill
8343d80c64 Provide an option to output to a single InfluxDB measurement rather than one per event
The default behavior is to create one measurement per alert.event in InfluxDB.  Several processes are easier if all Alerta data is available in a single measurement with a tag that indicates alert.event.

This introduces two new config variables:

INFLUXDB_SEPARATE_MEASUREMENT defaults to True and triggers the default (separate measurement per event) behavior.

INFLUXDB_SINGLE_MEASUREMENT defaults to False and triggers the new behavior of one measurement for all events.  If set it should be set to the name of the measurement you want to use (e.g. not True but rather "alert_measurement").

Both settings can be either True or False (i.e. it isn't one or the other behavior...you can have both).  The InfluxDB points now start as an empty list (line 46).  If either of the above config variables are True a point is added to the list in the format appropriate for that setting.  In the case of INFLUXDB_SEPARATE_MEASUREMENT (default behavior) this is unchanged.  In the case of INFLUXDB_SINGLE_MEASUREMENT (new behavior) this point uses the value set in INFLUXDB_SINGLE_MEASUREMENT as a measurement name and adds a new tag called "event" which is populated with the alert.event value.

I've made one other change to each point type which is to coerce the value field (alert.value in both cases) to a string.  The issue we ran into is that InfluxDB defines a field's type based on the first point.  If the first point is a string the old code worked fine (numbers were treated as strings), but if the first point was numeric InfluxDB would drop subsequent points that included string values.  Since Alerta allows string values (and has to it would seem) I've forced this field to be a string in InfluxDB.

Finally within the final try block to write points to InfluxDB I changed this to only do so if the points list is not empty.  This handles the case where both configuration variables are false and nothing is written.
2017-05-19 09:28:25 -04:00
Nick Satterly
1849db2ad0 Make everything MIT license 2017-05-10 10:09:13 +01:00
Nick Satterly
3ddbc3c35b Bump version of influxdb plugin to 0.3.3 2017-05-02 15:33:05 +01:00
thehill
311c772c86 record alert severity in influxdb as a tag 2017-04-28 09:31:32 -04:00
Nick Satterly
9844809c59 Update InfluxDB to v1.1 API and README 2016-12-04 16:49:12 +00:00
Nick Satterly
53fc1b2360 Set useful logger name for plugins 2016-09-15 10:18:03 +01:00
Nick Satterly
b2b53352a1 Standardise setup.py for all plugins 2016-09-14 14:23:41 +01:00
Nick Satterly
4c7744e435 Fix alerta plugin package namespace clashes 2016-09-14 11:57:44 +01:00
Nick Satterly
eb14d874fd Make plugins setup.py consistent 2016-09-05 17:11:37 +01:00
Nick Satterly
aa892047db Bump plugin versions 2016-03-07 23:02:06 +10:00
Nick Satterly
792899fecf Add prometheus plugin and update other plugins 2016-03-07 22:25:58 +10:00
Nick Satterly
e3edc875f6 Use env vars or server config for plugin settings 2015-12-16 09:59:38 +00:00
Nick Satterly
5ff192858d update influxdb pre_receive hook 2014-12-16 22:24:19 +00:00
Nick Satterly
48a925ee7e minor fixes to influxdb plugin 2014-10-03 13:35:18 +01:00