Skip to content

[exporter/azuremonitor] add configurable HTTP success mapping#49399

Open
tombiddulph wants to merge 5 commits into
open-telemetry:mainfrom
tombiddulph:azure-monitor-http-status-code-config
Open

[exporter/azuremonitor] add configurable HTTP success mapping#49399
tombiddulph wants to merge 5 commits into
open-telemetry:mainfrom
tombiddulph:azure-monitor-http-status-code-config

Conversation

@tombiddulph

Copy link
Copy Markdown

Description

The Azure Monitor exporter currently marks any HTTP span with a status code
outside 100–399 as Success = false on the resulting Application Insights
RequestData / RemoteDependencyData

This causes expected 4xx responses (most notably 404 for cache misses,
existence checks, optional resources, etc.) to show up as failed
requests/dependencies in Application Insights dashboards and alerts. It also
diverges from the OpenTelemetry HTTP semantic conventions, which state that
4xx on server spans should not set the span status to Error.

Spec for reference.

This pr adds two opt-in settings to the Azure Monitor exporter:

  • non_error_http_status_codes (list of HTTP status codes treated as Success on both server and client HTTP spans) and
  • align_http_server_request_success_with_otel_spec (when true, 4xx responses on HTTP server spans are treated as Success, matching the OpenTelemetry HTTP semantic conventions). Defaults preserve the existing exporter behaviour.

Link to tracking issue

Fixes #47691

Testing

-Added a unit test for the existing behaviour and the opt in features

Documentation

  • Updated the readme with the new features
  • Added to the changelog

Authorship

  • I, a human, wrote this pull request description myself.

@tombiddulph tombiddulph requested a review from a team as a code owner June 30, 2026 17:08
@tombiddulph tombiddulph requested a review from edmocosta June 30, 2026 17:08
@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • First-time contributors should have at most one PR not marked as draft until their first PR is merged.
  • If your change isn't one of our priority components, reviews may take more time.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help or struggle to move your PR forward:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[exporter/azuremonitor] Allow treating specific HTTP status codes (e.g. 404) as non-errors

2 participants