Skip to content

Commit 4225c03

Browse files
committed
docs/victorialogs/querying/README.md: document that row_any, row_min and row_max return labels instead of metrics from /select/logsql/stats_query and /select/logsql/stats_query_range endpoints
While at it, document that the `format` pipe can be used for generating additional labels from metrics, while `math` pipe can be used for generating additional metrics from the existing metrics. Also mention that running_stats and total_stats pipes can be used at /select/logsql/stats_query_range for calculating running stats and total stats from the stats returned from `stats` pipe. This is a follow-up for 68b9433 Updates #81
1 parent 4c0f8ce commit 4225c03

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/victorialogs/querying/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,12 @@ in the format compatible with [Prometheus querying API](https://prometheus.io/do
455455
The `<query>` must contain [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe). The calculated stats is converted into metrics
456456
with labels from `by(...)` clause of the `| stats by(...)` pipe.
457457

458+
The [`row_any`](https://docs.victoriametrics.com/victorialogs/logsql/#row_any-stats), [`row_min`](https://docs.victoriametrics.com/victorialogs/logsql/#row_min-stats)
459+
and [`row_max`](https://docs.victoriametrics.com/victorialogs/logsql/#row_max-stats) stats functions create labels instead of metrics.
460+
461+
Additional labels can be created from metrics via [`format` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe).
462+
Additional metrics can be created from the existing metrics via [`math` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#math-pipe).
463+
458464
The `<t>` arg can contain values in [any supported format](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#timestamp-formats).
459465
If `<t>` is missing, then it equals to the current time.
460466

@@ -532,6 +538,16 @@ The stats is returned in the format compatible with [Prometheus querying API](ht
532538
The `<query>` must contain [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe). The calculated stats is converted into metrics
533539
with labels from `by(...)` clause of the `| stats by(...)` pipe.
534540

541+
The [`row_any`](https://docs.victoriametrics.com/victorialogs/logsql/#row_any-stats), [`row_min`](https://docs.victoriametrics.com/victorialogs/logsql/#row_min-stats)
542+
and [`row_max`](https://docs.victoriametrics.com/victorialogs/logsql/#row_max-stats) stats functions create labels instead of metrics.
543+
544+
Additional labels can be created from metrics via [`format` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#format-pipe).
545+
Additional metrics can be created from the existing metrics via [`math` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#math-pipe).
546+
547+
It may be useful to use [`running_stats`](https://docs.victoriametrics.com/victorialogs/logsql/#running_stats-pipe)
548+
and [`total_stats`](https://docs.victoriametrics.com/victorialogs/logsql/#total_stats-pipe) pipes for calculating running and total stats over the stats
549+
returned by the [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe).
550+
535551
The `<start>` and `<end>` args can contain values in [any supported format](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#timestamp-formats).
536552
If `<start>` is missing, then it equals to the minimum timestamp across logs stored in VictoriaLogs.
537553
If `<end>` is missing, then it equals to the maximum timestamp across logs stored in VictoriaLogs.

0 commit comments

Comments
 (0)