Skip to content

Commit

Permalink
[Traces] use include feature
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Aug 11, 2023
1 parent b7ff543 commit a2a97eb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 133 deletions.
27 changes: 27 additions & 0 deletions docker-compose/common/compose-include/agent-collect-traces.yaml
Original file line number Diff line number Diff line change
@@ -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"
78 changes: 8 additions & 70 deletions docker-compose/microservices-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -44,8 +26,6 @@ services:
ports:
- "3200"
- "4317"
networks:
- microservices-mode-traces

distributor:
depends_on:
Expand All @@ -63,8 +43,6 @@ services:
interval: 10s
timeout: 5s
retries: 5
networks:
- microservices-mode-traces

ingester:
depends_on:
Expand All @@ -82,7 +60,7 @@ services:
deploy:
replicas: 3
networks:
microservices-mode-traces:
default:
aliases:
- tempo-memberlist

Expand All @@ -97,8 +75,6 @@ services:
- -config.file=/etc/tempo.yaml
- -target=query-frontend
- -log.level=warn
networks:
- microservices-mode-traces

querier:
depends_on:
Expand All @@ -113,8 +89,6 @@ services:
- -config.file=/etc/tempo.yaml
- -target=querier
- -log.level=warn
networks:
- microservices-mode-traces

compactor:
depends_on:
Expand All @@ -127,8 +101,6 @@ services:
- -config.file=/etc/tempo.yaml
- -target=compactor
- -log.level=error
networks:
- microservices-mode-traces

grafana:
depends_on:
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ compactor:

querier:
frontend_worker:
frontend_address: tempo:9095
frontend_address: tempo-memberlist:9095

storage:
trace:
Expand Down
77 changes: 15 additions & 62 deletions docker-compose/monolithic-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -45,8 +26,6 @@ services:
ports:
- "3200"
- "4317"
networks:
- monolithic-mode-traces

tempo:
depends_on:
Expand All @@ -60,18 +39,26 @@ 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)
# https://grafana.com/docs/tempo/latest/setup/deployment/#scaling-monolithic-mode
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
Expand All @@ -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

0 comments on commit a2a97eb

Please sign in to comment.