Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
qclaogui committed Apr 6, 2024
1 parent c986b1b commit 80eb44d
Showing 8 changed files with 50 additions and 246 deletions.
6 changes: 2 additions & 4 deletions docker-compose/common/compose-include/minio.yaml
Original file line number Diff line number Diff line change
@@ -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:
66 changes: 4 additions & 62 deletions docker-compose/monolithic-mode/logs/compose.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docker-compose/monolithic-mode/logs/grafana-agent.override.yaml
Original file line number Diff line number Diff line change
@@ -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
78 changes: 2 additions & 76 deletions docker-compose/monolithic-mode/metrics/compose.yaml
Original file line number Diff line number Diff line change
@@ -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
72 changes: 4 additions & 68 deletions docker-compose/monolithic-mode/profiles/compose.yaml
Original file line number Diff line number Diff line change
@@ -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
# # - [email protected]: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:
Original file line number Diff line number Diff line change
@@ -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
39 changes: 3 additions & 36 deletions docker-compose/monolithic-mode/traces/compose.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docker-compose/monolithic-mode/traces/grafana-agent.override.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 80eb44d

Please sign in to comment.