+ Trackign host metrics with vector docker container

This commit is contained in:
shockrah 2022-04-15 00:11:06 -07:00
parent a8ba3dccab
commit 99a84d454c
2 changed files with 46 additions and 0 deletions

View 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"

View 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"