InfluxDB tagsAsFields configuration issues

I’m trying to use the tagsAsFields configuration option for InfluxDB to pass one of my custom tags (a UUID) to InfluxDB as a field, in order to avoid creating too many time series. My understanding based on other forum posts, as well as sample code in the k6 git repo, is this should be possible to configure one of two ways:

  • Environment variable K6_INFLUXDB_TAGS_AS_FIELDS as described here

  • JSON config file as shown in this code sample

The environment variable works fine for me, however when I try using the JSON config file, it does not work. The UUID is still reflected as a tag in InfluxDB, and when I run an InfluxQL query to show the series on the database (which is a fresh database created to test this), it shows that new series are being created for each of the UUIDs.

The same occurs if I try removing one of the three tags which is passed as a field by default (such as vu). Works fine if I do it with the environment variable, doesn’t work if I do it through the JSON config.

Here is the relevant portion of my config file:

"collectors": {
  "influxdb": {
    "addr": "http://localhost:8086",
    "db": "k6db",
    "tagsAsFields": [
      "vu",
      "iter",
      "url",
      "UUID"
    ]
  }
}

Any thoughts?

For reference, using k6 v0.26.2.

hmm this seems like a bug/regression in k6… :disappointed: Thanks for bringing it to our attention, I’ve created a new issue about it: config.json options for influxdb collector seem broken · Issue #1519 · grafana/k6 · GitHub

No problem. Also just to note, since I saw you mentioned checking the other options in the issue, the “addr” and “db” options for the influxdb collector worked fine for me to set the database when I was testing this. My use case didn’t require me to set any of the other options, so I can’t say one way or another if this affects anything else.

Until this is resolved, I will just use the environment variable. Thanks!

1 Like