Allow to send k6 metrics to VictoriaMetrics #119

Closed
opened 2024-01-22 13:16:47 +00:00 by fyrchik · 1 comment
Owner

With --out flag, k6 allows to write not just summary, but constantly changing metrics. Besides JSON and CSV, there is a number of other targets, see
https://k6.io/docs/results-output/real-time/
We need to check whether some of these defaults work with VictoriaMetrics.

If it is not possible, we write a custom output extension:
https://k6.io/docs/extensions/get-started/create/output-extensions/

With `--out` flag, k6 allows to write not just summary, but constantly changing metrics. Besides JSON and CSV, there is a number of other targets, see https://k6.io/docs/results-output/real-time/ We need to check whether some of these defaults work with VictoriaMetrics. If it is not possible, we write a custom output extension: https://k6.io/docs/extensions/get-started/create/output-extensions/
dstepanov-yadro self-assigned this 2024-01-23 06:43:29 +00:00

To send metrics to prometheus:

K6_PROMETHEUS_RW_SERVER_URL=http://prometheus.host:8888/api/v1/write \ <-- prometheus remote write URL (required)
K6_PROMETHEUS_RW_TREND_STATS="p(95),p(99),min,max" \ <-- percentiles for duration metrics (optional)
./k6 run ... \
-e METRIC_TAGS=instance:value \ <-- custom metrics tags (optional)
-o experimental-prometheus-rw \ <-- output format (required)
scenario.js
To send metrics to prometheus: ``` K6_PROMETHEUS_RW_SERVER_URL=http://prometheus.host:8888/api/v1/write \ <-- prometheus remote write URL (required) K6_PROMETHEUS_RW_TREND_STATS="p(95),p(99),min,max" \ <-- percentiles for duration metrics (optional) ./k6 run ... \ -e METRIC_TAGS=instance:value \ <-- custom metrics tags (optional) -o experimental-prometheus-rw \ <-- output format (required) scenario.js ```
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/xk6-frostfs#119
No description provided.