Named executions with Grafana + Influx

Hi guys,

I use InfluxDB + Grafana to show outputted results and works a lot well. But i have something bothering me.
We make a lot of executions with different data and in different periods (of days and month) and this create a big confusion, because we have a lot of executions to show in Grafana.

How to differentiate each execution in the Grafana?

  • For me, i created a sheet who i tracking all executions putting manually each execution in that sheet.

Is there any way to name executions? And see this executions on panel in Grafana or something like that?

Thanks in advance!

I haven’t done this sort of thing myself, but one approach that might work is applying a tag with the execution name to all metrics emitted by a test, and using that to create a filtered view in Grafana. The tagging part is very straightforward, as tags defined within the script options will be applied to all metrics.

export let options = {
  tags: {
    executionName: 'value'
  }
};
1 Like

Hello @dan_nm,
This is a good workaround!

I made one change, i’m passing through CLI and I am recovering in code the env variable with the “executionName”.

To show in Grafana we use:
SHOW TAG VALUES WITH KEY = "executionName"

1 Like

Tags are a good use case for this. :thumbsup:

Another alternative if you don’t want to change your script or queries is to use a different database, as k6 will create it if it doesn’t exist.

So you can run a variation of:

k6 run -o influxdb=http://influxhost:8086/k6202105 ...

Changing 202105 as needed.

You would have to update your Grafana dashboards to use the new datasource, so you probably don’t want to do this frequently, but it could be used to further separate the data, maybe even alongside tags.

2 Likes

Tags are good alternative for sure!

You is correctly, i don’t want change Grafana settings every execution but this is a good alternative too and certain could be used.

Thanks!