Skip to content

Commit 7ab0b52

Browse files
author
Mark Stumpf
authored
Fix evaluating env variables in fargate config (open-telemetry#935)
* Fix evaluating env variables in fargate config We need this double evaluation to expand the lists, otherwise it is interpreted as a string and doesn't work. * use NewExpandMapProvider
1 parent b2ab014 commit 7ab0b52

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Add Chocolately package support. (#724)
6+
- Fix evaluating env variables in fargate config (#935)
67

78
## v0.38.0
89

cmd/otelcol/config/collector/fargate_config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ receivers:
6060
listenAddress: 0.0.0.0:9080
6161
smartagent/ecs-metadata:
6262
type: ecs-metadata
63-
excludedImages: ${env:ECS_METADATA_EXCLUDED_IMAGES}
63+
excludedImages: $${env:ECS_METADATA_EXCLUDED_IMAGES}
6464

6565
processors:
6666
batch:
@@ -83,7 +83,7 @@ processors:
8383
metrics:
8484
exclude:
8585
match_type: regexp
86-
metric_names: ${env:METRICS_TO_EXCLUDE}
86+
metric_names: $${env:METRICS_TO_EXCLUDE}
8787
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
8888
# traces when it's not populated by instrumentation libraries.
8989
# If enabled, make sure to enable this processor in the pipeline below.

cmd/otelcol/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func newBaseParserProvider() config.MapProvider {
354354
configYaml := os.Getenv(configYamlEnvVarName)
355355

356356
if configPath == "" && configYaml != "" {
357-
return parserprovider.NewInMemoryMapProvider(bytes.NewBufferString(configYaml))
357+
return parserprovider.NewExpandMapProvider(parserprovider.NewInMemoryMapProvider(bytes.NewBufferString(configYaml)))
358358
}
359359

360360
return parserprovider.NewDefaultMapProvider(configPath, nil)

0 commit comments

Comments
 (0)