influxdata / influxdata/influxdb
Add the ability to use math functions in Check Templates
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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