Skip to content

Commit

Permalink
Otlp env variables (open-telemetry#809)
Browse files Browse the repository at this point in the history
* standardize OTEL_* env vars

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>

* standardize OTEL_* env vars

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>

---------

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>
Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
  • Loading branch information
puckpuck and julianocosta89 authored Mar 29, 2023
1 parent 04b7a82 commit 8298bd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 33 deletions.
8 changes: 0 additions & 8 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
37 changes: 12 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8298bd4

Please sign in to comment.