javascripttagsperformance-testinginfluxdbk6

Tag virtual users in k6


Is it possible in k6 to tag virtual users?

I launch several k6 tests at once, and in my Grafana I want to see different graphs for virtual users joining the test. However, now I can only see the common value for all the tests, as in the InfluxDB there are not any tags which allow to differ virtual users from test to test.

I tried some options with tags, but I was able only to tag the requests which is not the solution.


Solution

  • You can simply set test-wide tags for all metrics via options:

    export const options = {
        tags: {
            mytag: 'myvalue',
        },
    };
    

    You may also specify them via the command line as --tag mytag=myvalue.