influxdata / influxdata/influxdb

Add the ability to use math functions in Check Templates

Open
#17,229 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement monitoring-and-alerting team/ui
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

I would like to create a check template that looks like this in the UI:
`Cert for ${ r.source } will expire in ${string(v:math.round(x: float(v:r.expiry)/60.0/60.0/24.0))} days.`

but the error i get is that `math` is not defined. That's because i need to import it.

We should be smart enough to automatically add the import for math in this case. string and date would also be useful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies check-template expressions in the UI and the missing math import, with string and date suggested as follow-ons. Start by locating the check-template expression parser or import handling and its tests; done means supported math functions no longer fail as undefined and coverage verifies the example expression.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.