From a38aa6a55e23d70a213ba34c3c3a81602b463e4a Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Fri, 12 Jul 2024 20:11:17 +0200 Subject: [PATCH] Set OTLP receiver endpoint (#1662) * Set OTelCol receiver endpoint * changelog * Apply suggestions from code review Co-authored-by: Roger Coll * Add env vars to collector container --------- Co-authored-by: Roger Coll --- .env | 2 +- CHANGELOG.md | 2 ++ docker-compose-tests_include-override.yml | 5 +++++ docker-compose.minimal.yml | 3 +++ docker-compose.yml | 3 +++ src/otelcollector/otelcol-config.yml | 2 ++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.env b/.env index df84beb707..f316d96050 100644 --- a/.env +++ b/.env @@ -6,7 +6,7 @@ IMAGE_NAME=ghcr.io/open-telemetry/demo DEMO_VERSION=latest # Dependent images -COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.102.1 +COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.104.0 FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.10.2 GRAFANA_IMAGE=grafana/grafana:10.4.3 JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.57 diff --git a/CHANGELOG.md b/CHANGELOG.md index 591d16d361..6b4e29edf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ the release. ([#1634](https://github.com/open-telemetry/opentelemetry-demo/pull/1634)) * [otel-col] Add docker stats receiver ([#1650](https://github.com/open-telemetry/opentelemetry-demo/pull/1650)) +* [otel-col] Set OTLP receiver endpoint to avoid breaking changes + ([#1662](https://github.com/open-telemetry/opentelemetry-demo/pull/1662)) ## 1.10.0 diff --git a/docker-compose-tests_include-override.yml b/docker-compose-tests_include-override.yml index 3fea4d60cc..1a115b663f 100644 --- a/docker-compose-tests_include-override.yml +++ b/docker-compose-tests_include-override.yml @@ -5,6 +5,11 @@ services: otelcol: command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-tracetest.yml" ] + environment: + - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP volumes: - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index b4925dd742..be766578ad 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -596,6 +596,9 @@ services: logging: *logging environment: - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP # Prometheus prometheus: diff --git a/docker-compose.yml b/docker-compose.yml index fba9299ee4..2ea73d55f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -706,6 +706,9 @@ services: logging: *logging environment: - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP # Prometheus prometheus: diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 8901737b5c..62b6b481ce 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -5,7 +5,9 @@ receivers: otlp: protocols: grpc: + endpoint: ${env:OTEL_COLLECTOR_HOST}:${env:OTEL_COLLECTOR_PORT_GRPC} http: + endpoint: ${env:OTEL_COLLECTOR_HOST}:${env:OTEL_COLLECTOR_PORT_HTTP} cors: allowed_origins: - "http://*"