Fix fallback logic for extracting connection string from env var#45252
Open
rads-1996 wants to merge 6 commits intoAzure:mainfrom
Open
Fix fallback logic for extracting connection string from env var#45252rads-1996 wants to merge 6 commits intoAzure:mainfrom
rads-1996 wants to merge 6 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 fromAPPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable whenparsed_connection_string._connection_stringisNone - 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 |
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
...or/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/_base.py
Outdated
Show resolved
Hide resolved
873900c to
690f9d3
Compare
JacksonWeber
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All SDK Contribution checklist:
General Guidelines and Best Practices