Skip to content

fix(Telemetry): Improve baggage relay tests#231

Open
emyller wants to merge 1 commit into
mainfrom
fix/missing-baggage-test
Open

fix(Telemetry): Improve baggage relay tests#231
emyller wants to merge 1 commit into
mainfrom
fix/missing-baggage-test

Conversation

@emyller

@emyller emyller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Contributes [indirectly] to https://github.com/Flagsmith/flagsmith-private/issues/152

Improve test coverage of W3C Baggage relaying behaviour by ensuring that:

  • OTel's baggage.get_baggage() consumes baggage from Django requests
  • Baggage is echoed in logs emitted in the request span

@emyller emyller self-assigned this Jun 10, 2026
@emyller emyller requested a review from a team as a code owner June 10, 2026 00:32
@emyller emyller requested review from khvn26 and removed request for a team June 10, 2026 00:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds integration tests to verify that baggage headers in Django requests are correctly extracted to the OpenTelemetry context and propagated to log attributes. The feedback suggests wrapping the context attachment and detachment in a try...finally block to prevent test pollution in case of failures.

Comment thread tests/integration/core/test_otel.py
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.40%. Comparing base (3ed4d29) to head (7aa35fe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   97.39%   97.40%   +0.01%     
==========================================
  Files         105      105              
  Lines        4600     4618      +18     
==========================================
+ Hits         4480     4498      +18     
  Misses        120      120              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants