NotificationRules: history view filter examples are out of date
- 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_

_statuses_

**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.