Example using environment variable:
Ensure APPLICATIONINSIGHTS_CONNECTION_STRING is set in your environment, then configure the exporter without specifying a connection string or instrumentation key:
exporters:
azuremonitor:
this should be possible according to the docs, but my otel-collector crashes when doing this.
Steps to Reproduce
Create an otel-collector with the following exporter config
exporters:
azuremonitor:
container crashes
Expected Result
Able to use APPLICATION_INSIGHTS_CONNECTION_STRING as an environment variable on the pod sending data to the otel collector to simplify configuration overhead.
Actual Result
OTEL collector crashes if connection string is not set
Error: failed to build pipelines: failed to create "azuremonitor" exporter for data type "logs": ConnectionString and InstrumentationKey cannot be empty 2024/11/12 12:41:54 collector server run finished with error: failed to build pipelines: failed to create "azuremonitor" exporter for data type "logs": ConnectionString and InstrumentationKey cannot be empty
Component(s)
exporter/azuremonitor
What happened?
Description
According to the docs
this should be possible according to the docs, but my otel-collector crashes when doing this.
Steps to Reproduce
Create an otel-collector with the following exporter config
container crashes
Expected Result
Able to use APPLICATION_INSIGHTS_CONNECTION_STRING as an environment variable on the pod sending data to the otel collector to simplify configuration overhead.
Actual Result
OTEL collector crashes if connection string is not set
Collector version
otel/opentelemetry-collector-k8s:0.111.0
Environment information
Environment
otel-collector helm chart
OpenTelemetry Collector configuration
Log output
Additional context
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/azuremonitorexporter/README.md#configuration-options
Relates to #34188