Skip to content

Commit

Permalink
Revert "remove common agent-collect-metrics.yaml"
Browse files Browse the repository at this point in the history
This reverts commit 211c11c.
  • Loading branch information
qclaogui committed Mar 24, 2024
1 parent 211c11c commit a9bdfb8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 114 deletions.
40 changes: 40 additions & 0 deletions docker-compose/common/compose-include/agent-collect-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

services:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
depends_on:
gateway:
condition: service_healthy
image: ${AGENT_IMAGE:-docker.io/grafana/agent:latest}
volumes:
- ../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: 10s
timeout: 5s
retries: 10
ports:
- "12345:12345"
# scale up support
deploy:
replicas: 1
networks:
default:
aliases:
- grafana-agent-cluster
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
services:
load-rules-to-mimir:
# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
labels:
metrics.agent.grafana.com/scrape: false
image: ${MIMIRTOOL_IMAGE:-docker.io/grafana/mimirtool:latest}
volumes:
- ../../../monitoring-mixins/crontab:/etc/crontabs/root
Expand Down
38 changes: 1 addition & 37 deletions docker-compose/microservices-mode/metrics/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,10 @@ version: '3.9'
include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/agent-collect-metrics.yaml
- path: ../../common/compose-include/load-rules-to-mimir.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:latest}
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: 10s
timeout: 5s
retries: 5
ports:
- "12345:12345"
networks:
default:
aliases:
- grafana-agent-cluster

gateway:
# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
labels:
Expand Down
39 changes: 2 additions & 37 deletions docker-compose/monolithic-mode/metrics/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,12 @@ version: '3.9'
include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/agent-collect-metrics.yaml
- path: ../../common/compose-include/load-rules-to-mimir.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:latest}
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: 10s
timeout: 5s
retries: 5
ports:
- "12345:12345"
networks:
default:
aliases:
- grafana-agent-cluster

gateway:
# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
labels:
metrics.agent.grafana.com/scrape: false
depends_on:
Expand Down
39 changes: 2 additions & 37 deletions docker-compose/read-write-mode/metrics/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,12 @@ version: '3.9'
include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/agent-collect-metrics.yaml
- path: ../../common/compose-include/load-rules-to-mimir.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:latest}
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: 10s
timeout: 5s
retries: 5
ports:
- "12345:12345"
networks:
default:
aliases:
- grafana-agent-cluster

gateway:
# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
labels:
- metrics.agent.grafana.com/scrape=false
depends_on:
Expand Down

0 comments on commit a9bdfb8

Please sign in to comment.