Skip to content

Fix fallback logic for extracting connection string from env var#45252

Open
rads-1996 wants to merge 6 commits intoAzure:mainfrom
rads-1996:fix-env-conn-str
Open

Fix fallback logic for extracting connection string from env var#45252
rads-1996 wants to merge 6 commits intoAzure:mainfrom
rads-1996:fix-env-conn-str

Conversation

@rads-1996
Copy link
Member

@rads-1996 rads-1996 commented Feb 18, 2026

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Copilot AI review requested due to automatic review settings February 18, 2026 23:51
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Feb 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug in the Azure Monitor OpenTelemetry Exporter where the connection string was not properly stored when provided only via the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable. The issue occurred because ConnectionStringParser would read and parse the environment variable but store None in its _connection_string attribute when no connection string was explicitly passed.

Changes:

  • Added fallback logic in BaseExporter.__init__ to read from APPLICATIONINSIGHTS_CONNECTION_STRING environment variable when parsed_connection_string._connection_string is None
  • Updated CHANGELOG to document the bug fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py Added fallback logic to read connection string from environment variable when not explicitly provided
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Added entry documenting the bug fix under "Bugs Fixed" section

@rads-1996 rads-1996 marked this pull request as draft February 19, 2026 00:15
@rads-1996 rads-1996 marked this pull request as ready for review February 19, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments