monitoring: add cadvisor to prometheus

This commit is contained in:
Iurii Tatishchev 2023-07-05 17:56:52 -07:00
parent 1ef7f1cf6e
commit 6a92053232
Signed by: CaZzzer
GPG Key ID: 9A156B7DA6398968
3 changed files with 61 additions and 0 deletions

View File

@ -14,6 +14,10 @@ scrape_configs:
static_configs:
- targets: ["{{ ansible_host }}:9100"]
- job_name: "cadvisor"
static_configs:
- targets: ["{{ ansible_host }}:9110"]
- job_name: "loki"
static_configs:
- targets: ["loki:3100"]

View File

@ -1,3 +1,12 @@
- name: Configure cadvisor
become: yes
template:
src: default/cadvisor.j2
dest: /etc/default/cadvisor
owner: root
group: root
mode: 0644
- name: Install Debian packages
become: yes
ansible.builtin.apt:
@ -6,6 +15,7 @@
- docker-compose-plugin
- firewalld
- prometheus-node-exporter
- cadvisor
state: latest
- name: Upgrade Debian packages

View File

@ -0,0 +1,47 @@
# config options for cadvisor(1)
#
# Docker endpoint to connect to
# Default: unix:///var/run/docker.sock
CADVISOR_DOCKER_ENDPOINT="unix:///var/run/docker.sock"
# Port to listen on
# Default: 8080
CADVISOR_PORT="9110"
# Storage driver
# Default: none/blank
#
# Available Options:
# - <empty>
# - bigquery
# - elasticsearch
# - kafka
# - redis
# - statsd
# - stdout
CADVISOR_STORAGE_DRIVER=""
# Storage driver host
# Default: localhost:8086"
CADVISOR_STORAGE_DRIVER_HOST="localhost:8086"
# Storage driver password
# Default: root
CADVISOR_STORAGE_DRIVER_PASSWORD="root"
# Storage driver secure connection
# Default: false
CADVISOR_STORAGE_DRIVER_SECURE="false"
# Storage driver user
# Default: root
CADVISOR_STORAGE_DRIVER_USER="root"
# Log to stderr ("true" logs to journal on systemd
# and "false" to "/var/log/cadvisor.log" on SysV)
# Default: true
CADVISOR_LOG_TO_STDERR="true"
# Other options:
#DAEMON_ARGS=""