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

Open
rads-1996 wants to merge 2 commits intoAzure:mainfrom
rads-1996:fix-invalid-int-returned
Open

Fix success field on HTTP request telemetry resolving to an integer instead of a boolean when no status code is present#46311
rads-1996 wants to merge 2 commits intoAzure: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.

…nstead of a boolean when no status code is present
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.

@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Apr 14, 2026
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