Push a new tag/field into InfluxDB

Hi Team, I would like to push new field into InfluxDB while running the test.
For example, I want to send the project ID and API Name to influxDB along with K6 metrics. So I can visualize them in grafana based on the Project ID and API Name in case of multiple execution at the same time from different project.
Is it possible? If yes, can you give some insights how to do that?

Thank you.

You can specify tags which will be applied to all metrics emitted by a test in your options. Example below shows the options object in code, but you can also specify them in an options JSON file, or via the command line when running your script.

export let options = {
  tags: {
    projectId: '123',
    apiName: 'Our awesome API'
  }
};

More info: Options reference

1 Like

Thanks @dan_nm . This is really helpful and met my requirement.