Last active
August 24, 2022 14:33
-
-
Save cronolio/2a15e6d1ffb82ca72cc03af2b1fa141d to your computer and use it in GitHub Desktop.
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: '2.4' | |
services: | |
#prom: | |
# image: prom/prometheus:latest | |
# container_name: prom | |
# restart: unless-stopped | |
# volumes: | |
# - ./conf/prometheus.yml:/etc/prometheus/prometheus.yml:ro | |
# - ./conf/alerts:/etc/prometheus/alerts | |
# - ./data/prom:/prometheus | |
# command: | |
# - '--config.file=/etc/prometheus/prometheus.yml' | |
# - '--storage.tsdb.path=/prometheus' | |
# - '--web.console.libraries=/usr/share/prometheus/console_libraries' | |
# - '--web.console.templates=/usr/share/prometheus/consoles' | |
# - '--storage.tsdb.retention.time=200h' | |
# - '--web.enable-lifecycle' | |
# ports: | |
# - 9090:9090 | |
# networks: | |
# - monitor | |
alert: | |
image: prom/alertmanager:latest | |
container_name: alert | |
restart: unless-stopped | |
volumes: | |
- ./conf/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro | |
- ./data/alert:/alertmanager | |
command: | |
- '--config.file=/etc/alertmanager/alertmanager.yml' | |
- '--storage.path=/alertmanager' | |
mem_limit: 50M | |
ports: | |
- 9093:9093 | |
networks: | |
- monitor | |
#cadvisor: | |
# image: gcr.io/cadvisor/cadvisor:v0.38.6 | |
# container_name: cadvisor | |
# privileged: true | |
# restart: unless-stopped | |
# devices: | |
# - "/dev/kmsg:/dev/kmsg" | |
# volumes: | |
# - /:/rootfs:ro | |
# - /var/run:/var/run:ro | |
# - /sys:/sys:ro | |
# - /var/lib/docker/:/var/lib/docker:ro | |
# - /dev/disk/:/dev/disk:ro | |
# command: | |
# - '-storage_duration=60m0s' | |
# - '-enable_load_reader=true' | |
# - '-docker_only=true' | |
# - '-raw_cgroup_prefix_whitelist=/docker/' | |
# - '-logtostderr=true' | |
# - '-store_container_labels=false' | |
# - '-whitelisted_container_labels=restartcount' | |
# - '-allow_dynamic_housekeeping=true' | |
# - '-housekeeping_interval=10s' | |
# ports: | |
# - 8080:8080 | |
# networks: | |
# - monitor | |
graf: | |
image: grafana/grafana:8.2.2 | |
container_name: graf | |
restart: unless-stopped | |
mem_limit: 200M | |
volumes: | |
- ./conf/grafana.ini:/etc/grafana/grafana.ini:ro | |
# #- ./conf/grafana-ldap.toml:/etc/grafana/ldap.toml:ro | |
- ./data/graf:/var/lib/grafana | |
ports: | |
- 3000:3000 | |
networks: | |
- monitor | |
loki: | |
image: grafana/loki:2.3.0 | |
container_name: loki | |
volumes: | |
- ./conf/loki-local-config.yaml:/etc/loki/loki-local-config.yaml | |
- ./data/loki:/data/loki | |
- ./conf/loki-alerts:/etc/loki/alerts/fake:ro | |
command: -config.file=/etc/loki/loki-local-config.yaml | |
ports: | |
- "3100:3100" | |
networks: | |
- monitor | |
promtail: | |
image: grafana/promtail:2.3.0 | |
container_name: promtail | |
mem_limit: 200M | |
volumes: | |
- ./conf/promtail.yml:/etc/promtail/promtail.yml:ro | |
- /var/lib/docker/containers:/host/var/lib/docker/containers:ro | |
- /var/log/journal:/host/var/log/journal:ro | |
- /etc/machine-id:/etc/machine-id:ro | |
command: -config.file=/etc/promtail/promtail.yml | |
ports: | |
- "9080:9080" | |
networks: | |
- monitor | |
networks: | |
monitor: | |
driver: bridge |
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_address: 0.0.0.0 | |
http_listen_port: 3100 | |
ingester: | |
lifecycler: | |
address: 127.0.0.1 | |
ring: | |
kvstore: | |
store: inmemory | |
replication_factor: 1 | |
final_sleep: 0s | |
chunk_idle_period: 15m | |
chunk_retain_period: 30s | |
schema_config: | |
configs: | |
- from: 2020-11-01 | |
store: boltdb | |
object_store: filesystem | |
schema: v11 | |
index: | |
prefix: index_ | |
period: 168h | |
storage_config: | |
boltdb: | |
directory: /data/loki/index | |
filesystem: | |
directory: /data/loki/chunks | |
ruler: | |
storage: | |
type: local | |
local: | |
directory: /etc/loki/alerts | |
rule_path: /loki/tmprules | |
alertmanager_url: http://alert:9093 | |
ring: | |
kvstore: | |
store: inmemory | |
enable_api: true | |
limits_config: | |
enforce_metric_name: false | |
reject_old_samples: true | |
reject_old_samples_max_age: 168h | |
chunk_store_config: | |
max_look_back_period: 0 | |
table_manager: | |
chunk_tables_provisioning: | |
inactive_read_throughput: 0 | |
inactive_write_throughput: 0 | |
provisioned_read_throughput: 0 | |
provisioned_write_throughput: 0 | |
index_tables_provisioning: | |
inactive_read_throughput: 0 | |
inactive_write_throughput: 0 | |
provisioned_read_throughput: 0 | |
provisioned_write_throughput: 0 | |
retention_deletes_enabled: false | |
retention_period: 0 |
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
server: | |
http_listen_port: 9080 | |
grpc_listen_port: 0 | |
positions: | |
filename: /tmp/positions.yaml | |
clients: | |
- url: http://loki:3100/loki/api/v1/push | |
scrape_configs: | |
- job_name: docker | |
static_configs: | |
- targets: | |
- localhost | |
labels: | |
job: docker | |
__path__: /host/var/lib/docker/containers/*/*log | |
pipeline_stages: | |
- json: | |
expressions: | |
output: log | |
stream: stream | |
attrs: | |
- json: | |
expressions: | |
tag: | |
source: attrs | |
- regex: | |
expression: (?P<image_name>(?:[^|]*[^|])).(?P<container_name>(?:[^|]*[^|])).(?P<container_id>(?:[^|]*[^|])) | |
source: tag | |
- timestamp: | |
format: RFC3339Nano | |
source: time | |
- labels: | |
#tag: | |
stream: | |
image_name: | |
container_name: | |
#image_id: | |
container_id: | |
- output: | |
source: output | |
- job_name: systemd | |
journal: | |
json: false | |
max_age: 12h | |
path: /host/var/log/journal | |
labels: | |
job: systemd | |
relabel_configs: | |
- source_labels: ['__journal__systemd_unit'] | |
target_label: 'unit' | |
- source_labels: ['__journal__hostname'] | |
target_label: 'instance' | |
- source_labels: ['__journal_syslog_identifier'] | |
target_label: 'syslog_identifier' | |
- source_labels: ['__journal_syslog_facility'] | |
target_label: 'syslog_facility' | |
- source_labels: ['__journal_priority'] | |
target_label: 'priority' | |
- source_labels: ['priority'] | |
target_label: 'priority' | |
- source_labels: ['level'] | |
target_label: 'level' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment