diff --git a/docker-compose/common/compose-include/agent-collect-logs.yaml b/docker-compose/common/compose-include/agent-collect-logs.yaml new file mode 100644 index 00000000..ccda2947 --- /dev/null +++ b/docker-compose/common/compose-include/agent-collect-logs.yaml @@ -0,0 +1,27 @@ + +services: + agent: + depends_on: + gateway: + condition: service_started + image: grafana/agent:v0.35.3 + volumes: + - ../config/agent-flow:/etc/agent-config + - /var/run/docker.sock:/var/run/docker.sock + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/logs.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --disable-reporting=true + environment: + - AGENT_MODE=flow + - AGENT_CONFIG_FOLDER=/etc/agent-config + healthcheck: + test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:12345/ready || exit 1" ] + interval: 10s + timeout: 5s + retries: 10 + ports: + - "12345:12345" diff --git a/docker-compose/common/compose-include/agent-collect-metrics.yaml b/docker-compose/common/compose-include/agent-collect-metrics.yaml new file mode 100644 index 00000000..0c0e859a --- /dev/null +++ b/docker-compose/common/compose-include/agent-collect-metrics.yaml @@ -0,0 +1,27 @@ + +services: + agent: + depends_on: + gateway: + condition: service_started + image: grafana/agent:v0.35.3 + volumes: + - ../config/agent-flow:/etc/agent-config + - /var/run/docker.sock:/var/run/docker.sock + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/metrics.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --disable-reporting=true + environment: + - AGENT_MODE=flow + - AGENT_CONFIG_FOLDER=/etc/agent-config + healthcheck: + test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:12345/ready || exit 1" ] + interval: 10s + timeout: 5s + retries: 10 + ports: + - "12345:12345" \ No newline at end of file diff --git a/docker-compose/common/compose-include/agent-collect-traces.yaml b/docker-compose/common/compose-include/agent-collect-traces.yaml new file mode 100644 index 00000000..3cb649e9 --- /dev/null +++ b/docker-compose/common/compose-include/agent-collect-traces.yaml @@ -0,0 +1,27 @@ + +services: + agent: + depends_on: + gateway: + condition: service_started + image: grafana/agent:v0.35.3 + volumes: + - ../config/agent-flow:/etc/agent-config + - /var/run/docker.sock:/var/run/docker.sock + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/traces.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --disable-reporting=true + environment: + - AGENT_MODE=flow + - AGENT_CONFIG_FOLDER=/etc/agent-config + healthcheck: + test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:12345/ready || exit 1" ] + interval: 10s + timeout: 5s + retries: 10 + ports: + - "12345:12345" diff --git a/docker-compose/common/compose-include/load-mimir-rules.yaml b/docker-compose/common/compose-include/load-mimir-rules.yaml new file mode 100644 index 00000000..43f5f4f2 --- /dev/null +++ b/docker-compose/common/compose-include/load-mimir-rules.yaml @@ -0,0 +1,16 @@ +# use mimirtool load rules +services: + load-mimir-rules: + depends_on: + gateway: + condition: service_started + image: grafana/mimirtool:2.9.0 + volumes: + - ../../../monitoring-mixins/mimir-mixin/deploy/rules.yaml:/mimir-mixin/rules.yaml + - ../../../monitoring-mixins/mimir-mixin/deploy/alerts.yaml:/mimir-mixin/alerts.yaml + environment: + - MIMIR_ADDRESS=http://gateway:8080 + - MIMIR_TENANT_ID=anonymous + command: >- + rules load /mimir-mixin/rules.yaml /mimir-mixin/alerts.yaml + \ No newline at end of file diff --git a/docker-compose/common/compose-include/minio.yaml b/docker-compose/common/compose-include/minio.yaml new file mode 100644 index 00000000..7050b838 --- /dev/null +++ b/docker-compose/common/compose-include/minio.yaml @@ -0,0 +1,35 @@ + +services: + minio: + image: minio/minio:RELEASE.2023-07-21T21-12-44Z + entrypoint: + - sh + - -euc + - | + mkdir -p /data/mimir-data /data/mimir-rules /data/mimir-alertmanager && \ + mkdir -p /data/loki-data /data/loki-rules && \ + mkdir -p /data/tempo-data && \ + mkdir -p /data/pyroscope-data && \ + minio server /data --console-address ':9001' + environment: + - MINIO_ROOT_USER=admin + - MINIO_ROOT_PASSWORD=admin_password + - MINIO_PROMETHEUS_AUTH_TYPE=public + - MINIO_UPDATE=off + # # Using /minio/v2/metrics is not supported yet with console. https://github.com/minio/console/issues/629#issuecomment-792055977 + # - MINIO_PROMETHEUS_URL="http://gateway:8080/prometheus" + # - MINIO_PROMETHEUS_JOB_ID="integrations/minio" + volumes: + - data-minio:/data:delegated + healthcheck: + test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] + interval: 10s + timeout: 5s + retries: 5 + ports: + - "9001:9001" + +volumes: + data-minio: + driver: local + diff --git a/docker-compose/microservices-mode/logs/docker-compose.yaml b/docker-compose/microservices-mode/logs/docker-compose.yaml index eb2f47dc..359ea44d 100644 --- a/docker-compose/microservices-mode/logs/docker-compose.yaml +++ b/docker-compose/microservices-mode/logs/docker-compose.yaml @@ -1,32 +1,17 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-logs.yaml + # Microservices mode (Logs) services: - - agent: + gateway: depends_on: distributor: condition: service_healthy - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/logs.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - microservices-mode-logs - - gateway: image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates @@ -42,8 +27,6 @@ services: - COMPACTOR_HOST=compactor ports: - "3100" - networks: - - microservices-mode-logs distributor: depends_on: @@ -64,7 +47,7 @@ services: deploy: replicas: 2 networks: - microservices-mode-logs: + default: aliases: - loki-memberlist @@ -83,7 +66,7 @@ services: deploy: replicas: 3 networks: - microservices-mode-logs: + default: aliases: - loki-memberlist @@ -97,8 +80,6 @@ services: command: - -config.file=/etc/loki.yaml - -target=query-frontend - networks: - - microservices-mode-logs query-scheduler: image: *lokiImage @@ -110,7 +91,7 @@ services: deploy: replicas: 2 networks: - microservices-mode-logs: + default: aliases: - loki-memberlist @@ -124,8 +105,6 @@ services: command: - -config.file=/etc/loki.yaml - -target=querier - networks: - - microservices-mode-logs ruler: depends_on: @@ -138,7 +117,7 @@ services: - -config.file=/etc/loki.yaml - -target=ruler networks: - microservices-mode-logs: + default: aliases: - loki-memberlist @@ -150,7 +129,7 @@ services: - -config.file=/etc/loki.yaml - -target=compactor networks: - microservices-mode-logs: + default: aliases: - loki-memberlist @@ -167,37 +146,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - microservices-mode-logs - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/loki-data /data/loki-rules && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - microservices-mode-logs - -networks: - microservices-mode-logs: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/microservices-mode/metrics/docker-compose.yaml b/docker-compose/microservices-mode/metrics/docker-compose.yaml index b34fe931..a44efe3e 100644 --- a/docker-compose/microservices-mode/metrics/docker-compose.yaml +++ b/docker-compose/microservices-mode/metrics/docker-compose.yaml @@ -1,32 +1,20 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-metrics.yaml + - ../../common/compose-include/load-mimir-rules.yaml + # Microservices mode (Metrics) services: - - agent: + gateway: depends_on: distributor: condition: service_healthy - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/metrics.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - microservices-mode-metrics - - gateway: + ruler: + condition: service_healthy image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates @@ -40,8 +28,6 @@ services: - COMPACTOR_HOST=compactor ports: - "8080" - networks: - - microservices-mode-metrics distributor: depends_on: @@ -63,7 +49,7 @@ services: deploy: replicas: 2 networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -75,8 +61,6 @@ services: command: - -config.file=/etc/mimir.yaml - -target=overrides-exporter - networks: - - microservices-mode-metrics querier: depends_on: @@ -93,7 +77,7 @@ services: deploy: replicas: 2 networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -109,8 +93,6 @@ services: - -config.file=/etc/mimir.yaml - -target=query-frontend - -log.level=error - networks: - - microservices-mode-metrics query-scheduler: image: *mimirImage @@ -127,8 +109,6 @@ services: retries: 5 deploy: replicas: 2 - networks: - - microservices-mode-metrics ruler: depends_on: @@ -147,7 +127,7 @@ services: timeout: 5s retries: 5 networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -163,7 +143,7 @@ services: - -config.file=/etc/mimir.yaml - -target=alertmanager networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -179,7 +159,7 @@ services: - -config.file=/etc/mimir.yaml - -target=compactor networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -199,7 +179,7 @@ services: deploy: replicas: 3 networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist @@ -215,26 +195,10 @@ services: - -config.file=/etc/mimir.yaml - -target=store-gateway networks: - microservices-mode-metrics: + default: aliases: - mimir-memberlist - load-mimir-rules: - depends_on: - ruler: - condition: service_healthy - image: grafana/mimirtool:2.9.0 - volumes: - - ../../../monitoring-mixins/mimir-mixin/deploy/rules.yaml:/mimir-mixin/rules.yaml - - ../../../monitoring-mixins/mimir-mixin/deploy/alerts.yaml:/mimir-mixin/alerts.yaml - environment: - - MIMIR_ADDRESS=http://ruler:8080 - - MIMIR_TENANT_ID=anonymous - command: >- - rules sync /mimir-mixin/rules.yaml /mimir-mixin/alerts.yaml - networks: - - microservices-mode-metrics - grafana: image: grafana/grafana:10.0.3 command: @@ -249,37 +213,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - microservices-mode-metrics - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/mimir-data /data/mimir-rules /data/mimir-alertmanager && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - microservices-mode-metrics - -networks: - microservices-mode-metrics: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/microservices-mode/traces/docker-compose.yaml b/docker-compose/microservices-mode/traces/docker-compose.yaml index f75c5eff..1b1a3941 100644 --- a/docker-compose/microservices-mode/traces/docker-compose.yaml +++ b/docker-compose/microservices-mode/traces/docker-compose.yaml @@ -1,35 +1,17 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-traces.yaml + # Microservices mode (Traces) services: - - agent: - depends_on: - distributor: - condition: service_healthy - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/traces.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - microservices-mode-traces - gateway: depends_on: distributor: - condition: service_started + condition: service_healthy image: nginxinc/nginx-unprivileged:1.25-alpine restart: always volumes: @@ -44,8 +26,6 @@ services: ports: - "3200" - "4317" - networks: - - microservices-mode-traces distributor: depends_on: @@ -63,8 +43,6 @@ services: interval: 10s timeout: 5s retries: 5 - networks: - - microservices-mode-traces ingester: depends_on: @@ -82,7 +60,7 @@ services: deploy: replicas: 3 networks: - microservices-mode-traces: + default: aliases: - tempo-memberlist @@ -97,8 +75,6 @@ services: - -config.file=/etc/tempo.yaml - -target=query-frontend - -log.level=warn - networks: - - microservices-mode-traces querier: depends_on: @@ -113,8 +89,6 @@ services: - -config.file=/etc/tempo.yaml - -target=querier - -log.level=warn - networks: - - microservices-mode-traces compactor: depends_on: @@ -127,8 +101,6 @@ services: - -config.file=/etc/tempo.yaml - -target=compactor - -log.level=error - networks: - - microservices-mode-traces grafana: depends_on: @@ -149,37 +121,3 @@ services: - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=cluster:docker-compose,namespace:monitoring ports: - "3000:3000" - networks: - - microservices-mode-traces - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/tempo-data && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - microservices-mode-traces - -networks: - microservices-mode-traces: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml b/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml index 962c01c4..9ac8d339 100644 --- a/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml +++ b/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml @@ -1,9 +1,12 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include.yaml # Monolithic mode (Metrics + Logs + Traces + Profiles) services: - agent: depends_on: tempo: diff --git a/docker-compose/monolithic-mode/logs/docker-compose.yaml b/docker-compose/monolithic-mode/logs/docker-compose.yaml index c2b28df7..704ebc43 100644 --- a/docker-compose/monolithic-mode/logs/docker-compose.yaml +++ b/docker-compose/monolithic-mode/logs/docker-compose.yaml @@ -1,49 +1,32 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-logs.yaml + # Monolithic mode (Logs) services: - - agent: + gateway: depends_on: loki: condition: service_healthy - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/logs.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - monolithic-mode-logs - - gateway: image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates - ../../common/config/loki/gateway.conf.template:/etc/nginx/templates/gateway_loki.conf.template environment: - - NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx - - DISTRIBUTOR_HOST=loki - - INGESTER_HOST=loki - - RULER_HOST=loki - - QUERY_FRONTEND_HOST=loki - - QUERY_SCHEDULER_HOST=loki - - QUERIER_HOST=loki - - COMPACTOR_HOST=loki + - NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx + - DISTRIBUTOR_HOST=loki + - INGESTER_HOST=loki + - RULER_HOST=loki + - QUERY_FRONTEND_HOST=loki + - QUERY_SCHEDULER_HOST=loki + - QUERIER_HOST=loki + - COMPACTOR_HOST=loki ports: - - "3100" - networks: - - monolithic-mode-logs + - "3100" loki: depends_on: @@ -68,7 +51,7 @@ services: deploy: replicas: 3 networks: - monolithic-mode-logs: + default: aliases: - loki-memberlist @@ -85,37 +68,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - monolithic-mode-logs - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/loki-data /data/loki-rules && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - monolithic-mode-logs - -networks: - monolithic-mode-logs: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/monolithic-mode/metrics/docker-compose.yaml b/docker-compose/monolithic-mode/metrics/docker-compose.yaml index 186e848b..b0f8d6e3 100644 --- a/docker-compose/monolithic-mode/metrics/docker-compose.yaml +++ b/docker-compose/monolithic-mode/metrics/docker-compose.yaml @@ -1,32 +1,18 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-metrics.yaml + - ../../common/compose-include/load-mimir-rules.yaml + # Monolithic mode (Metrics) services: - - agent: + gateway: depends_on: mimir: - condition: service_started - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/metrics.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - monolithic-mode-metrics - - gateway: + condition: service_healthy image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates @@ -40,8 +26,6 @@ services: - COMPACTOR_HOST=mimir ports: - "8080" - networks: - - monolithic-mode-metrics mimir: depends_on: @@ -53,7 +37,7 @@ services: - -target=all - -log.level=error volumes: - - ../../common/config/mimir/monolithic-mode-metrics.yaml:/etc/mimir.yaml # Note: Mimir use monolithic-mode-metrics.yaml + - ../../common/config/mimir/monolithic-mode-metrics.yaml:/etc/mimir.yaml # Note: Mimir use monolithic-mode.yaml ports: - "8080" healthcheck: @@ -64,29 +48,12 @@ services: # Horizontally scale up support(Monolithic mode) # https://grafana.com/docs/mimir/latest/references/architecture/deployment-modes/#monolithic-mode deploy: - replicas: 3 + replicas: 2 networks: - monolithic-mode-metrics: + default: aliases: - mimir-memberlist - # use mimirtool load rules instead of prometheus - load-mimir-rules: - depends_on: - mimir: - condition: service_healthy - image: grafana/mimirtool:2.9.0 - volumes: - - ../../../monitoring-mixins/mimir-mixin/deploy/rules.yaml:/mimir-mixin/rules.yaml - - ../../../monitoring-mixins/mimir-mixin/deploy/alerts.yaml:/mimir-mixin/alerts.yaml - environment: - - MIMIR_ADDRESS=http://mimir:8080 - - MIMIR_TENANT_ID=anonymous - command: >- - rules sync /mimir-mixin/rules.yaml /mimir-mixin/alerts.yaml - networks: - - monolithic-mode-metrics - grafana: image: grafana/grafana:10.0.3 command: @@ -101,40 +68,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - monolithic-mode-metrics - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/mimir-data /data/mimir-rules /data/mimir-alertmanager && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - # # Using /minio/v2/metrics is not supported yet with console. https://github.com/minio/console/issues/629#issuecomment-792055977 - # - MINIO_PROMETHEUS_URL="http://mimir:8080/prometheus" - # - MINIO_PROMETHEUS_JOB_ID="integrations/minio" - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - monolithic-mode-metrics - -networks: - monolithic-mode-metrics: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/monolithic-mode/traces/config/tempo/scalable-single-binary.yaml b/docker-compose/monolithic-mode/traces/config/tempo/scalable-single-binary.yaml index 17a8d690..86991459 100644 --- a/docker-compose/monolithic-mode/traces/config/tempo/scalable-single-binary.yaml +++ b/docker-compose/monolithic-mode/traces/config/tempo/scalable-single-binary.yaml @@ -27,7 +27,7 @@ compactor: querier: frontend_worker: - frontend_address: tempo:9095 + frontend_address: tempo-memberlist:9095 storage: trace: diff --git a/docker-compose/monolithic-mode/traces/docker-compose.yaml b/docker-compose/monolithic-mode/traces/docker-compose.yaml index 362e7aab..9450f560 100644 --- a/docker-compose/monolithic-mode/traces/docker-compose.yaml +++ b/docker-compose/monolithic-mode/traces/docker-compose.yaml @@ -1,36 +1,17 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-traces.yaml # Monolithic mode (Traces) services: - - agent: - depends_on: - tempo: - condition: service_started - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/traces.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - monolithic-mode-traces - gateway: depends_on: tempo: - condition: service_started + condition: service_healthy image: nginxinc/nginx-unprivileged:1.25-alpine restart: always volumes: @@ -45,8 +26,6 @@ services: ports: - "3200" - "4317" - networks: - - monolithic-mode-traces tempo: depends_on: @@ -60,6 +39,11 @@ services: - -config.file=/etc/tempo.yaml - -target=scalable-single-binary - -log.level=error + healthcheck: + test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3200/ready || exit 1" ] + interval: 10s + timeout: 5s + retries: 5 ports: - "3200" # Horizontally scale up support(Monolithic mode) @@ -67,11 +51,14 @@ services: deploy: replicas: 2 networks: - monolithic-mode-traces: + default: aliases: - tempo-memberlist grafana: + depends_on: + minio: + condition: service_started image: grafana/grafana:10.0.3 command: - --config=/etc/grafana-config/grafana.ini @@ -87,37 +74,3 @@ services: - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=cluster:docker-compose,namespace:monitoring ports: - "3000:3000" - networks: - - monolithic-mode-traces - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/tempo-data && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - monolithic-mode-traces - -networks: - monolithic-mode-traces: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/read-write-mode/logs/docker-compose.yaml b/docker-compose/read-write-mode/logs/docker-compose.yaml index d047832b..fffc7006 100644 --- a/docker-compose/read-write-mode/logs/docker-compose.yaml +++ b/docker-compose/read-write-mode/logs/docker-compose.yaml @@ -1,38 +1,17 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-logs.yaml # Read-Write mode (Logs) services: - - agent: + gateway: depends_on: loki-write: condition: service_healthy - image: grafana/agent:v0.35.3 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/logs.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - healthcheck: - test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:12345/ready || exit 1" ] - interval: 10s - timeout: 5s - retries: 10 - ports: - - "12345:12345" - networks: - - read-write-mode-logs - - gateway: image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates @@ -48,9 +27,6 @@ services: - COMPACTOR_HOST=loki-backend ports: - "3100" - networks: - - read-write-mode-logs - loki-read: depends_on: @@ -72,7 +48,7 @@ services: deploy: replicas: 2 networks: - read-write-mode-logs: + default: aliases: - loki-memberlist @@ -96,7 +72,7 @@ services: deploy: replicas: 3 networks: - read-write-mode-logs: + default: aliases: - loki-memberlist @@ -118,8 +94,6 @@ services: interval: 10s timeout: 5s retries: 5 - networks: - - read-write-mode-logs grafana: image: grafana/grafana:10.0.3 @@ -134,37 +108,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - read-write-mode-logs - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - entrypoint: - - sh - - -euc - - | - mkdir -p /data/loki-data /data/loki-rules && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - read-write-mode-logs - -networks: - read-write-mode-logs: - -volumes: - data-minio: - driver: local diff --git a/docker-compose/read-write-mode/metrics/docker-compose.yaml b/docker-compose/read-write-mode/metrics/docker-compose.yaml index 649fe3aa..60fd8f55 100644 --- a/docker-compose/read-write-mode/metrics/docker-compose.yaml +++ b/docker-compose/read-write-mode/metrics/docker-compose.yaml @@ -1,32 +1,18 @@ version: '3.9' +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +include: + - ../../common/compose-include/minio.yaml + - ../../common/compose-include/agent-collect-metrics.yaml + - ../../common/compose-include/load-mimir-rules.yaml + # Read-Write mode (Metrics) services: - - agent: + gateway: depends_on: mimir-write: condition: service_started - image: grafana/agent:v0.35.2 - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/metrics.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --disable-reporting=true - environment: - - AGENT_MODE=flow - - AGENT_CONFIG_FOLDER=/etc/agent-config - ports: - - "12345:12345" - networks: - - read-write-mode-metrics - - gateway: image: nginxinc/nginx-unprivileged:1.25-alpine volumes: - ../../common/config/nginx:/etc/nginx/templates @@ -40,8 +26,6 @@ services: - COMPACTOR_HOST=mimir-backend ports: - "8080" - networks: - - read-write-mode-metrics mimir-backend: depends_on: @@ -61,8 +45,6 @@ services: retries: 5 deploy: replicas: 2 - networks: - - read-write-mode-metrics mimir-read: depends_on: @@ -77,8 +59,7 @@ services: - ./config/mimir:/etc/mimir deploy: replicas: 2 - networks: - - read-write-mode-metrics + mimir-write: depends_on: @@ -101,26 +82,10 @@ services: deploy: replicas: 3 networks: - read-write-mode-metrics: + default: aliases: - mimir-memberlist - load-mimir-rules: - depends_on: - mimir-backend: - condition: service_healthy - image: grafana/mimirtool:2.9.0 - volumes: - - ../../../monitoring-mixins/mimir-mixin/deploy/rules.yaml:/mimir-mixin/rules.yaml - - ../../../monitoring-mixins/mimir-mixin/deploy/alerts.yaml:/mimir-mixin/alerts.yaml - environment: - - MIMIR_ADDRESS=http://mimir-backend:8080 - - MIMIR_TENANT_ID=anonymous - command: >- - rules sync /mimir-mixin/rules.yaml /mimir-mixin/alerts.yaml - networks: - - read-write-mode-metrics - grafana: image: grafana/grafana:10.0.3 hostname: grafana @@ -136,38 +101,3 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password} ports: - "3000:3000" - networks: - - read-write-mode-metrics - - minio: - image: minio/minio:RELEASE.2023-07-21T21-12-44Z - hostname: minio - entrypoint: - - sh - - -euc - - | - mkdir -p /data/mimir-data /data/mimir-rules /data/mimir-alertmanager && \ - minio server /data --console-address ':9001' - environment: - - MINIO_ROOT_USER=admin - - MINIO_ROOT_PASSWORD=admin_password - - MINIO_PROMETHEUS_AUTH_TYPE=public - - MINIO_UPDATE=off - volumes: - - data-minio:/data:delegated - healthcheck: - test: ["CMD", "curl","-f","http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 5s - retries: 5 - ports: - - "9001:9001" - networks: - - read-write-mode-metrics - -networks: - read-write-mode-metrics: - -volumes: - data-minio: - driver: local