With the following code you can add a sensor to keep track of your Influx Database Size:
- platform: influxdb
host: yourinfluxdbhost
queries:
- name: InfluxDb Database Size
unit_of_measurement: MB
value_template: '{{ (value | float / 1024 /1024) | round(1) }}'
group_function: sum
measurement: '"monitor"."shard"'
database: _internal
where: 'time > now() - 10s'
field: diskBytes