Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>

Update README.md
  • Loading branch information
qclaogui committed Mar 25, 2024
1 parent 4dc2056 commit 5e8fbdd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@

## Quick Start

This quick start guide will show you how to getting started. An simple use case `compose.yaml` like so:
This quick start guide will show you how to getting started.

Open a new terminal window to create `compose.yaml` or get it from [examples/](./examples/) by running:

```shell
wget https://raw.githubusercontent.com/qclaogui/codelab-monitoring/main/examples/github-exporter/compose.yaml
```

An simple use case `compose.yaml` like so:

```yaml
# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
Expand All @@ -30,13 +38,11 @@ services:
- REPOS=qclaogui/codelab-monitoring
```
Open a new terminal window create the `compose.yaml` and run:

```shell
COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose up -d --remove-orphans
```

Once all containers are up and running you can search for metrics(from Mimir) logs(from Loki) traces(from Tempo) and profiles(Pyroscope) in Grafana. Navigate to [http://localhost:3000](http://localhost:3000)
Once all containers are up and running you can search for metrics in Grafana. Navigate to [http://localhost:3000](http://localhost:3000)

> In this case you can find `github-exporter` metrics and logs.
Expand Down
26 changes: 26 additions & 0 deletions docker-compose/common/compose-include/loki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
services:
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:
- ../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: 10s
timeout: 5s
retries: 10
# expose 33100 port so we can directly access loki inside container
ports:
- "33100:3100"
networks:
default:
aliases:
- loki-memberlist
2 changes: 2 additions & 0 deletions docker-compose/microservices-mode/traces/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/mimir.yaml
- path: ../../common/compose-include/loki.yaml
- path: ../../common/compose-include/grafana-agent.yaml
- path: ../../common/compose-include/grafana.yaml

Expand All @@ -34,6 +35,7 @@ services:
- ../../common/config/nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template
- ../../common/config/tempo/gateway_tempo.conf:/etc/nginx/templates/gateway_tempo.conf.template
- ../../common/config/mimir/gateway_mimir.conf:/etc/nginx/templates/gateway_mimir.conf.template
- ../../common/config/loki/gateway_loki.conf:/etc/nginx/templates/gateway_loki.conf.template
environment:
- TEMPO_DISTRIBUTOR_HOST=distributor
- TEMPO_INGESTER_HOST=ingester
Expand Down
2 changes: 2 additions & 0 deletions docker-compose/monolithic-mode/traces/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/mimir.yaml
- path: ../../common/compose-include/loki.yaml
- path: ../../common/compose-include/grafana.yaml

x-environment: &jaeger-environment
Expand Down Expand Up @@ -72,6 +73,7 @@ services:
- ../../common/config/nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template
- ../../common/config/tempo/gateway_tempo.conf:/etc/nginx/templates/gateway_tempo.conf.template
- ../../common/config/mimir/gateway_mimir.conf:/etc/nginx/templates/gateway_mimir.conf.template
- ../../common/config/loki/gateway_loki.conf:/etc/nginx/templates/gateway_loki.conf.template
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3200/ || exit 1" ]
interval: 10s
Expand Down
21 changes: 21 additions & 0 deletions examples/github-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,24 @@ Once all containers are up and running you can search for metrics(from Mimir) lo
> In this case you can find `github-exporter` metrics and logs.
Navigate to [http://localhost:3000](http://localhost:3000)

## Resource Utilization

```shell
COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose stats
```

```shell
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
613d8d5e7e30 root-grafana-agent-1 2.72% 180.7MiB / 1.889GiB 9.34% 1.46MB / 4.61MB 3.15MB / 1.56MB 11
53443e6d4c31 root-gateway-1 0.00% 8.102MiB / 1.889GiB 0.42% 497kB / 503kB 6.45MB / 20.5kB 3
750ace278979 root-mimir-1 1.06% 121.2MiB / 1.889GiB 6.27% 5.09MB / 888kB 111kB / 8.7MB 8
acb81816e078 root-loki-1 1.11% 83.13MiB / 1.889GiB 4.30% 157kB / 336kB 56.2MB / 340kB 8
f5f28089da9c root-memcached-1 0.03% 6.762MiB / 1.889GiB 0.35% 31.6kB / 128kB 0B / 0B 10
a91be648c677 root-memcached-exporter-1 0.00% 7.125MiB / 1.889GiB 0.37% 126kB / 75.2kB 0B / 0B 5
4f755dee256b root-minio-1 3.99% 163.3MiB / 1.889GiB 8.44% 367kB / 889kB 1.77MB / 557kB 12
fab3799e6a97 root-grafana-1 7.37% 72.63MiB / 1.889GiB 3.76% 666kB / 790kB 1.01MB / 34.2MB 9
d16d6664924c root-load-rules-to-mimir-1 0.00% 31.69MiB / 1.889GiB 1.64% 54.7kB / 117kB 44.9MB / 4.1kB 1
72262bb29bd1 root-github-exporter-1 0.00% 9.906MiB / 1.889GiB 0.51% 141kB / 41.4kB 3.4MB / 0B 5

```

0 comments on commit 5e8fbdd

Please sign in to comment.