Skip to content

Commit

Permalink
[example] Enabled local LGTMP Stack meta monitoring
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Apr 27, 2024
1 parent 95fab62 commit 606f6b2
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
70 changes: 70 additions & 0 deletions examples/meta-monitoring/README.md
Original file line number Diff line number Diff line change
@@ -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
```
33 changes: 33 additions & 0 deletions examples/meta-monitoring/compose.override.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions examples/meta-monitoring/compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 606f6b2

Please sign in to comment.