feat(collector): support inline Base64 config via OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT#2409
Conversation
|
|
…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.
9df7eff to
983c090
Compare
|
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.. |
There was a problem hiding this comment.
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:
So you should just be able to use the env provider. If there's no further questions, I'll thus be closing this PR.
|
Interesting.. I didn't find any docs related to that when I was looking... Will take another look next week though.. 👍 |
|
@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. |
Adds a new
OPENTELEMETRY_COLLECTOR_CONFIG_CONTENTenvironment variable thataccepts a standard Base64-encoded YAML collector config. The decoded content is
fed into the existing
yamlprovider(yaml:URI scheme), so no new provider isneeded.
Resolution order:
OPENTELEMETRY_COLLECTOR_CONFIG_URI(existing, unchanged — warns if_CONTENTis also set)OPENTELEMETRY_COLLECTOR_CONFIG_CONTENT(new — Base64-decoded YAML)OPENTELEMETRY_COLLECTOR_CONFIG_FILE(deprecated fallback, unchanged)/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