Commit Graph

44 Commits (8d9e3550bded01bf29892b4ac2cc75f0c92a178d)

Author SHA1 Message Date
Michael Desa be636f983d fix(notification/rule): import experimental package for pagerduty rule
🤦
2020-02-21 09:13:36 -08:00
Michael Desa c0bccf53dd fix(notification/rule): add alert level filtering to pagerduty rule
An accidental omission of status a level check resulted in all statuses
triggering notifications for pagerduty rules. This was not caught due
to insufficient testing of the pagerduty rule.
2020-02-20 13:37:03 -08:00
Johnny Steenbergen 77dd06bc5e fix: enable skipped tests for notification rules and fixup issue in tag matcher 2020-01-02 07:16:03 -08:00
Deniz Kusefoglu 219d73bf60
fix(notificationrules): Correct logic on matching notification rules (#16328)
* fix(notificationrules): Correct logic on matching notification rules

* feat(nrs): Add more tests
2019-12-31 23:44:27 +00:00
Johnny Steenbergen 61dceaa727 feat(pkger): add application functionality for the notification rules resource 2019-12-20 12:48:46 -08:00
Johnny Steenbergen 86a359f34b chore(http): refactor http layer to be able to encode/decode influxdb.ID's safely
noticed that I had not used the http server as the entry point for server tests.
This was work to make that happen. Along the way, found a bunch of issues I hadn't
seen before 🤦. There are a number of changes tucked away inside the
other types, that make it possible to encode/decode a type with zero value for
influxdb.ID.
2019-12-13 09:46:01 -08:00
Kelvin Wang 2837d4ec08 fix(predicate): add string parser 2019-10-18 12:02:53 -04:00
Kelvin Wang 62f4042853 feat(influxdb): add predicate package 2019-10-18 12:02:52 -04:00
Michael Desa 58fbddc123
fix(notification/rule): ensure stateChanges rule has enough data in window
Closes https://github.com/influxdata/influxdb/issues/15154

Previously, we niavely incremented the unit associated with the leading
duration. Now, if the unit is `s` we double it. For every other unit, we
increase the magnitude by 1.

fix(notification/rule): change panic to t.Fatal

chore(notification/rule): add support for durations less than s
2019-09-24 12:48:10 -04:00
kelwang c3127c8cdd
Merge pull request #15179 from bednar/check-cron
fix(alerts): remove the cron option from checks/rules
2019-09-23 21:28:02 -04:00
Brandon Farmer d83fabeabc feat(influxdb): user disabling 2019-09-23 11:57:16 -07:00
Jakub Bednar 265bc7bf2a fix(alerts): remove the cron option from checks/rules 2019-09-23 10:20:22 +02:00
Michael Desa a1979ef615
fix(notification/rule): alert on all statuses if for any status rule
This PR special cases `any` level rules so that they will alert on all
conditions.
2019-09-11 15:19:00 -04:00
Michael Desa ea1b7bec09
fix(pagerduty/rule): change url to clientURL for pagerduty endpoint/rule
Closes https://github.com/influxdata/influxdb/issues/15042

Previously, there was an optional URL provided for the pagerduty
endpoint. However, the pagerduty API url does not change and as a result
it should not have been a parameter. The Pagerduty API does require a
`clientURL` that is presented in the pagerduty UI when an alert is
triggered. Currently that value will default to the alerts history page
for the organization.
2019-09-09 19:09:35 -04:00
Chris Goller 5848056ea7 fix(notification/rule): pagerduty does not need token and url
Previously, the URL would cause pages to be sent to incorrect addresses.
Token is only needed for PagerDuty REST API and not events.
2019-09-06 23:07:37 -05:00
Chris Goller bf1e198714 fix(notification/rule): pagerduty helper functions need key args
The pagerduty helper functions did not have the correct syntax.
2019-09-06 21:27:09 -05:00
Chris Goller 9dcdbd05a1 fix(notification/rule): convert time, trigger, severity
Semantically, we've done the following:

// name of the client sending the alert.
client: "influxdata"

// url of the client sending the alert.
client_url: the endpoint URL for now (needs to change to rule)

// The class/type of the event, for example ping failure or cpu load
class: check's name

// Logical grouping of components of a service, for example app-stack
group: source measurement

Co-authored-by: Alirie Gray <alirie.gray@gmail.com>
2019-09-06 18:34:42 -05:00
Chris Goller dbcdc8dc59
feat(notification/rule): add _version: 1 to HTTP body (#15028)
This adds the _version: 1 correctly to the body of the HTTP POST.

Additionally, this fixes the imports when using secrets.

The POSTed JSON body now is:

```json
{
  "_check_id": "046cac59e2aa3000",
  "_check_name": "High CPU User Usage",
  "_level": "crit",
  "_measurement": "notifications",
  "_message": "High CPU User Usage: rsavage.prod is crit",
  "_notification_endpoint_id": "046cad0c83aec000",
  "_notification_endpoint_name": "HTTP Endpoint",
  "_notification_rule_id": "046dff53d4183000",
  "_notification_rule_name": "HTTP Notification",
  "_source_measurement": "cpu",
  "_source_timestamp": 1567797375000000000,
  "_start": "2019-09-06T19:15:59Z",
  "_status_timestamp": 1567797376416632300,
  "_stop": "2019-09-06T19:16:20.362006739Z",
  "_time": "2019-09-06T19:16:20.609629338Z",
  "_type": "threshold",
  "_version": 1,
  "cpu": "cpu-total",
  "host": "rsavage.prod",
  "usage_user": 91.12278069517379
}
```
2019-09-06 16:21:27 -05:00
kelwang c88284840b
Merge pull request #14962 from influxdata/fix_offset_must_be_smaller
fix(notification): offset must be smaller than every
2019-09-06 16:20:49 -04:00
Chris Goller 8367d8d252
feat(notification/rule): add JSON body for the HTTP POST (#14994)
The body of the JSON webhook would be:
{
        "version": 1,
        "rule_name": notification._notification_rule_name,
        "rule_id": notification._notification_rule_id,
        "endpoint_name": notification._notification_endpoint_name,
        "endpoint_id": notification._notification_endpoint_id,
        "check_name": r._check_name,
        "check_id": r._check_id,
        "check_type": r._type,
        "source_measurement": r._source_measurement,
        "source_timestamp": r._source_timestamp,
        "level": r._level,
        "message": r._message,
}
2019-09-05 20:38:02 -05:00
Chris Goller da359f2ce2
feat(notification/rule): add auth and content-type headers for… (#14986)
The basic auth headers use a function that will soon be in flux that
renders usernames and passwords into `Basic <b64 u and p>`

This work assumes that AuthMethod has been set as well as the
appropriate secrets
2019-09-05 17:32:28 -05:00
Michael Desa 79a6b353e3
fix(notification/rule): conditionally include url and token for slack rule
Previously, we expected that both token and url would be provided, but
we've become aware that the user may provide either or both of them.
2019-09-05 18:00:45 -04:00
Alirie Gray e7e5b60cbb test(alerts): update time in pagerduty test 2019-09-05 14:31:15 -07:00
Chris Goller a5395e323f feat(pagerduty): update pagerduty generation schema
We chose pretty arbitrary data from monitor to add to the pagerduty
schema.

We'll need to see how this renders and make adjustments.

Co-authored-by: Alirie Gray <alirie.gray@gmail.com>
2019-09-05 14:16:01 -07:00
Michael Desa af89f38d04 feat(notification/rule): add pagerduty notification rule 2019-09-05 14:16:01 -07:00
Kelvin Wang d1dd460a92 fix(notification): offset must be smaller than every 2019-09-05 11:20:59 -04:00
Michael Desa 38f1598602
fix(notification/rule): filter statuses by current level if no previous 2019-09-05 10:30:11 -04:00
Michael Desa d96d21c5e1
fix(notification/rule): remove fieldsAsCols pivot from rules 2019-09-05 09:52:05 -04:00
Michael Desa 119f901264
fix(notification/rule): use every from rule in task options in flux 2019-09-04 20:38:31 -04:00
Michael Desa 5ff6f8b9ca
fix(notification/rule): pivot table from monitor 2019-09-04 20:38:31 -04:00
Michael Desa 07e7309c48
fix(notification/rule): add colors to slack notifications 2019-09-04 20:38:31 -04:00
Michael Desa 8251922b63
fix(notification/rule): filter for state changes in rules
fix(notification/rule): add overlap to windows so that state changes works

Since stateChanges cannot detect a state change for the initial point,
returned, we generate a task that queries for more data than required
and filters out records that are before the every. This way we will not
miss state changes that take place on the initial value.

fix(notification/rule): prevent union of tables for single status rule

fix(testing): add status rules to notifications
2019-09-03 16:58:50 -04:00
Michael Desa bf28f6e771
Merge pull request #14863 from influxdata/fix/http-rules
fix(notification/rule): remove name from notify call
2019-08-30 09:59:59 -04:00
Deniz Kusefoglu 9450149561
Add Any to rule levels (#14866)
* WIP

* Fix UI linter errors from swagger changes to Level Rule

* Prevent same level selection on changes from

* Remove unused get

* Fix prettier error

* chore(notification/rule): change level rule to check level for rules
2019-08-29 17:46:00 -07:00
Michael Desa f42ef324a8
fix(notification/rule): remove name from notify call 2019-08-28 20:24:20 -04:00
Jade McGough cd2e29cbcb
feat(swagger): notification rule tag filtering (#14793)
feat(swagger): notification rule tag filtering
2019-08-28 09:25:54 -07:00
Michael Desa b26ed76d6a
fix(notification/check): ensure cloud integration works
fix(notification/check): include tags in check object in generated flux

Closes https://github.com/influxdata/influxdb/issues/14769

fix(notification/check): use selected field in threshold functions

Closes https://github.com/influxdata/influxdb/issues/14776

fix(testing): add selected field for check tests

fix(check): use real flux for threshold check

feat(notification/check): generate flux for deadman checks

chore(endpoint): rename webhook endpoint to http endpoint

fix(notification/rule): fetch url for flux script off of endpoint

fix(notification/rule): clean up slack and http rules

fix(notification/rule): change MessageTemp to MessageTemplate

fix(rules): pass endpoint in to rule during create

fix(ui): rename webhook to http

feat(notification/check): namespace deadman under alerts

fix(notification/check): nest tags under tags key in data object in flux

wip

feat(kv): log error if urm cannot be deleted for notification rule

fix(notification/rule): remove name from notify call in slack rule

chore(ui/cypress/e2e): skip rule create test
2019-08-27 15:02:53 -04:00
Jonathan A. Sternberg c7bbfbe293 refactor(notification): rename alerts package to monitor in flux (#14788) 2019-08-26 16:46:17 -06:00
Michael Desa bef3de49fa
fix(notification/rule): remove println and add json struct tag for http 2019-08-19 11:57:59 -04:00
Michael Desa 38319dae4f
feat(notification/rule/http): generate correct flux for http
notification rule
2019-08-19 07:31:46 -04:00
Michael Desa 8e56c36737
feat(notification_rule): create notification rule task
feat(notification_rule): generate base flux for notification rule

wip: saving state

fix(notification/endpoint): add comment about weird requirements

feat(notification_rule): create notification rule task
2019-08-16 15:43:15 -04:00
Kelvin Wang f3dcdee504 fix(notification/rule): remove authID requirement 2019-08-15 19:31:45 -04:00
zhulongcheng ce4d5a9852 feat(http): patch notification rule 2019-07-28 22:08:23 +08:00
Kelvin Wang c4c6a32225 feat(notification): add notification structs 2019-07-25 15:15:35 -04:00