Skip to content

Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present#46311

Merged
rads-1996 merged 6 commits into
Azure:mainfrom
rads-1996:fix-invalid-int-returned
Apr 20, 2026
Merged

Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present#46311
rads-1996 merged 6 commits into
Azure:mainfrom
rads-1996:fix-invalid-int-returned

Conversation

@rads-1996
Copy link
Copy Markdown
Member

@rads-1996 rads-1996 commented Apr 14, 2026

Description

Fixes - #46118

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.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings April 14, 2026 18:38
Copy link
Copy Markdown
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

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 success calculation to boolean when status code is absent.
  • Adds regression assertions in trace tests to verify success is a bool for 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.

Comment thread sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md
@github-actions github-actions Bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Apr 14, 2026
@rads-1996 rads-1996 force-pushed the fix-invalid-int-returned branch from 0a96d42 to 72f090f Compare April 15, 2026 20:08
@rads-1996 rads-1996 force-pushed the fix-invalid-int-returned branch from 9584f4e to 83b3a5a Compare April 20, 2026 16:32
@rads-1996 rads-1996 merged commit dc997f6 into Azure:main Apr 20, 2026
20 checks passed
@rads-1996 rads-1996 deleted the fix-invalid-int-returned branch April 20, 2026 17:43
fafhrd91 pushed a commit to fafhrd91/azure-sdk-for-python that referenced this pull request Apr 28, 2026
…nstead of a boolean when no status code is present (Azure#46311)

* Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present

* Update CHANGELOG

* Address feedback

* Add/Modify tests

* Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present

* Add/Modify tests
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.

3 participants