From 37a2a25f32271498ead0a3ff2a6f327fb13a32c5 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Wed, 29 Mar 2023 19:56:59 -0400 Subject: [PATCH] Otlp env variables (#809) * standardize OTEL_* env vars Signed-off-by: Pierre Tessier * standardize OTEL_* env vars Signed-off-by: Pierre Tessier --------- Signed-off-by: Pierre Tessier Co-authored-by: Juliano Costa --- .env | 8 -------- docker-compose.yml | 37 ++++++++++++------------------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/.env b/.env index 59fae6c33f..76152bf32d 100644 --- a/.env +++ b/.env @@ -23,16 +23,8 @@ ENV_PLATFORM=local OTEL_COLLECTOR_HOST=otelcol OTEL_COLLECTOR_PORT=4317 OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT} -OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} -OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} -OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces -# Exporter protocol configuration -OTEL_TRACES_EXPORTER=otlp -OTEL_METRICS_EXPORTER=otlp -OTEL_LOGS_EXPORTER=otlp - # OpenTelemetry Resource Definitions OTEL_RESOURCE_ATTRIBUTES="service.namespace=opentelemetry-demo" diff --git a/docker-compose.yml b/docker-compose.yml index 2b15f8fed1..9d3aa288c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,8 +44,7 @@ services: restart: unless-stopped environment: - KAFKA_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=accountingservice @@ -75,13 +74,11 @@ services: environment: - AD_SERVICE_PORT - FEATURE_FLAG_GRPC_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - OTEL_RESOURCE_ATTRIBUTES + - OTEL_LOGS_EXPORTER=otlp - OTEL_SERVICE_NAME=adservice - - OTEL_LOGS_EXPORTER depends_on: - otelcol logging: *logging @@ -139,8 +136,7 @@ services: - PRODUCT_CATALOG_SERVICE_ADDR - SHIPPING_SERVICE_ADDR - KAFKA_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=checkoutservice @@ -183,7 +179,7 @@ services: - "${CURRENCY_SERVICE_PORT}" environment: - CURRENCY_SERVICE_PORT - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME depends_on: - otelcol @@ -234,11 +230,10 @@ services: environment: - FEATURE_FLAG_SERVICE_PORT - FEATURE_FLAG_GRPC_SERVICE_PORT - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc - OTEL_SERVICE_NAME=featureflagservice - DATABASE_URL=ecto://ffs:ffs@ffs_postgres:5432/ffs - - FEATURE_FLAG_SERVICE_PATH_ROOT="/feature" healthcheck: test: ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"] depends_on: @@ -262,8 +257,7 @@ services: restart: unless-stopped environment: - KAFKA_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=frauddetectionservice @@ -300,13 +294,11 @@ services: - PRODUCT_CATALOG_SERVICE_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES} - OTEL_EXPORTER_OTLP_ENDPOINT + - OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES} - ENV_PLATFORM - OTEL_SERVICE_NAME=frontend - PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - WEB_OTEL_SERVICE_NAME=frontend-web depends_on: @@ -403,8 +395,7 @@ services: - "${PAYMENT_SERVICE_PORT}" environment: - PAYMENT_SERVICE_PORT - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=paymentservice @@ -431,8 +422,7 @@ services: environment: - PRODUCT_CATALOG_SERVICE_PORT - FEATURE_FLAG_GRPC_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=productcatalogservice @@ -487,8 +477,6 @@ services: - PRODUCT_CATALOG_SERVICE_ADDR - FEATURE_FLAG_GRPC_SERVICE_ADDR - OTEL_PYTHON_LOG_CORRELATION=true - - OTEL_TRACES_EXPORTER - - OTEL_METRICS_EXPORTER - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES @@ -519,7 +507,7 @@ services: environment: - SHIPPING_SERVICE_PORT - QUOTE_SERVICE_ADDR - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4317/v1/traces - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=shippingservice depends_on: @@ -566,8 +554,7 @@ services: restart: unless-stopped environment: - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 - - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT + - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=kafka