openvidu-pro: Add to metricbeat the ability to monitor docker containers

pull/609/head
cruizba 2021-02-04 15:19:50 +01:00
parent 5874870f38
commit d100cd8e95
3 changed files with 61 additions and 31 deletions

View File

@ -1,4 +1,18 @@
metricbeat.modules: metricbeat.modules:
- module: docker
metricsets:
- "container"
- "cpu"
- "diskio"
- "event"
- "healthcheck"
- "info"
- "image"
- "memory"
- "network"
hosts: ["unix:///var/run/docker.sock"]
period: ${OPENVIDU_PRO_STATS_MONITORING_INTERVAL}s
enabled: true
- module: system - module: system
metricsets: metricsets:
- cpu - cpu

View File

@ -1,35 +1,49 @@
metricbeat.modules: metricbeat.modules:
- module: nginx - module: docker
metricsets: ["stubstatus"] metricsets:
enabled: true - "container"
period: 10s - "cpu"
hosts: ["http://127.0.0.1"] - "diskio"
server_status_path: "nginx_status" - "event"
- module: system - "healthcheck"
metricsets: - "info"
- cpu - "image"
- diskio - "memory"
- memory - "network"
- network hosts: ["unix:///var/run/docker.sock"]
- filesystem period: ${OPENVIDU_PRO_STATS_MONITORING_INTERVAL}s
- fsstat enabled: true
- process_summary - module: nginx
- uptime metricsets: ["stubstatus"]
filesystem.ignore_types: [nfs, smbfs, autofs, devtmpfs, devpts, hugetlbfs, tmpfs, sysfs, securityfs, cgroup2, cgroup, pstore, debugfs, configfs, fusectl, proc, fuse.lxcfs, squashfs] enabled: true
processes: ['.*'] period: ${OPENVIDU_PRO_STATS_MONITORING_INTERVAL}s
processors: hosts: ["http://127.0.0.1"]
- drop_event: server_status_path: "nginx_status"
when: - module: system
or: metricsets:
- regexp: - cpu
system.network.name: '^(veth|lo|docker|br-)($|)' - diskio
- regexp: - memory
system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host)($|/)' - network
- regexp: - filesystem
system.filesystem.mount_point: '^/hostfs/(sys|cgroup|proc|dev|etc|host)($|/)' - fsstat
enabled: true - process_summary
period: ${OPENVIDU_PRO_STATS_MONITORING_INTERVAL}s - uptime
cpu.metrics: [normalized_percentages] filesystem.ignore_types: [nfs, smbfs, autofs, devtmpfs, devpts, hugetlbfs, tmpfs, sysfs, securityfs, cgroup2, cgroup, pstore, debugfs, configfs, fusectl, proc, fuse.lxcfs, squashfs]
processes: ['.*']
processors:
- drop_event:
when:
or:
- regexp:
system.network.name: '^(veth|lo|docker|br-)($|)'
- regexp:
system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host)($|/)'
- regexp:
system.filesystem.mount_point: '^/hostfs/(sys|cgroup|proc|dev|etc|host)($|/)'
enabled: true
period: ${OPENVIDU_PRO_STATS_MONITORING_INTERVAL}s
cpu.metrics: [normalized_percentages]
output: output:
elasticsearch: elasticsearch:
hosts: ["${OPENVIDU_PRO_ELASTICSEARCH_HOST}"] hosts: ["${OPENVIDU_PRO_ELASTICSEARCH_HOST}"]

View File

@ -143,12 +143,14 @@ services:
image: docker.elastic.co/beats/metricbeat-oss:7.8.0 image: docker.elastic.co/beats/metricbeat-oss:7.8.0
network_mode: host network_mode: host
restart: always restart: always
user: root
env_file: env_file:
- .env - .env
environment: environment:
- OPENVIDU_PRO_ELASTICSEARCH_HOST=${OPENVIDU_PRO_ELASTICSEARCH_HOST:-http://127.0.0.1:9200} - OPENVIDU_PRO_ELASTICSEARCH_HOST=${OPENVIDU_PRO_ELASTICSEARCH_HOST:-http://127.0.0.1:9200}
- OPENVIDU_PRO_STATS_MONITORING_INTERVAL=${OPENVIDU_PRO_STATS_MONITORING_INTERVAL:-10} - OPENVIDU_PRO_STATS_MONITORING_INTERVAL=${OPENVIDU_PRO_STATS_MONITORING_INTERVAL:-10}
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./beats/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro - ./beats/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /proc:/hostfs/proc:ro - /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro