Commit f8e085e9 authored by kaiyou's avatar kaiyou

Remove agents

parent 94b1e0ff
# Sources
<source>
@type unix
@id in_docker
@label docker
path /var/log/fluentd.socket
</source>
<source>
@type systemd
@id in_systemd
@label systemd
tag system
<entry>
fields_lowercase false
field_map {"_PID": "pid", "MESSAGE": "log", "SYSLOG_IDENTIFIER": "identifier", "_HOSTNAME": "hostname", "PRIORITY": "priority"}
field_map_strict true
</entry>
</source>
# Handle docker logs
<label docker>
<filter *>
@type parser
format /^/(?<app>[^_]+)_(?<service>.+)_[0-9]+$/
key_name container_name
reserve_data true
</filter>
<filter *>
@type record_transformer
<record>
tag ${record["app"]}.${record["service"]}
</record>
</filter>
<match *>
@type relabel
@label common
</match>
</label>
# Handle systemd logs
<label systemd>
<filter *>
@type record_transformer
<record>
app system
</record>
</filter>
<match *>
@type relabel
@label common
</match>
</label>
<label common>
<filter *>
@type record_transformer
<record>
instance "#{ENV['LOKI_INSTANCE']}"
</record>
</filter>
<match system>
@type forward
transport tls
tls_cert_path /fluentd/etc/cert.pem
tls_verify_hostname true
<server>
host "#{ENV['BACKUP_INSTANCE']}"
port "#{ENV['BACKUP_PORT']}"
</server>
<security>
self_hostname "#{ENV['LOKI_INSTANCE']}"
shared_key "#{ENV['BACKUP_KEY']}"
</security>
</match>
<match **>
@type loki
url "#{ENV['LOKI_URL']}"
label_keys "app,service,tag,instance"
buffer_type memory
buffer_chunk_limit 2m
flush_interval 10s
flush_at_shutdown true
</match>
</label>
version: '2.1'
services:
node-exporter:
image: prom/node-exporter:latest
restart: always
ports:
- ${ipv6}:7001:9100
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--path.rootfs=/rootfs'
cadvisor:
image: google/cadvisor
restart: always
ports:
- ${ipv6}:7002:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
command: --docker_only=true --housekeeping_interval=10s --disable_metrics=tcp,udp,sched,process,disk,network
fluentd:
image: docker.tedomum.net/tedomum/loki:fluentd
restart: always
volumes:
- ./conf:/fluentd/etc
- /var/log:/var/log
environment:
- FLUENTD_CONF=/fluentd/etc/fluent.conf
- LOKI_INSTANCE
- LOKI_URL
- BACKUP_INSTANCE
- BACKUP_PORT
- BACKUP_KEY
logging: {driver: "json-file"}
networks:
default:
enable_ipv6: true
driver: bridge
ipam:
driver: default
config:
- subnet: "${prefix}/80"
gateway: "${prefix}1"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment