Skip to content

Remove duplicate session header update in OTLP HTTP exporters#5442

Open
Eason09053360 wants to merge 2 commits into
open-telemetry:mainfrom
Eason09053360:remove-duplicate-otlp-http-header-update
Open

Remove duplicate session header update in OTLP HTTP exporters#5442
Eason09053360 wants to merge 2 commits into
open-telemetry:mainfrom
Eason09053360:remove-duplicate-otlp-http-header-update

Conversation

@Eason09053360

@Eason09053360 Eason09053360 commented Jul 19, 2026

Copy link
Copy Markdown

Description

All three OTLP HTTP exporters (span, metric, log) call self._session.headers.update(self._headers) twice — once before the default _OTLP_HTTP_HEADERS and once after. #4634 deliberately moved the user-header update after the defaults so users can override them, but a later merge accidentally reintroduced the earlier call.

The first call is fully overwritten by the subsequent updates, so it is dead code — and it invites a maintainer to remove the wrong line and silently revert #4634. This PR removes the earlier call in all three exporters. No behavior change.

Type of change

  • Refactoring (no functional changes)

How Has This Been Tested?

  • Full opentelemetry-exporter-otlp-proto-http test suite passes (59 tests), including the existing tests covering user headers overriding defaults.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

The user headers were applied both before and after the default OTLP
headers. The first update is fully overwritten by the later ones, so it
is dead code; keeping it also invites accidentally reverting open-telemetry#4634,
which deliberately applies user headers after the defaults so users can
override them.
@Eason09053360
Eason09053360 marked this pull request as ready for review July 19, 2026 13:57
@Eason09053360
Eason09053360 requested a review from a team as a code owner July 19, 2026 13:57
@herin049

Copy link
Copy Markdown
Contributor

This will be addressed once #5389 is merged. Putting this on hold for now.

@herin049 herin049 added the hold label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants