File: influxdb.md

package info (click to toggle)
cadvisor 0.38.7%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,508 kB
  • sloc: ansic: 839; sh: 310; python: 101; makefile: 93
file content (32 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Exporting cAdvisor Stats to InfluxDB

cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located:

Set the storage driver as InfluxDB.

```
 -storage_driver=influxdb
```

Specify what InfluxDB instance to push data to:

```
 # The *ip:port* of the database. Default is 'localhost:8086'
 -storage_driver_host=ip:port
 # database name. Uses db 'cadvisor' by default
 -storage_driver_db
 # database username. Default is 'root'
 -storage_driver_user
 # database password. Default is 'root'
 -storage_driver_password
 # Use secure connection with database. False by default
 -storage_driver_secure
 # Writes will be buffered for this duration, and committed to the non memory backends as a single transaction. Default is '60s'
 -storage_driver_buffer_duration
 # retention policy. Default is '' which corresponds to the default retention policy of the influxdb database
-storage_driver_influxdb_retention_policy
```

# Examples

[Brian Christner](https://www.brianchristner.io) wrote a detailed post on [setting up Docker monitoring](https://www.brianchristner.io/how-to-setup-docker-monitoring) with cAdvisor and Influxdb.  A docker compose configuration for setting up cadvisor-influxdb-grafana can be found [here](https://github.com/dalekurt/docker-monitoring/blob/master/docker-compose.yml).