Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present#46311
Open
rads-1996 wants to merge 2 commits intoAzure:mainfrom
Open
Conversation
…nstead of a boolean when no status code is present
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes incorrect typing of HTTP request telemetry success when HTTP status code is missing, ensuring it remains a boolean as expected by downstream consumers.
Changes:
- Coerces derived HTTP
successcalculation to boolean when status code is absent. - Adds regression assertions in trace tests to verify
successis aboolfor missing/empty status code cases. - Updates the exporter changelog with the bug fix entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py | Adds assertions to ensure request success is a boolean when status code is missing/empty. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py | Fixes success calculation to avoid integer truthiness leaking into telemetry. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md | Documents the bug fix in the changelog. |
...onitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py
Show resolved
Hide resolved
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.
Description
Fixes - #46118
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines