From 6afcdc45b108175a555f2de38dc6800819713d86 Mon Sep 17 00:00:00 2001 From: svrnm Date: Wed, 28 Dec 2022 14:11:16 +0100 Subject: [PATCH 1/4] Add OTEL_RESOURCE_ATTRIBUTES to docker compose Signed-off-by: svrnm --- .env | 3 +++ docker-compose.yml | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.env b/.env index dd461ad101..aa61e20a5a 100644 --- a/.env +++ b/.env @@ -13,6 +13,9 @@ OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces +# OpenTelemetry Resource Definitions +OTEL_RESOURCE_ATTRIBUTES="service.namespace=opentelemetry-demo" + # Metrics Temporality OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative diff --git a/docker-compose.yml b/docker-compose.yml index 900dc7d461..87d0dd4a93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=accountingservice depends_on: otelcol: @@ -76,6 +77,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=adservice depends_on: - otelcol @@ -101,6 +103,7 @@ services: - CART_SERVICE_PORT - REDIS_ADDR - OTEL_EXPORTER_OTLP_ENDPOINT + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=cartservice - ASPNETCORE_URLS=http://*:${CART_SERVICE_PORT} depends_on: @@ -136,6 +139,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=checkoutservice depends_on: cartservice: @@ -177,7 +181,7 @@ services: environment: - CURRENCY_SERVICE_PORT - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_RESOURCE_ATTRIBUTES=service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME + - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME depends_on: - otelcol logging: *logging @@ -201,6 +205,7 @@ services: - APP_ENV=production - EMAIL_SERVICE_PORT - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=emailservice depends_on: - otelcol @@ -255,6 +260,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=frauddetectionservice depends_on: otelcol: @@ -290,7 +296,7 @@ services: - RECOMMENDATION_SERVICE_ADDR - SHIPPING_SERVICE_ADDR - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_RESOURCE_ATTRIBUTES=service.name=frontend + - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=frontend - OTEL_EXPORTER_OTLP_ENDPOINT - ENV_PLATFORM - OTEL_SERVICE_NAME=frontend @@ -361,6 +367,7 @@ services: - LOCUST_HEADLESS - LOCUST_AUTOSTART - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=loadgenerator - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python depends_on: @@ -388,6 +395,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=paymentservice depends_on: - otelcol @@ -413,6 +421,7 @@ services: - PRODUCT_CATALOG_SERVICE_PORT - FEATURE_FLAG_GRPC_SERVICE_ADDR - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=productcatalogservice depends_on: - otelcol @@ -438,6 +447,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces - OTEL_PHP_AUTOLOAD_ENABLED=true - QUOTE_SERVICE_PORT + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=quoteservice depends_on: - otelcol @@ -468,6 +478,7 @@ services: - OTEL_METRICS_EXPORTER=otlp - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=recommendationservice - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python depends_on: @@ -496,6 +507,7 @@ services: - SHIPPING_SERVICE_PORT - QUOTE_SERVICE_ADDR - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=shippingservice depends_on: - otelcol @@ -544,6 +556,7 @@ services: - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=kafka logging: *logging healthcheck: From 337889f81c006a6217c7d7955d4274c4d6adf169 Mon Sep 17 00:00:00 2001 From: svrnm Date: Wed, 28 Dec 2022 14:18:37 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md Signed-off-by: svrnm --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d122bb058e..d9beb3489a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -166,3 +166,6 @@ significant modifications will be credited to OpenTelemetry Authors. ([#648](https://github.com/open-telemetry/opentelemetry-demo/pull/648)) * Add Jaeger-SPM-Config ([#655](https://github.com/open-telemetry/opentelemetry-demo/pull/655)) +* Add `OTEL_RESOURCE_ATTRIBUTES` to docker compose setup +([#664](https://github.com/open-telemetry/opentelemetry-demo/pull/664)) + From 583cb2f977c65b055a79b2c9cd3b06af8819b943 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Wed, 28 Dec 2022 18:51:28 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9beb3489a..5884fdea25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -168,4 +168,3 @@ significant modifications will be credited to OpenTelemetry Authors. ([#655](https://github.com/open-telemetry/opentelemetry-demo/pull/655)) * Add `OTEL_RESOURCE_ATTRIBUTES` to docker compose setup ([#664](https://github.com/open-telemetry/opentelemetry-demo/pull/664)) - From 82cb9e166ffc58f708fa2bf3f4e0671d985d86f7 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Mon, 9 Jan 2023 09:16:47 +0100 Subject: [PATCH 4/4] Update docker-compose.yml Co-authored-by: Juliano Costa --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 87d0dd4a93..643142980b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -296,7 +296,7 @@ services: - RECOMMENDATION_SERVICE_ADDR - SHIPPING_SERVICE_ADDR - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=frontend + - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES} - OTEL_EXPORTER_OTLP_ENDPOINT - ENV_PLATFORM - OTEL_SERVICE_NAME=frontend