grafana / k6-cloud-feature-requests

The place to propose, dicuss and vote for k6 Cloud features and ideas.
9 stars 1 forks source link

Ability to add tags for each test run #2

Closed robingustafsson closed 7 months ago

robingustafsson commented 3 years ago

This is an idea submitted to our previous ideas portal

Would be great to add different tags on each run. Now we use the note-field to fill in our different changes for each, but it is hard to get an overview of the different settings used. Some tests we enable a feature and on some we disable it etc. Tags would help.

dgzlopes commented 3 years ago

I would like to use these tags to differentiate environments (staging/prod/dev/) and runs triggered from CI (by commit, branch).

Also, being able to filter by tag on the Web App would be very useful!

na-- commented 3 years ago

Instead of simply having tags as UI fields in the web app, we probably should integrate this with the tags k6 option? Both showing key=value in the web app when the user launches k6 cloud --tag key=value script.js, but also allowing them to specify them equivalently when starting test directly from the web app.

https://github.com/k6io/cloud-feature-requests/issues/9 is somewhat connected, visualizing and specifying env vars from the web apps will be just as useful.

robingustafsson commented 3 years ago

Agree that having the ability to use tags for filtering tests and test runs on the dashboard and on the test overview page would be very handy in the web app. Not sure if we could somehow re-use k6 run/cloud --tag for this purpose on the test/test run level or if we need to introduce a separate option for k6 cloud and k6 run --cloud, something like a --test-tag or similar.

na-- commented 3 years ago

We should be able to reuse them, tags are included in the .tar bundle.

dgzlopes commented 3 years ago

Also, I know that @mostafa has plans for static test-wide labels on Cloud APM (example: tagging all the metrics with env:staging).

If we can re-use the tags set by this feature, would be kinda cool.

robingustafsson commented 3 years ago

Good, yeah I didn't remember if we stored/included it in the options or if it was only used to add tags to metric data points.

robingustafsson commented 3 years ago

It feels like this is also overlapping into the feature of supporting environment variables so we should probably discuss how these things can work in unity.

na-- commented 3 years ago
k6 archive --tag key=value --tag foo=bar --env MY_ENV=VAR 'github.com/loadimpact/k6/samples/http_get.js'
tar xfO archive.tar metadata.json | jq '.options.tags,.env'

results in

{
  "foo": "bar",
  "key": "value"
}
{
  "MY_ENV": "VAR"
}
jon-whit commented 1 year ago

I have the same use case @dgzlopes mentioned above. We'd like to use tags to identify commits and/or prs and be able to compare test runs against each other by commit tag, for example.

markjmeier commented 7 months ago

This issue has been moved to Grafana Feature requests