monitoring: add cadvisor to prometheus
This commit is contained in:
parent
1ef7f1cf6e
commit
6a92053232
@ -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"]
|
||||
|
@ -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
|
||||
|
47
roles/common/templates/default/cadvisor.j2
Normal file
47
roles/common/templates/default/cadvisor.j2
Normal 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=""
|
Loading…
x
Reference in New Issue
Block a user