From b64470149546c78280086fcaaf42e89ebe935b78 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Sat, 2 Nov 2024 02:01:04 +0100 Subject: [PATCH] [spm] Remove Grafana from examples (#6148) ## Which problem is this PR solving? - Grafana server was not necessary for demonstrating SPM behavior or debugging ## Description of the changes - Remove grafana service - Update readme ## How was this change tested? - Manually (incidentally ran into an odd issue #6150) --------- Signed-off-by: Pavol Loffay Signed-off-by: Yuri Shkuro Co-authored-by: Yuri Shkuro Co-authored-by: Yuri Shkuro --- docker-compose/monitor/README.md | 22 +++++++++++++++++--- docker-compose/monitor/docker-compose-v2.yml | 14 ------------- docker-compose/monitor/docker-compose.yml | 16 +------------- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/docker-compose/monitor/README.md b/docker-compose/monitor/README.md index df8c30adb36..a126eb89669 100644 --- a/docker-compose/monitor/README.md +++ b/docker-compose/monitor/README.md @@ -17,7 +17,6 @@ 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: @@ -74,11 +73,16 @@ 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), 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. +- 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 **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: @@ -86,6 +90,18 @@ docker compose up 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. diff --git a/docker-compose/monitor/docker-compose-v2.yml b/docker-compose/monitor/docker-compose-v2.yml index 890ab856849..8e5a248c509 100644 --- a/docker-compose/monitor/docker-compose-v2.yml +++ b/docker-compose/monitor/docker-compose-v2.yml @@ -32,19 +32,5 @@ 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: diff --git a/docker-compose/monitor/docker-compose.yml b/docker-compose/monitor/docker-compose.yml index 983e3c2e68b..4408c4709c3 100644 --- a/docker-compose/monitor/docker-compose.yml +++ b/docker-compose/monitor/docker-compose.yml @@ -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.109.0} + image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.112.0} volumes: - ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml command: --config /etc/otelcol/otel-collector-config.yml @@ -50,19 +50,5 @@ 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: