Some Bits: Nelson's log

Influx: seeing table (measurement) size

I’ve been accumulating data in Influx DB for a long time. Here’s how to see how much (in bytes)

influx_inspect report-disk -detailed /var/lib/influxdb/data |
  jq '.Measurement | sort_by(.size)'

I’d like to set up a retention policy to auto-delete some old data but unfortunately policies seem to be per database. I’ve got a lot of stuff in a single database named telegraf and some of it I want to keep forever, others I want to discard after a month. I imagine there’s a way to configure the telegraf agent to start writing data in different databases and/or retention policies.