I need to see the custom Trend Metrics and individual HTTP URL based metrics of K6 in the InfluxDB/Grafana. But K6 spits out only the standard metrics and I can’t see the custom Trend Metrics and individual HTTP URL based metrics
The command I used to export the metrics to InfluxDB is as below
Are you sure you’re selecting TestDB as data source for your Grafana dashboard? And that command wouldn’t work since --test.js is not a flag, so I’m assuming you’re running something else.
I confirmed that running the following script is pushing the custom metric to InfluxDB:
import http from "k6/http";
import { Trend } from "k6/metrics";
import { sleep } from "k6";
let myTrend = new Trend("my_trend");
export default function () {
let res = http.get("https://httpbin.test.k6.io/get");
myTrend.add(res.timings.duration);
sleep(1);
}
Then running it with:
k6 run -i 1000 -u 10 -o influxdb=http://127.0.0.1:8086/k6 script.js
I can see the metric in InfluxDB:
Just in case, please share your k6 version (output of k6 version) and your script if possible.