Skip to content

Commit 77989b9

Browse files
rogercollmviitane
andauthored
add collector configs as environment variable (open-telemetry#1632)
Co-authored-by: Mikko Viitanen <74129181+mviitane@users.noreply.github.com>
1 parent d58ca00 commit 77989b9

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ENV_PLATFORM=local
2525
OTEL_COLLECTOR_HOST=otelcol
2626
OTEL_COLLECTOR_PORT_GRPC=4317
2727
OTEL_COLLECTOR_PORT_HTTP=4318
28+
OTEL_COLLECTOR_CONFIG=./src/otelcollector/otelcol-config.yml
29+
OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otelcollector/otelcol-config-extras.yml
2830
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
2931
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces
3032

docker-compose.minimal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ services:
584584
restart: unless-stopped
585585
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ]
586586
volumes:
587-
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
588-
- ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml
587+
- ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
588+
- ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml
589589
ports:
590590
- "${OTEL_COLLECTOR_PORT_GRPC}"
591591
- "${OTEL_COLLECTOR_PORT_HTTP}"

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ services:
694694
restart: unless-stopped
695695
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ]
696696
volumes:
697-
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
698-
- ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml
697+
- ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
698+
- ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml
699699
ports:
700700
- "${OTEL_COLLECTOR_PORT_GRPC}"
701701
- "${OTEL_COLLECTOR_PORT_HTTP}"

0 commit comments

Comments
 (0)