Skip to content

Commit

Permalink
Add OTEL_RESOURCE_ATTRIBUTES to docker compose (#664)
Browse files Browse the repository at this point in the history
* Add OTEL_RESOURCE_ATTRIBUTES to docker compose

Signed-off-by: svrnm <neumanns@cisco.com>

* Update CHANGELOG.md

Signed-off-by: svrnm <neumanns@cisco.com>

* Update CHANGELOG.md

* Update docker-compose.yml

Co-authored-by: Juliano Costa <julianocosta89@outlook.com>

Signed-off-by: svrnm <neumanns@cisco.com>
Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
  • Loading branch information
svrnm and julianocosta89 committed Jan 9, 2023
1 parent 291f801 commit 5d330b6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#662](https://github.com/open-telemetry/opentelemetry-demo/pull/662))
* Add resource detectors to cart service
([#663](https://github.com/open-telemetry/opentelemetry-demo/pull/663))
* Add `OTEL_RESOURCE_ATTRIBUTES` to docker compose setup
([#664](https://github.com/open-telemetry/opentelemetry-demo/pull/664))
17 changes: 15 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}
- OTEL_EXPORTER_OTLP_ENDPOINT
- ENV_PLATFORM
- OTEL_SERVICE_NAME=frontend
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5d330b6

Please sign in to comment.