VictoriaMetrics/app/vmalert/config
Hui Wang 52988ebdc8
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>
2025-03-03 14:09:34 +01:00
..
fslocal app/vmalert: add support of recursive path globs for rules and templates (#4148) 2023-04-26 19:20:22 +02:00
fsurl all: consistently use %w instead of %s in when error is passed to fmt.Errorf() 2023-10-25 21:24:03 +02:00
log app/vmalert: switch from table-driven tests to f-tests 2024-07-12 22:41:11 +02:00
testdata app/vmalert: fix possible template overwritten between rule annotations 2024-12-10 14:59:40 +01:00
config.go vmalert: integrate with victorialogs (#7255) 2024-10-29 16:30:39 +01:00
config_test.go vmalert: add time buckets stats pipe check for vlogs expression (#8400) 2025-03-03 14:09:34 +01:00
fs.go vmalert-tool: support file path with hierarchical patterns and regexp… (#6501) 2024-06-18 14:14:30 +02:00
fs_test.go vmalert: support object storage for rules (#519) 2023-02-09 18:50:48 -08:00
types.go vmalert: add time buckets stats pipe check for vlogs expression (#8400) 2025-03-03 14:09:34 +01:00