Skip to content

feat(collector): support inline Base64 config via OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT#2409

Closed
fatmcgav wants to merge 1 commit into
open-telemetry:mainfrom
fatmcgav:feat-collector-b64-encoded-config
Closed

feat(collector): support inline Base64 config via OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT#2409
fatmcgav wants to merge 1 commit into
open-telemetry:mainfrom
fatmcgav:feat-collector-b64-encoded-config

Conversation

@fatmcgav

Copy link
Copy Markdown

Adds a new OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT environment variable that
accepts a standard Base64-encoded YAML collector config. The decoded content is
fed into the existing yamlprovider (yaml: URI scheme), so no new provider is
needed.

Resolution order:

  1. OPENTELEMETRY_COLLECTOR_CONFIG_URI (existing, unchanged — warns if _CONTENT is also set)
  2. OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT (new — Base64-decoded YAML)
  3. OPENTELEMETRY_COLLECTOR_CONFIG_FILE (deprecated fallback, unchanged)
  4. /opt/collector-config/config.yaml (default)

If Base64 decoding fails an error is logged and the extension falls through to
the next option. NewCollector's signature is unchanged.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@fatmcgav
fatmcgav requested a review from a team as a code owner June 22, 2026 15:23
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 22, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: fatmcgav / name: Gavin Williams (983c090)

…ECTOR_CONFIG_CONTENT`

Adds a new `OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT` environment variable that
accepts a standard Base64-encoded YAML collector config. The decoded content is
fed into the existing `yamlprovider` (`yaml:` URI scheme), so no new provider is
needed.

Resolution order:
1. `OPENTELEMETRY_COLLECTOR_CONFIG_URI` (existing, unchanged — warns if `_CONTENT` is also set)
2. `OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT` (new — Base64-decoded YAML)
3. `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` (deprecated fallback, unchanged)
4. `/opt/collector-config/config.yaml` (default)

If Base64 decoding fails an error is logged and the extension falls through to
the next option. `NewCollector`'s signature is unchanged.
@fatmcgav
fatmcgav force-pushed the feat-collector-b64-encoded-config branch from 9df7eff to 983c090 Compare June 23, 2026 09:56
@wpessers wpessers added enhancement New feature or request go Pull requests that update Go code labels Jun 27, 2026
@tylerbenson

Copy link
Copy Markdown
Member

I don't think we can accept this here as it really should be something standardized on the collector side first.

@fatmcgav

Copy link
Copy Markdown
Author

I don't think we can accept this here as it really should be something standardized on the collector side first.

Isn't this a lambda specific use case though? I can't personally see a need to use a base64 encoded string on any of the other common use cases..

@wpessers wpessers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with @tylerbenson on this. And on top of that, I believe it's already a thing that has been standardised in the collector upstream (see: open-telemetry/opentelemetry-collector#2910). We even already ship it in the collector extension:

ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory(), envprovider.NewFactory(), yamlprovider.NewFactory(), httpsprovider.NewFactory(), httpprovider.NewFactory(), s3provider.NewFactory(), secretsmanagerprovider.NewFactory()},

So you should just be able to use the env provider. If there's no further questions, I'll thus be closing this PR.

@fatmcgav

Copy link
Copy Markdown
Author

Interesting.. I didn't find any docs related to that when I was looking... Will take another look next week though.. 👍

@wpessers

Copy link
Copy Markdown
Member

@fatmcgav I'm willing to accept a PR to add some documentation for it here if that would make sense to you.

Since the extension layer basically ships a slimmed down version of the otel collector it's hard to decide what is worth documenting.

For now, I'll close the PR. If for any reason you can't get it to work with the env provider I'd advise opening an issue.

@wpessers wpessers closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants