influxdata / influxdata/ui

NotificationRules: history view filter examples are out of date

Open
#2,685 0 comments 0 reactions 0 assignees View on GitHub
bonitoo kind/bug team/automation team/ui team/unity
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

**Steps to reproduce:**
List the minimal actions needed to reproduce the behavior.

In Alerts

1. Create a check
2. Create a valid notification endpoint
3. Create a notification rule
4. wait for a couple of checks and a couple of notifications to be triggered
5. Open Notification Rules > My Rule > View History. A list of notifications is loaded and the expression in the filter is e.g. '"notificationRuleID" == "082f2809ec3ee000"'
6. Click the "statuses" button. Note the expression in the filter is unchanged. The list is empty.
7. Click on the filter to change the expression. A dropdown of "Example" expressions appears.

**Expected behavior:**
Expected that by using the example expressions as a base, that a filter expression would return a result set. e.g. '"check" == "my check"' becomes '"check" == "Simple Deadman"'.

**Actual behavior:**
Using the suggested example failed even though the "Simple Deadman check' exists, is active and is throwing statuses matching the rule.

Looking at the query sent in the networking section of browser tools shows.

```javascript
from(bucket: "_monitoring")
|> range(start: -1d, stop: 1632235151)
|> filter(fn: (r) => r._measurement == "statuses" and r._field == "_message")
|> filter(fn: (r) => exists r._check_id and exists r._value and exists r._check_name and exists r._level)
|> keep(columns: ["_time", "_value", "_check_id", "_check_name", "_level"])
|> rename(columns: {"_time": "time",
"_value": "message",
"_check_id": "checkID",
"_check_name": "checkName",
"_level": "level"})
|> group()
|> filter(fn: (r) => r["notificationRuleID"] == "082e061d646e4000")
|> sort(columns: ["time"], desc: true)
|> limit(n: 100, offset: 0)
```
So the example expression '"check" == "my check"' should be '"checkName" == "my check"'

**Environment info:**

- System info: Run `uname -srm` and copy the output here
- Linux 5.11.0-34-generic x86_64
- InfluxDB version: Run `influxd version` and copy the output here
- Other relevant environment details: Container runtime, disk info, etc
- Detected against k8sidpe using recent commit of the ui project.
- c198678832a524b8f6e2e7ba7884fde894b12ce3
- Tue Sep 21 16:43:19 2021 -0400

**Screenshots**
_monitoring_
![ExampleValuesMonitoring](https://user-images.githubusercontent.com/25881301/134315119-48b78d56-a76a-413c-9be8-bcf4a4ebdf01.png)

_statuses_
![ExampleValuesStauses](https://user-images.githubusercontent.com/25881301/134315122-b593614b-d7a9-4655-8ac7-ff2f38460dca.png)

**Config:**
Copy any non-default config values here or attach the full config as a gist or file.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.