influxdata / ui

UI for InfluxDB
92 stars 42 forks source link

Notebook(Alerts): have dataset schema, be correctly utilized in the alert thresholds. #4080

Open wiedld opened 2 years ago

wiedld commented 2 years ago

About the bug

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

  1. Use the query builder, or raw flux editor, to generate a query using fields.
    • Screen Shot 2022-03-11 at 12 00 51 PM
  2. Run notebook --> see that the output graph contains data.
  3. Build an alert using the fields.
    • Screen Shot 2022-03-11 at 12 00 58 PM
  4. create a threshold using non-numeric data: trigger = (r) => r["co"] > 20 and (r["water_level"] > 0 and r["water_level"] < 100) and r["types"] == "earthquake"
  5. Run task get an error --> because used a string field (not a numeric measurement).

.

Expected behavior: I should not be able to create threshold alerts, based on my dataset, which fail when I run the alert task.

.

Proposed solutions:

Either we can: A. decide to only allow numeric fields to be used in the notebook alerts B. permit string and numeric fields in threshold checks

Option A: only allow numeric fields

implementation details:

Option B: permit multiple field types?

implementation details:

wiedld commented 2 years ago

Assigned this to myself for now. Since this issue is intertwined with another issue I am currently working upon. So not sure yet if (or how much) of this will be resolved as I am in progress of fixing the other ticket.

wiedld commented 2 years ago

we decided to not pull out the monitor.check() yet, for reasons here: https://github.com/influxdata/ui/issues/4081#issuecomment-1074584517

But we are utilizing more schema awareness in the notebooks alerts. As in this PR: https://github.com/influxdata/ui/pull/4067

is not perfect. But is a patch until a broader product decision (updates) are made.

wiedld commented 2 years ago

Could not reach team consensus on resolution. Then we decided to not do more fixes to notebooks.