k6
k6 copied to clipboard
Allow user-defined tags based on response data for built-in metrics (e.g. value of a certain HTTP header)
Feature Description
I know it's possible to add tags at various stages and abstraction levels: https://grafana.com/docs/k6/latest/using-k6/tags-and-groups/#user-defined-tags. But this has to happen before the operation and apparently it's not possible to dynamically extract a tag based on the response data, e.g. when calling fail.
In my case I'd like to extract more details from 4xx or 5xx errors (certain HTTP headers indicating a more detailed reason for the failure). I know I can create a custom metric and apply a tag based on the response. But I'd much rather add another tag or two to the built-in metrics.
A somewhat related question might be this one here: https://github.com/grafana/k6/issues/680
Suggested Solution (optional)
No response
Already existing or connected issues / PRs (optional)
No response