Created
January 7, 2021 09:50
-
-
Save lucj/0c828c76c40b14b7265a64780863f5f5 to your computer and use it in GitHub Desktop.
fluent-bit / loki / grafana on Docker Swarm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
configs: | |
loki-conf: | |
file: ./loki.conf | |
fluent-bit-conf: | |
file: ./fluent-bit.conf | |
networks: | |
monitoring: | |
external: true | |
name: mon_monitoring | |
volumes: | |
loki-data: | |
services: | |
loki: | |
image: grafana/loki:2.0.0 | |
networks: | |
- monitoring | |
volumes: | |
- loki-data:/loki | |
configs: | |
- source: loki-conf | |
target: /etc/loki/local-config.yaml | |
fluent-bit: | |
image: fluent/fluent-bit:1.6.6 | |
configs: | |
- source: fluent-bit-conf | |
target: /fluent-bit/etc/fluent-bit.conf | |
deploy: | |
mode: global | |
environment: | |
- LOKI_URL=http://loki:3100/loki/api/v1/push | |
networks: | |
- monitoring | |
volumes: | |
- /var/lib/docker/containers:/var/lib/docker/containers | |
grafana: | |
image: grafana/grafana:7.3.3 | |
deploy: | |
replicas: 1 | |
networks: | |
- monitoring | |
ports: | |
- 3030:3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SERVICE] | |
Flush 10 | |
Log_Level error | |
Daemon off | |
Parsers_File parsers.conf | |
[INPUT] | |
Name tail | |
Path /var/lib/docker/containers/*/*.log | |
Parser docker | |
Refresh_Interval 10 | |
Mem_Buf_Limit 10MB | |
Skip_Long_Lines On | |
[FILTER] | |
name grep | |
match * | |
regex log service | |
[FILTER] | |
Name parser | |
Match * | |
Key_Name log | |
Parser json | |
[OUTPUT] | |
name loki | |
match * | |
host loki | |
labels job=fluentbit, $service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth_enabled: false | |
server: | |
http_listen_port: 3100 | |
log_level: warn | |
ingester: | |
lifecycler: | |
address: 127.0.0.1 | |
ring: | |
kvstore: | |
store: inmemory | |
replication_factor: 1 | |
final_sleep: 0s | |
chunk_idle_period: 5m | |
chunk_retain_period: 30s | |
schema_config: | |
configs: | |
- from: 2020-05-15 | |
store: boltdb | |
object_store: filesystem | |
schema: v11 | |
index: | |
prefix: index_ | |
period: 168h | |
storage_config: | |
boltdb: | |
directory: /loki/index | |
filesystem: | |
directory: /loki/chunks | |
limits_config: | |
enforce_metric_name: false | |
reject_old_samples: true | |
reject_old_samples_max_age: 168h |
Hum sorry it’s very old stuff now :)I think it should be possible changing the fluent bit configuration fileLe 3 sept. 2023 à 19:54, perfalle ***@***.***> a écrit :Re: ***@***.*** commented on this gist.How do you get metadata of the container log, like container name or pod name?The log files only show the docker id (in the path and file name).—Reply to this email directly, view it on GitHub or unsubscribe.You are receiving this email because you authored the thread.Triage notifications on the go with GitHub Mobile for iOS or Android.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do you get metadata of the container log, like container name or pod name?
The log files only show the docker id (in the path and file name).