Skip to content

Add ConnectionString Support for Azure Monitor Exporter #28853

@rajkumar-rangaraj

Description

@rajkumar-rangaraj

Component(s)

exporter/azuremonitor

Is your feature request related to a problem? Please describe.

Currently, the Azure Monitor Exporter in the OpenTelemetry Collector Contrib repository requires users to configure the instrumentation key directly in the exporter's configuration. However, Azure Monitor advocates for the utilization of a connection string, a method that streamlines the configuration process and ensures alignment with Azure Monitor’s recommended best practices.

Ref: https://learn.microsoft.com/en-in/azure/azure-monitor/app/sdk-connection-string?tabs=dotnet5

Describe the solution you'd like

I propose adding support for the connection string in the Azure Monitor Exporter configuration. Users should be able to provide a connection string instead of the instrumentation key, and the exporter should parse this string to extract the necessary information for sending telemetry data to Azure Monitor.

This change should be backward compatible, allowing users to continue using the instrumentation key for now. However, it's important to note that the use of instrumentation keys is being deprecated in favor of connection strings, and users are encouraged to switch to using connection strings.

Describe alternatives you've considered

The exporter configuration can be extended to include a new connection_string field. The exporter should first check if the connection_string field is provided, and if so, use it to configure the telemetry client. If the connection_string field is not provided, the exporter should fall back to using the instrumentation_key field.

Additional context

The Azure Monitor team is moving towards deprecating the use of standalone instrumentation keys in favor of connection strings. Connection strings provide more flexibility and make it easier for users to configure their Azure Monitor Exporter. By adding support for connection strings in the OpenTelemetry Collector, we ensure that users are able to use the recommended authentication and configuration practices set by Azure Monitor.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions