Commit Graph

22 Commits

Author SHA1 Message Date
George Robinson
bd87b46b15
Alerting: Improve test coverage for ConditionsCmd (#58603) 2022-11-11 09:27:35 +00:00
George Robinson
acfa066ba2
Alerting: Change TestConditionsCmd to assert on mathexp.Results (#58434) 2022-11-09 16:07:43 +00:00
Yuriy Tseretyan
245c1ee3d3
Chore: Add last downsampling function to Resample expression (#57379) 2022-10-21 10:03:43 -04:00
Yuriy Tseretyan
2d38664fe6
Alerting: Improve validation of query and expressions on rule submit (#53258)
* Improve error messages of server-side expression 
* move validation of alert queries and a condition to eval package
2022-09-21 15:14:11 -04:00
Kyle Brandt
05fd7eb047
SSE: Add noData type (#51973)
When there is a single frame with no fields (e.g. splunk datasource) SSE errors when trying to figure out the data type. This frame needs to exist since this is where the executedQueryString metadata exists.

This adds a new return type to SSE to represent no data, so the original frame with its metadata can still be maintained.
2022-07-14 09:18:12 -04:00
Kyle Brandt
01ef899753
SSE/Alerting: Support prom instant vector responses (#44865)
* SSE/Alerting: (Draft) Support prom instant vector responses
fixes #35663
* reduce\classic expressions to handle mathexp.Number
* use Notice for warning

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2022-05-23 10:08:14 -04:00
Kyle Brandt
040ce40113
SSE: Mode to drop NaN/Inf/Null in Reduction operations (#43583)
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
2022-02-02 14:50:44 +01:00
Marius Bezuidenhout
9fc0aee02b
Feature/mathandreduce (#41608)
* Added new math functions: round, ceil, floor 
* Added a new reduce function: last.
2022-01-21 13:15:50 -05:00
Kyle Brandt
f17fb76b5e
SSE: Add is_nan() and other like functions and allow '_' in func names (#43555)
* SSE: Add is_nan() and allow '_' in func names

is_null() infn(), is_inf(), is_number()
2021-12-29 11:40:52 -05:00
Jean-Philippe Quéméner
2319c52c85
Alerting: fix a bug where the metric in the evaluation string was not correctly populated (#41731)
Instead of using the frame name as the series name, we now use the name of the series value column if the frame name is not set. Queries to some datasources may end up with an empty frame name, which leads to an empty series name. As the series name is used in the frontend to display which metrics were queried etc. it shouldn't be empty.
2021-11-17 11:00:59 +01:00
Sofia Papagiannaki
eeb84d09c2
SSE: Change math expression to accept any value convertible to float (#34996)
* SSE: Change math expression to accept any scalar value

* Apply suggestions from code review

* Update test

* Remove TODO
2021-06-03 18:06:12 +03:00
Kyle Brandt
4093fae99a
SSE: Refactor to simplify Series type (#35063)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-06-02 12:29:19 -04:00
Kyle Brandt
5e818146de
Alerting/Expr: New SSE Request/QueryType, alerting move data source UID (#33282) 2021-04-23 16:52:32 +02:00
Kyle Brandt
512faa7c9c
SSE: Support time series frames with non-nullable float64 values (#32608)
* SSE: fix reduce to handle non-null
* add type for data.Field that is float64 or *float64
* resample fix for non-null input case, add couple non-null tests
2021-04-01 14:33:35 -04:00
Kyle Brandt
1cd8981be4
SSE/NG: Add expression metadata for EvalMatch (#32213)
- Add the ability to stick metadata attached to a value in expressions. Currently uses Frame.Meta.Custom.
- None of this is consumed by anything yet, so an incremental step.
2021-03-23 12:23:54 -04:00
Kyle Brandt
c6b11a8f90
Expressions: support ${my var} syntax (#29819) 2020-12-14 14:21:16 -05:00
Arve Knudsen
3fdf4be529
Chore: Enable more go-ruleguard rules (#29781)
* Chore: Enable more go-ruleguard rules

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-14 15:51:59 +01:00
Kyle Brandt
67372378ac
Expressions: Field names from refId (#29755)
so one can see which expression data came from when visualizing
2020-12-11 06:59:12 -05:00
Kyle Brandt
311b563c9b
Expr: make reduction nan/null more consistent (#29665) 2020-12-07 15:07:18 -05:00
Kyle Brandt
da32cef4ae
Expr: fix func argument panic (#29663)
would get wrong type for reflect
2020-12-07 13:58:20 -05:00
Arve Knudsen
f55818ca70
Chore: Enable exhaustive linter (#29458)
* Chore: Enable exhaustive linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-01 09:53:27 +01:00
Kyle Brandt
0cb29d337a
Expressions: Move GEL into core as expressions (#29072)
* comes from grafana/gel-app
* remove transform plugin code
* move __expr__ and -100 constants to expr pkg
* set OrgID on request plugin context
* use gtime for resample duration
* in resample, rename "rule" to "window", use gtime for duration, parse duration before exec
* remove gel entry from plugins-bundled/external.json
which creates an empty array for plugins
2020-11-19 07:17:00 -05:00