I want to monitor the size of MEASUREMENTS
to remove those that exceed the specified size, how do I get the size of eachMEASUREMENTS
?
Q: how do I get the size of each MEASUREMENTS
?
A: I don't think this is possible in today's influxdb
simply because data are categorised by shards
.
In influxdb, each shard contains a time range duration determined by the retention policy.
Depending on the time stamp of a point data, the database then finds the shard that has a range which fits the data’s time stamp and puts the data into that shard.
Then for each shard, a flat file (data file) is used to store the data on disk
To summarise, measurement is just a logical grouping of data within influx. Data are not stored according to measurements, instead they are stored in their respective shard.
If you haven't change the default influxdb.conf you can find the data files at /var/lib/influxdb/data/
. In there you will see directories resembling your database name and then your retention policy name.
Not sure what your use case is but you could be interested in monitoring the shard size instead.