diff --git a/examples/meta-monitoring/README.md b/examples/meta-monitoring/README.md new file mode 100644 index 00000000..6a530aa7 --- /dev/null +++ b/examples/meta-monitoring/README.md @@ -0,0 +1,70 @@ +# LGTMP Meta Monitoring + +This example enabled local LGTMP Stack meta monitoring by setting `loki` `tempo` `mimir` and `pyroscope` 's lables `metrics.grafana.com/scrape: true`. + +## Docker compose + +`compose.yaml`: + +```yaml +include: +# # use git remote +# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/all-in-one/compose.yaml + +# # use local path +- path: ../../docker-compose/monolithic-mode/all-in-one/compose.yaml + +``` + +`compose.override.yaml`: + +```yaml +services: + loki: + labels: + metrics.grafana.com/scrape: true + tempo: + labels: + metrics.grafana.com/scrape: true + mimir: + labels: + metrics.grafana.com/scrape: true + pyroscope: + labels: + metrics.grafana.com/scrape: true + + # override included service grafana for dashboards pre-provisioning + grafana: + volumes: + - ../../monitoring-mixins/loki-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/loki-mixin + - ../../monitoring-mixins/tempo-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/tempo-mixin + - ../../monitoring-mixins/mimir-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/mimir-mixin + - ../../monitoring-mixins/pyroscope-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/pyroscope-mixin + + # override included service mimirtool for rules and alerts pre-provisioning + mimirtool: + volumes: + - ../../monitoring-mixins/loki-mixin/deploy/loki-mixin-rules.yaml:/rules/loki-mixin-rules.yaml + - ../../monitoring-mixins/loki-mixin/deploy/loki-mixin-alerts.yaml:/rules/loki-mixin-alerts.yaml + - ../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-rules.yaml:/rules/tempo-mixin-rules.yaml + - ../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-alerts.yaml:/rules/tempo-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 + - ../../monitoring-mixins/pyroscope-mixin/deploy/pyroscope-mixin-rules.yaml:/rules/pyroscope-mixin-rules.yaml +``` + +## Try it + +```shell +COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose up -d --remove-orphans +``` + +Once all containers are up and running you can search for metrics in Grafana. + +Navigate to [http://localhost:3000](http://localhost:3000) + +## Stop services + +```shell +COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose down +``` diff --git a/examples/meta-monitoring/compose.override.yaml b/examples/meta-monitoring/compose.override.yaml new file mode 100644 index 00000000..43c26b7a --- /dev/null +++ b/examples/meta-monitoring/compose.override.yaml @@ -0,0 +1,33 @@ + +services: + loki: + labels: + metrics.grafana.com/scrape: true + tempo: + labels: + metrics.grafana.com/scrape: true + mimir: + labels: + metrics.grafana.com/scrape: true + pyroscope: + labels: + metrics.grafana.com/scrape: true + + # override included service grafana for dashboards pre-provisioning + grafana: + volumes: + - ../../monitoring-mixins/loki-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/loki-mixin + - ../../monitoring-mixins/tempo-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/tempo-mixin + - ../../monitoring-mixins/mimir-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/mimir-mixin + - ../../monitoring-mixins/pyroscope-mixin/deploy/dashboards_out:/var/lib/grafana/dashboards/pyroscope-mixin + + # override included service mimirtool for rules and alerts pre-provisioning + mimirtool: + volumes: + - ../../monitoring-mixins/loki-mixin/deploy/loki-mixin-rules.yaml:/rules/loki-mixin-rules.yaml + - ../../monitoring-mixins/loki-mixin/deploy/loki-mixin-alerts.yaml:/rules/loki-mixin-alerts.yaml + - ../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-rules.yaml:/rules/tempo-mixin-rules.yaml + - ../../monitoring-mixins/tempo-mixin/deploy/tempo-mixin-alerts.yaml:/rules/tempo-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 + - ../../monitoring-mixins/pyroscope-mixin/deploy/pyroscope-mixin-rules.yaml:/rules/pyroscope-mixin-rules.yaml diff --git a/examples/meta-monitoring/compose.yaml b/examples/meta-monitoring/compose.yaml new file mode 100644 index 00000000..af7a3ca7 --- /dev/null +++ b/examples/meta-monitoring/compose.yaml @@ -0,0 +1,17 @@ +# ============================================================================ # +# Meta Monitoring +# ============================================================================ # + +# Usage: +# COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose up -d --remove-orphans +# COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose down + +# Note: +# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later. +# docs: https://docs.docker.com/compose/multiple-compose-files/include/#include-and-overrides +include: +# # use git remote +# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/all-in-one/compose.yaml + +# # use local path +- path: ../../docker-compose/monolithic-mode/all-in-one/compose.yaml