Skip to content

Commit

Permalink
Update the All-in-One to Prepare for External Compose Inclusion
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Mar 23, 2024
1 parent 1bd3590 commit 7dd92f5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 38 deletions.
28 changes: 0 additions & 28 deletions docker-compose/common/compose-include/agent-collect-all.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose/common/config/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AGENT_IMAGE=grafana/agent:v0.40.3
LOKI_IMAGE=grafana/loki:2.9.6
GRAFANA_IMAGE=grafana/grafana:10.4.1
TEMPO_IMAGE=grafana/tempo:2.4.0
TEMPO_IMAGE=grafana/tempo:2.4.1
MIMIR_IMAGE=grafana/mimir:2.11.0
MIMIRTOOL_IMAGE=grafana/mimirtool:2.11.0
PYROSCOPE_IMAGE=grafana/pyroscope:1.5.0
Expand Down
64 changes: 55 additions & 9 deletions docker-compose/monolithic-mode/all-in-one/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ version: '3.9'
include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/agent-collect-all.yaml
- path: ../../common/compose-include/load-rules-to-mimir.yaml

# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
x-labels: &profiles-labels
Expand All @@ -25,6 +23,33 @@ x-environment: &jaeger-environment
JAEGER_SAMPLER_PARAM: 1

services:
grafana-agent:
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/monolithic-mode-all.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
# expose 12345 port so we can directly access grafana-agent inside container
ports:
- "12345:12345"

gateway:
labels:
metrics.agent.grafana.com/scrape: false
Expand All @@ -37,7 +62,7 @@ services:
condition: service_healthy
pyroscope:
condition: service_healthy
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:latest}
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:1.25-alpine}
restart: always
volumes:
- ../../common/config/nginx/10-default-lgtmp.envsh:/docker-entrypoint.d/10-default-lgtmp.envsh
Expand All @@ -53,15 +78,14 @@ services:
retries: 10

loki:
# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
labels:
<<: *profiles-labels
profiles.agent.grafana.com/service_name: loki
logs.agent.grafana.com/log-format: json
depends_on:
minio:
condition: service_healthy
image: ${LOKI_IMAGE:-docker.io/grafana/loki:latest}
image: ${LOKI_IMAGE:-docker.io/grafana/loki:2.9.6}
volumes:
- ../../common/config/loki:/etc/loki
command:
Expand Down Expand Up @@ -95,7 +119,7 @@ services:
condition: service_healthy
mimir:
condition: service_healthy
image: ${TEMPO_IMAGE:-docker.io/grafana/tempo:latest}
image: ${TEMPO_IMAGE:-docker.io/grafana/tempo:2.4.1}
volumes:
- ../../common/config/tempo:/etc/tempo
command:
Expand All @@ -122,7 +146,7 @@ services:
depends_on:
minio:
condition: service_healthy
image: ${MIMIR_IMAGE:-docker.io/grafana/mimir:latest}
image: ${MIMIR_IMAGE:-docker.io/grafana/mimir:2.11.0}
volumes:
- ../../common/config/mimir:/etc/mimir
command:
Expand All @@ -146,13 +170,35 @@ services:
aliases:
- mimir-memberlist

load-rules-to-mimir:
depends_on:
gateway:
condition: service_healthy
image: ${MIMIRTOOL_IMAGE:-docker.io/grafana/mimirtool:2.11.0}
volumes:
- ../../../monitoring-mixins/agent-flow-mixin/deploy/agent-flow-mixin-alerts.yaml:/agent-flow-mixin-alerts.yaml
- ../../../monitoring-mixins/loki-mixin/deploy/loki-mixin-rules.yaml:/loki-mixin-rules.yaml
- ../../../monitoring-mixins/loki-mixin/deploy/loki-mixin-alerts.yaml:/loki-mixin-alerts.yaml
- ../../../monitoring-mixins/memcached-mixin/deploy/memcached-mixin-alerts.yaml:/memcached-mixin-alerts.yaml
- ../../../monitoring-mixins/mimir-mixin/deploy/mimir-mixin-rules.yaml:/mimir-mixin-rules.yaml
- ../../../monitoring-mixins/mimir-mixin/deploy/mimir-mixin-alerts.yaml:/mimir-mixin-alerts.yaml
- ../../../monitoring-mixins/pyroscope-mixin/deploy/pyroscope-mixin-rules.yaml:/pyroscope-mixin-rules.yaml
# - ../../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-rules.yaml:/tempo-mixin-rules.yaml
# - ../../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-alerts.yaml:/tempo-mixin-alerts.yaml
environment:
- MIMIR_ADDRESS=http://gateway:8080
- MIMIR_TENANT_ID=anonymous
command: >-
rules load agent-flow-mixin-alerts.yaml /loki-mixin-rules.yaml /loki-mixin-alerts.yaml /memcached-mixin-alerts.yaml /mimir-mixin-rules.yaml /mimir-mixin-alerts.yaml /pyroscope-mixin-rules.yaml
pyroscope:
labels:
- logs.agent.grafana.com/log-format=logfmt
depends_on:
minio:
condition: service_healthy
image: ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:latest}
image: ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:1.5.0}
container_name: pyroscope
volumes:
- ../../common/config/pyroscope/monolithic-mode-profiles.yaml:/etc/config.yaml
Expand All @@ -177,7 +223,7 @@ services:
profiles.agent.grafana.com/service_name: grafana
profiles.agent.grafana.com/port: 6060
logs.agent.grafana.com/log-format: logfmt
image: ${GRAFANA_IMAGE:-docker.io/grafana/grafana:latest}
image: ${GRAFANA_IMAGE:-docker.io/grafana/grafana:10.4.1}
command:
- --config=/etc/grafana-config/grafana.ini
volumes:
Expand Down

0 comments on commit 7dd92f5

Please sign in to comment.