Skip to content

Commit

Permalink
Revert "[spm] Remove Grafana from examples (jaegertracing#6148)"
Browse files Browse the repository at this point in the history
This reverts commit b644701.
  • Loading branch information
yurishkuro committed Nov 2, 2024
1 parent f8c56d5 commit d34447d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
22 changes: 3 additions & 19 deletions docker-compose/monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This environment consists the following backend components:
- [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 connector documentation][spanmetricsconnectorreadme].
- [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 Down Expand Up @@ -73,35 +74,18 @@ It uses the latest image tags from both Jaeger and OpenTelemetry.
docker compose up
```

**Jaeger v2**

```shell
docker compose -f docker-compose-v2.yml up
```

**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), use the built-in Prometheus UI at http://localhost:9090/graph. For example, http://localhost:9090/graph?g0.expr=traces_span_metrics_calls_total&g0.tab=0&g0.range_input=5m
- 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
make clean-all
```

To use an official published image of Jaeger, specify the version via environment variable:

```shell
JAEGER_IMAGE_TAG=1.62.0 docker compose up
```

or for Jaeger v2:

```shell
JAEGER_IMAGE_TAG=2.0.0-rc2 docker compose -f docker-compose-v2.yml up
```

## Development

These steps allow for running the system necessary for SPM, built from Jaeger's source.
Expand Down
14 changes: 14 additions & 0 deletions docker-compose/monitor/docker-compose-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,19 @@ services:
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
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- 3000:3000

networks:
backend:
16 changes: 15 additions & 1 deletion docker-compose/monitor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
backend:
# This is the host name used in Prometheus scrape configuration.
aliases: [spm_metrics_source]
image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.112.0}
image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.109.0}
volumes:
- ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml
command: --config /etc/otelcol/otel-collector-config.yml
Expand Down Expand Up @@ -50,5 +50,19 @@ services:
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
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- "3000:3000"

networks:
backend:

0 comments on commit d34447d

Please sign in to comment.