Changing Cardinality of Influxdb

John Wheeler
5 min readOct 16, 2021

In March of 2021 I published this article about loading pi-hole metrics into Influxdb with Telegraf. At the time of the writing I was aware of the possibility that I could impact the cardinality of the domain tag. This tag would contain every domain every requested. I vaguely remember reading about Influxdbs retention policy

The following sections cover how to create, alter, and delete retention policies. Note that when you create a database, InfluxDB automatically creates a retention policy named autogen which has infinite retention. You may disable its auto-creation in the configuration file.

So…. that could be a problem. If influxdb is recording the requested domain as a tag, and the database has an infinite retention, I’m pretty sure i’m gonna have a lot of tags.

I started to see errors politely warning me that Influxdb had exceeded it’s max-values-per-tag limit in August. Influx decided that it’s helpful warnings were not sufficient for me to take action so it it began to drop data points with messages like the following

Sep 23 23:57:14 pi-hole2 telegraf[32315]: 2021-09-24T04:57:14Z E! [outputs.influxdb] When writing to [http://192.168.1.26:8086]: received error partial write: max-values-per-tag limit exceeded (100008/100000): measurement="piholestats" tag="domain" value="guc3-spclient.spotify.com"…

--

--

John Wheeler
John Wheeler

Written by John Wheeler

Security professional, Mac enthusiast, writing code when I have to.