Commit Graph

69 Commits (d53d3686b62d27cfbd5fcecdd3b4c71ccb83373d)

Author SHA1 Message Date
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
kelwang 3f168b109d
Merge pull request #15117 from influxdata/clientURL_optional
fix(notification/endpoint): pagerduty clientURL should be optional
2019-10-15 13:11:50 -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
kelwang 63c5311494
Merge pull request #15111 from bednar/notification-endpoint
docs(http): update NotificationEndpoint swagger definition to reflect reality
2019-09-12 11:09:17 -04:00
Kelvin Wang aed8035472 fix(notification/endpoint): pagerduty clientURL should be optional 2019-09-11 15:26:50 -04: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
Jakub Bednar a8ad9e2615 docs(http): update NotificationEndpoint swagger definition to reflect reality 2019-09-11 11:53:44 +02:00
Michael Desa a23962fef8
Merge pull request #15079 from influxdata/fix/pagerduty-client-url
fix(pagerduty/rule): change url to clientURL for pagerduty endpoint/rule
2019-09-09 19:27:29 -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
Kelvin Wang 0ec2db0785 fix(notification/endpoint): http bearer token 2019-09-09 16:20:23 -04:00
Kelvin Wang 99ec1c45af fix(notification/check): range outside logic 2019-09-09 15:11:08 -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
Kelvin Wang d08122124f feat(notification/endpoint): add headers to http endpoint 2019-09-06 12:38:42 -04:00
Michael Desa 354746cb1b
fix(notification/check): pivot table before sending to deadman call
Discovered that the deadman table needs to be pivoted before the data
can be passed to deadman.
2019-09-06 11:40:17 -04:00
Michael Desa 2ae2b06c57
fix(notification/check): remove the aggregateWindow from the deadman query
If the user specifies an aggregate window in the query they provide us,
we remove it so that we can property detect the deadman. This is not the
solution we will want long term, but should be sufficient for now.
2019-09-06 10:03:33 -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 b933e007cb fix(notification/endpoint): remove slack token requirement 2019-09-05 16:48:34 -04:00
Kelvin Wang d34f3b96b5 fix(notification): fix the any checkLevel string 2019-09-05 15:11:43 -04: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 bc77f94024
fix(notification/check): rename _check_type to _type in check object in flux
Previously we passed a property called _check_type instead of just passing a property called _type.
2019-08-30 10:54:16 -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 0da82319a8
feat(notification/check/threshold): add createEmpty false to aggregateWindow 2019-08-29 18:36:18 -04: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 02bda26866
feat(deadman): add staleTime duration to deadman check
fix(deadman): change timeSince to a duration string instead of int
2019-08-28 10:16:38 -04: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 c433f50cec
chore(alerts_notifications): add misc changes to alerts ui for demo
Create view with checkID in NewVEO

fix ruleToDraftRule bug

Fix no thresholds error

Get correct view status for rendering cell

Fix editVEO flow

Add notification endpoint ID to initRule

Remove task type from check and notification rule

mock generate AST

use check query in EditCheckEO

wip

Create default http notification endpoint

Co-authored-by: Michael Desa <mjdesa@gmail.com>

Dont save view if no dashboardID in saveCheck

Execute queries in editCheckEO

Fix check remove bug

Disable Advanced view and multiple queries in check builder

Disable alerting button if draftQuery is not alertable

chore(kv/check): remove createCheckTask from KV as the result of #14728
2019-08-21 17:28:49 -04:00
kelwang 06a76374ca
Merge pull request #14705 from influxdata/fix_routing_key
fix(notification/pagerduty): routingKey encode
2019-08-19 14:06:26 -04:00
Michael Desa 86cca67de1
Merge pull request #14703 from influxdata/fix/check-generated-flux
fix(notification/check): assign flux pipeline to data and replace durations with every
2019-08-19 13:14:03 -04:00