+ Trackign host metrics with vector docker container
This commit is contained in:
parent
a8ba3dccab
commit
99a84d454c
13
docker-host/setup/files/vector.toml
Normal file
13
docker-host/setup/files/vector.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[sources.host_metrics]
|
||||
type = "host_metrics"
|
||||
collectors = [ "cpu", "disk", "host", "memory", "network" ]
|
||||
namespace = "leftcoastlab-host"
|
||||
scrape_interval_secs = 60
|
||||
|
||||
[sinks.host_metrics_output]
|
||||
type = "console"
|
||||
inputs = [ "host_metrics" ]
|
||||
target = "stdout"
|
||||
|
||||
encoding.codec = "json"
|
||||
|
33
docker-host/setup/tasks/vector.yml
Normal file
33
docker-host/setup/tasks/vector.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
- hosts: leftcoastlab
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Include Vars
|
||||
include_vars:
|
||||
dir: ../vars
|
||||
|
||||
- name: Ensure /opt/vector/ exists
|
||||
file:
|
||||
path: /opt/vector
|
||||
state: directory
|
||||
|
||||
- name: Copy over Vector config
|
||||
copy:
|
||||
src: ../files/vector.toml
|
||||
dest: /opt/vector/vector.toml
|
||||
|
||||
- name: Start up Vector Container
|
||||
community.docker.docker_container:
|
||||
name: vector-host-metrics
|
||||
image: timberio/vector:latest-alpine
|
||||
pull: yes
|
||||
restart_policy: always
|
||||
recreate: yes
|
||||
volumes:
|
||||
- "/opt/vector/vector.toml:/etc/vector/vector.toml"
|
||||
log_driver: loki
|
||||
log_options:
|
||||
loki-url: "http://localhost:{{LOKI_PORT}}/loki/api/v1/push"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user