diff --git a/docker-compose/common/compose-include/minio.yaml b/docker-compose/common/compose-include/minio.yaml index dc0623ef..6a2c3a5b 100644 --- a/docker-compose/common/compose-include/minio.yaml +++ b/docker-compose/common/compose-include/minio.yaml @@ -29,7 +29,7 @@ services: # - MINIO_PROMETHEUS_URL="http://gateway:8080/prometheus" # - MINIO_PROMETHEUS_JOB_ID="minio-job" volumes: - - data-minio:/data:delegated + - minio_data:/data:delegated healthcheck: test: ["CMD-SHELL", "mc ready local"] interval: 5s @@ -39,6 +39,4 @@ services: - "9001:9001" volumes: - data-minio: - driver: local - + minio_data: diff --git a/docker-compose/monolithic-mode/logs/compose.yaml b/docker-compose/monolithic-mode/logs/compose.yaml index 76df1839..0b7d02a3 100644 --- a/docker-compose/monolithic-mode/logs/compose.yaml +++ b/docker-compose/monolithic-mode/logs/compose.yaml @@ -10,52 +10,18 @@ version: '3.9' include: - path: ../../common/compose-include/minio.yaml - path: ../../common/compose-include/memcached.yaml + - path: ../../common/compose-include/loki.yaml - path: - ../../common/compose-include/mimir.yaml - ./mimirtool.override.yaml - path: - ../../common/compose-include/grafana.yaml - ./grafana.override.yaml + - path: + - ../../common/compose-include/grafana-agent.yaml + - ./grafana-agent.override.yaml services: - grafana-agent: - # https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md - labels: - logs.agent.grafana.com/log-format: logfmt - depends_on: { gateway: { condition: service_healthy } } - image: ${AGENT_IMAGE:-docker.io/grafana/agent:v0.40.3} - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock:ro - - /:/rootfs:ro - - /sys:/sys:ro - - /var/lib/docker:/var/lib/docker:ro - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/logs.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --cluster.join-addresses=grafana-agent-cluster:12345 - - --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: 5s - timeout: 2s - retries: 10 - ports: - - "12345:12345" - # scale up support - deploy: - replicas: 1 - networks: - default: - aliases: - - grafana-agent-cluster - gateway: labels: metrics.agent.grafana.com/scrape: false @@ -72,27 +38,3 @@ services: interval: 5s timeout: 2s retries: 10 - - loki: - labels: - - logs.agent.grafana.com/log-format=json - depends_on: { minio: { condition: service_healthy } } - image: ${LOKI_IMAGE:-docker.io/grafana/loki:2.9.6} - volumes: - - ../../common/config/loki:/etc/loki - command: - - -config.file=/etc/loki/monolithic-mode-logs.yaml - - -target=all - - -config.expand-env=true - healthcheck: - test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ] - interval: 5s - timeout: 2s - retries: 10 - # expose 33100 port so we can directly access loki inside container - ports: - - "33100:3100" - networks: - default: - aliases: - - loki-memberlist diff --git a/docker-compose/monolithic-mode/logs/grafana-agent.override.yaml b/docker-compose/monolithic-mode/logs/grafana-agent.override.yaml new file mode 100644 index 00000000..276c8724 --- /dev/null +++ b/docker-compose/monolithic-mode/logs/grafana-agent.override.yaml @@ -0,0 +1,12 @@ + +services: + # override included service grafana-agent entrypoint + grafana-agent: + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/logs.river # Note: Agent use logs.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --cluster.join-addresses=grafana-agent-cluster:12345 + - --disable-reporting=true diff --git a/docker-compose/monolithic-mode/metrics/compose.yaml b/docker-compose/monolithic-mode/metrics/compose.yaml index d21bfd4e..64f91e10 100644 --- a/docker-compose/monolithic-mode/metrics/compose.yaml +++ b/docker-compose/monolithic-mode/metrics/compose.yaml @@ -11,46 +11,10 @@ include: - path: ../../common/compose-include/minio.yaml - path: ../../common/compose-include/memcached.yaml - path: ../../common/compose-include/grafana.yaml + - path: ../../common/compose-include/mimir.yaml + - path: ../../common/compose-include/grafana-agent.yaml services: - grafana-agent: - # https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md - labels: - logs.agent.grafana.com/log-format: logfmt - depends_on: { gateway: { condition: service_healthy } } - image: ${AGENT_IMAGE:-docker.io/grafana/agent:v0.40.3} - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock:ro - - /:/rootfs:ro - - /sys:/sys:ro - - /var/lib/docker:/var/lib/docker:ro - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/metrics.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --cluster.join-addresses=grafana-agent-cluster:12345 - - --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: 5s - timeout: 2s - retries: 10 - ports: - - "12345:12345" - # scale up support - deploy: - replicas: 1 - networks: - default: - aliases: - - grafana-agent-cluster - gateway: labels: metrics.agent.grafana.com/scrape: false @@ -65,41 +29,3 @@ services: interval: 5s timeout: 2s retries: 10 - - mimir: - depends_on: { minio: { condition: service_healthy } } - image: ${MIMIR_IMAGE:-docker.io/grafana/mimir:2.12.0} - volumes: - - ../../common/config/mimir:/etc/mimir - command: - - -config.file=/etc/mimir/monolithic-mode-metrics.yaml - - -target=all - - -config.expand-env=true - healthcheck: - test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ] - interval: 5s - timeout: 2s - retries: 10 - # expose 38080 port so we can directly access mimir inside container - ports: - - "38080:8080" - networks: - default: - aliases: - - mimir-memberlist - - mimirtool: - labels: - metrics.agent.grafana.com/scrape: false - image: ${MIMIRTOOL_IMAGE:-docker.io/grafana/mimirtool:2.11.0} - volumes: - - ../../../monitoring-mixins/crontab:/etc/crontabs/root - - ../../../monitoring-mixins/agent-flow-mixin/deploy/agent-flow-mixin-alerts.yaml:/rules/agent-flow-mixin-alerts.yaml - - ../../../monitoring-mixins/memcached-mixin/deploy/memcached-mixin-alerts.yaml:/rules/memcached-mixin-alerts.yaml - - ../../../monitoring-mixins/mimir-mixin/deploy/mimir-mixin-rules.yaml:/rules/mimir-mixin-rules.yaml - - ../../../monitoring-mixins/mimir-mixin/deploy/mimir-mixin-alerts.yaml:/rules/mimir-mixin-alerts.yaml - environment: - - MIMIR_ADDRESS=http://gateway:8080 - - MIMIR_TENANT_ID=anonymous - entrypoint: crond -f - restart: always diff --git a/docker-compose/monolithic-mode/profiles/compose.yaml b/docker-compose/monolithic-mode/profiles/compose.yaml index 4273fe78..73bb218b 100644 --- a/docker-compose/monolithic-mode/profiles/compose.yaml +++ b/docker-compose/monolithic-mode/profiles/compose.yaml @@ -10,58 +10,18 @@ version: '3.9' include: - path: ../../common/compose-include/minio.yaml - path: ../../common/compose-include/memcached.yaml + - path: ../../common/compose-include/pyroscope.yaml - path: - ../../common/compose-include/mimir.yaml - ./mimirtool.override.yaml - path: - ../../common/compose-include/grafana.yaml - ./grafana.override.yaml - - # # for git remote - # # https://github.com/docker/compose/pull/10811 - # # https://docs.docker.com/engine/reference/commandline/build/#git-repositories - # # - git@github.com:ndeloof/test.git - # - https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/common/compose-include/minio.yaml + - path: + - ../../common/compose-include/grafana-agent.yaml + - ./grafana-agent.override.yaml services: - grafana-agent: - # https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md - labels: - logs.agent.grafana.com/log-format: logfmt - depends_on: { gateway: { condition: service_healthy } } - image: ${AGENT_IMAGE:-docker.io/grafana/agent:v0.40.3} - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock:ro - - /:/rootfs:ro - - /sys:/sys:ro - - /var/lib/docker:/var/lib/docker:ro - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/profiles.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --cluster.join-addresses=grafana-agent-cluster:12345 - - --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: 5s - timeout: 2s - retries: 10 - ports: - - "12345:12345" - # scale up support - deploy: - replicas: 1 - networks: - default: - aliases: - - grafana-agent-cluster - gateway: labels: metrics.agent.grafana.com/scrape: false @@ -77,27 +37,3 @@ services: interval: 5s timeout: 2s retries: 10 - - pyroscope: - depends_on: { minio: { condition: service_healthy } } - image: ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:1.5.0} - container_name: pyroscope - volumes: - - ../../common/config/pyroscope:/etc/pyroscope - - pyroscope_data:/data - command: - - -config.file=/etc/pyroscope/monolithic-mode-profiles.yaml - - -target=all - - -config.expand-env=true - # - -runtime-config.file=/etc/pyroscope/overrides.yaml - healthcheck: - test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ready || exit 1" ] - interval: 5s - timeout: 2s - retries: 10 - # expose 34040 port so we can directly access pyroscope inside container - ports: - - "34040:4040" - -volumes: - pyroscope_data: diff --git a/docker-compose/monolithic-mode/profiles/grafana-agent.override.yaml b/docker-compose/monolithic-mode/profiles/grafana-agent.override.yaml new file mode 100644 index 00000000..ea4a9d12 --- /dev/null +++ b/docker-compose/monolithic-mode/profiles/grafana-agent.override.yaml @@ -0,0 +1,11 @@ + +services: + grafana-agent: # override included service grafana-agent entrypoint + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/profiles.river # Note: Agent use profiles.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --cluster.join-addresses=grafana-agent-cluster:12345 + - --disable-reporting=true diff --git a/docker-compose/monolithic-mode/traces/compose.yaml b/docker-compose/monolithic-mode/traces/compose.yaml index 63f7074c..08dc23d5 100644 --- a/docker-compose/monolithic-mode/traces/compose.yaml +++ b/docker-compose/monolithic-mode/traces/compose.yaml @@ -17,6 +17,9 @@ include: - path: - ../../common/compose-include/grafana.yaml - ./grafana.override.yaml + - path: + - ../../common/compose-include/grafana-agent.yaml + - ./grafana-agent.override.yaml x-environment: &jaeger-environment JAEGER_AGENT_HOST: grafana-agent @@ -32,42 +35,6 @@ x-healthcheck: &status-healthcheck retries: 10 services: - grafana-agent: - # https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md - labels: - logs.agent.grafana.com/log-format: logfmt - depends_on: { gateway: { condition: service_healthy } } - image: ${AGENT_IMAGE:-docker.io/grafana/agent:v0.40.3} - volumes: - - ../../common/config/agent-flow:/etc/agent-config - - /var/run/docker.sock:/var/run/docker.sock:ro - - /:/rootfs:ro - - /sys:/sys:ro - - /var/lib/docker:/var/lib/docker:ro - entrypoint: - - /bin/grafana-agent - - run - - /etc/agent-config/traces.river - - --server.http.listen-addr=0.0.0.0:12345 - - --cluster.enabled=true - - --cluster.join-addresses=grafana-agent-cluster:12345 - - --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" ] - <<: *status-healthcheck - ports: - - "12345:12345" - # scale up support - deploy: - replicas: 1 - networks: - default: - aliases: - - grafana-agent-cluster - gateway: labels: metrics.agent.grafana.com/scrape: false diff --git a/docker-compose/monolithic-mode/traces/grafana-agent.override.yaml b/docker-compose/monolithic-mode/traces/grafana-agent.override.yaml new file mode 100644 index 00000000..476b5494 --- /dev/null +++ b/docker-compose/monolithic-mode/traces/grafana-agent.override.yaml @@ -0,0 +1,12 @@ + +services: + # override included service grafana-agent entrypoint + grafana-agent: + entrypoint: + - /bin/grafana-agent + - run + - /etc/agent-config/traces.river # Note: Agent use traces.river + - --server.http.listen-addr=0.0.0.0:12345 + - --cluster.enabled=true + - --cluster.join-addresses=grafana-agent-cluster:12345 + - --disable-reporting=true