Skip to content

Commit

Permalink
Add grafana container to monitor docker-compose (jaegertracing#3955)
Browse files Browse the repository at this point in the history
Signed-off-by: Albert Teoh <[email protected]>

Signed-off-by: Albert Teoh <[email protected]>
  • Loading branch information
albertteoh authored Oct 9, 2022
1 parent b4c88dd commit 878992a
Show file tree
Hide file tree
Showing 4 changed files with 1,355 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docker-compose/monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ Service Performance Monitoring (SPM) is an opt-in feature introduced to Jaeger t

The motivation for providing this environment is to allow developers to either test Jaeger UI or their own applications against jaeger-query's metrics query API, as well as a quick and simple way for users to bring up the entire stack required to visualize RED metrics from simulated traces (or their own).

This environment consists four backend components:
This environment consists the following backend components:

- [MicroSim](https://github.com/yurishkuro/microsim): a program to simulate traces.
- [Jaeger All-in-one](https://www.jaegertracing.io/docs/1.24/getting-started/#all-in-one): the full Jaeger stack in a single container image.
- [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/): vendor agnostic integration layer for traces and metrics. Its main role in this particular development environment is to receive Jaeger spans, forward these spans untouched to Jaeger All-in-one while simultaneously aggregating metrics out of this span data. To learn more about span metrics aggregation, please refer to the [spanmetrics processor documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/spanmetricsprocessor).
- [Prometheus](https://prometheus.io/): a metrics collection and query engine, used to scrape metrics computed by OpenTelemetry Collector, and presents an API for Jaeger All-in-one to query these metrics.
- [Grafana](https://grafana.com/): a metrics visualization, analytics & monitoring solution supporting multiple metrics databases.


The following diagram illustrates the relationship between these components:

Expand All @@ -24,14 +26,19 @@ docker-compose up
docker-compose down
```

**Tip:** Let the application run for a couple of minutes to ensure there is enough time series data to plot in the dashboard. Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint.
**Tips:**
- Let the application run for a couple of minutes to ensure there is enough time series data to plot in the dashboard.
- Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint.
- To visualize the raw metrics stored on the Prometheus server (for debugging and local development use cases), a Grafana server is included in the docker-compose config, which is preconfigured to read metrics from the Prometheus server.
To access Grafana, navigate to http://localhost:3000/, click on the "Explore" and click the "Select metric" dropdown then select `calls_total`, for example.

**Warning:** The included [docker-compose.yml](./docker-compose.yml) file uses the `latest` version of Jaeger and other components. If your local Docker registry already contains older versions, which may still be tagged as `latest`, you may want to delete those images before running the full set, to ensure consistent behavior:

```bash
docker rmi -f jaegertracing/all-in-one:latest
docker rmi -f otel/opentelemetry-collector-contrib:latest
docker rmi -f prom/prometheus:latest
docker rmi -f grafana/grafana:latest
```

## Example 1
Expand Down
8 changes: 8 additions & 0 deletions docker-compose/monitor/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
10 changes: 10 additions & 0 deletions docker-compose/monitor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,15 @@ services:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
grafana:
networks:
- backend
image: grafana/grafana:latest
volumes:
- ./grafana.ini:/etc/grafana/grafana.ini
- ./datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
ports:
- 3000:3000

networks:
backend:
Loading

0 comments on commit 878992a

Please sign in to comment.