VictoriaMetrics/app/vmalert/notifier
Hui Wang a18ad8d440
vmalert: add time buckets stats pipe check for vlogs expression (#8400)
VictoriaLogs inserts `_time` field as a label in result when query with
[time buckets stats
pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-by-time-buckets),
making the result meaningless and may lead to cardinality issues.
>curl --location --request POST
'https://play-vmlogs.victoriametrics.com/select/logsql/stats_query?query=_time%3A1m%20%7C%20stats%20by%20(_time%3A10s)%20count%20()%20as%20total'

>{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"total","_time":"2025-01-24T12:31:30Z"},"value":[1737721904.4476516,"12"]},{"metric":{"__name__":"total","_time":"2025-01-24T12:31:10Z"},"value":[1737721904.4476516,"10"]},{"metric":{"__name__":"total","_time":"2025-01-24T12:31:00Z"},"value":[1737721904.4476516,"10"]},{"metric":{"__name__":"total","_time":"2025-01-24T12:31:20Z"},"value":[1737721904.4476516,"12"]},{"metric":{"__name__":"total","_time":"2025-01-24T12:30:50Z"},"value":[1737721904.4476516,"10"]},{"metric":{"__name__":"total","_time":"2025-01-24T12:30:40Z"},"value":[1737721904.4476516,"9"]}]}}%

---------

Signed-off-by: hagen1778 <roman@victoriametrics.com>
Co-authored-by: hagen1778 <roman@victoriametrics.com>
(cherry picked from commit 52988ebdc8)
2025-03-03 14:14:58 +01:00
..
testdata vmalert: support specifying full http url in notifier static_configs target (#5261) 2023-11-01 16:44:54 +01:00
alert.go app/vmalert: fixes reload of external templates 2024-12-13 12:10:31 +01:00
alert_test.go app/vmalert: fix possible template overwritten between rule annotations 2024-12-10 21:43:39 +01:00
alertmanager.go app/vmalert: properly unregister exposed metrics for alerting rules 2025-02-21 12:43:27 +01:00
alertmanager_request.qtpl app/vmalert/notifier: fix rendering of Alertmanager notification body 2025-01-10 16:51:06 +04:00
alertmanager_request.qtpl.go app/vmalert/notifier: fix rendering of Alertmanager notification body 2025-01-10 16:51:06 +04:00
alertmanager_test.go app/vmalert/notifier: fix rendering of Alertmanager notification body 2025-01-10 16:51:06 +04:00
config.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:23:26 +02:00
config_test.go app/vmalert: switch from table-driven tests to f-tests 2024-07-12 22:45:50 +02:00
config_watcher.go all: consistently use %w instead of %s in when error is passed to fmt.Errorf() 2023-10-26 09:44:40 +02:00
config_watcher_test.go app/vmalert: switch from table-driven tests to f-tests 2024-07-12 22:45:50 +02:00
faker.go vmalert-tool: implement unittest (#4789) 2023-10-16 14:12:06 +02:00
init.go vmalert: add time buckets stats pipe check for vlogs expression (#8400) 2025-03-03 14:14:58 +01:00
init_test.go vmalert: follow-up after d4ac4b7813 (#4659) 2023-07-18 16:03:28 -07:00
notifier.go vmalert: allow configuring custom notifier headers per group (#4088) 2023-05-08 17:07:44 -07:00
notifier_blackhole.go app/vmalert: properly unregister exposed metrics for alerting rules 2025-02-21 12:43:27 +01:00
notifier_blackhole_test.go app/vmalert: switch from table-driven tests to f-tests 2024-07-12 22:45:50 +02:00
package_test.go app/vmalert: fixes reload of external templates 2024-12-13 12:10:31 +01:00