grafana / xk6-output-opentelemetry

A k6 extension to output real-time test metrics in OpenTelemetry format.
GNU Affero General Public License v3.0
5 stars 2 forks source link

Better handling k6's `Rate` metric #12

Open olegbespalov opened 1 week ago

olegbespalov commented 1 week ago

What?

k6's Rate metric tracks how frequently a non-zero value occurs.

So from the k6's metrics engine, we get either the 0 or 1, and inside the open telemetry output extension, we split this into two metrics:

where the metric_name.occurred registers only under the condition that the value was non-zero

This approach has an obvious downside: it could produce a case where metric_name.occurred could not be produced at all.

For instance, if we run an example script with a demo dashboard after navigation to the Checks list panel, we quickly spot that protocol is HTTP/2 is missing.

So we need to think about how we can handle this more efficiently.

Possible Options

Always start metric with the 0 value

One of the possible approaches suggested by @joanlopez and was used inside grafana

TBD

Why?

Handling of the Rate metric should be transparent and cover all possible cases.