Skip to content

Commit

Permalink
Add use case examples
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Mar 24, 2024
1 parent dfd4e64 commit 111458a
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 7 deletions.
44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,39 @@
</a>
</p>

## Grafana LGTMP Stack (Loki Grafana Tempo Mimir Pyroscope)
## Quick Start

Based on `flow` model [Grafana Agent](https://github.com/grafana/agent).
This quick start guide will show you how to getting started. An simple use case `compose.yaml` like so:

Open a new terminal window create the `compose.yaml`:

```yaml
# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
include:
# - path: https://github.com/qclaogui/codelab-monitoring.git # All in one(Logs Traces Metrics Profiles)
- path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/logs/compose.yaml # Just Metrics and Logs

# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
services:
github-exporter:
image: githubexporter/github-exporter:latest
environment:
- REPOS=qclaogui/codelab-monitoring,grafana/agent
```
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)

> In this case you can find `github-exporter` metrics and logs.
More [examples](./examples/)

---

<details>

Expand All @@ -37,16 +67,16 @@ Docker compose
up-monolithic-mode-profiles Run monolithic-mode Pyroscope for profiles
up-monolithic-mode-all-in-one Run monolithic-mode all-in-one
up-read-write-mode-metrics Run read-write-mode Mimir for metrics
up-read-write-mode-logs Run read-write-mode Loki for logs
up-microservices-mode-metrics Run microservices-mode Mimir for metrics
up-microservices-mode-logs Run microservices-mode Loki for logs
up-microservices-mode-traces Run microservices-mode Tempo for traces
up-microservices-mode-profiles Run microservices-mode Pyroscope for profiles
```

</summary>

```shell
up-read-write-mode-logs Run read-write-mode Loki for logs
up-microservices-mode-metrics Run microservices-mode Mimir for metrics
up-microservices-mode-logs Run microservices-mode Loki for logs
up-microservices-mode-traces Run microservices-mode Tempo for traces
up-microservices-mode-profiles Run microservices-mode Pyroscope for profiles
Kubernetes
cluster Create k3s cluster
clean Clean cluster
Expand Down
16 changes: 16 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Examples

This directory contains examples, including:

- [github-exporter](./github-exporter/README.md)

The following ports will be exposed on the host:

- Loki on <http://localhost:33100>
- Grafana on <http://localhost:3000>
- Grafana Agent on <http://localhost:12345>
- Tempo on <http://localhost:33200>
- Mimir on <http://localhost:38080>
- Pyroscope on <http://localhost:34040>

The Minio console is available at <http://localhost:9001>
35 changes: 35 additions & 0 deletions examples/github-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Prometheus GitHub Exporter

Exposes basic metrics for your repositories from the GitHub API, to a Prometheus compatible endpoint.

## Docker compose

```yaml

include:
- path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/logs/compose.yaml

# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
services:
github-exporter:
image: githubexporter/github-exporter:latest
environment:
- REPOS=qclaogui/codelab-monitoring,grafana/agent

```

## Try it

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

```shell
COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker compose down
```

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.

> In this case you can find `github-exporter` metrics and logs.
Navigate to [http://localhost:3000](http://localhost:3000)
23 changes: 23 additions & 0 deletions examples/github-exporter/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ============================================================================ #
# Github Exporter
# ============================================================================ #

# 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.
include:
# - path: https://github.com/qclaogui/codelab-monitoring.git # All in one(Logs Traces Metrics Profiles)
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/metrics/compose.yaml # Metrics
- path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/logs/compose.yaml # Metrics and Logs
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/traces/compose.yaml # Metrics and Traces
# - path: https://github.com/qclaogui/codelab-monitoring.git#main:docker-compose/monolithic-mode/profiles/compose.yaml # Metrics and Profiles

# https://github.com/qclaogui/codelab-monitoring/blob/main/docker-compose/common/config/agent-flow/modules/docker/README.md
services:
github-exporter:
image: githubexporter/github-exporter:latest
environment:
- REPOS=qclaogui/codelab-monitoring,grafana/agent

0 comments on commit 111458a

Please sign in to comment.