Skip to content

feat: add stampTraceHeaders kafka helper#2635

Open
delthas wants to merge 2 commits into
development/8.4from
improvement/ARSN-586/kafka-stamp-trace-headers
Open

feat: add stampTraceHeaders kafka helper#2635
delthas wants to merge 2 commits into
development/8.4from
improvement/ARSN-586/kafka-stamp-trace-headers

Conversation

@delthas

@delthas delthas commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add kafka.stampTraceHeaders(entry) to the tracing module: it returns a copy of a node-rdkafka entry with the active span's trace headers attached, or the entry unchanged when tracing is off / no span is active (so the OTEL-off path keeps its original message shape — no headers: undefined).

This replaces the lower-level traceHeadersFromCurrentContext in the public API: that function is now an internal helper, since every consumer was using it only to stamp headers onto an entry. Folding the if (headers) entry.headers = headers boilerplate into one helper removes that repetition at the call sites (backbeat has ~4).

traceHeadersFromEntry, contextFromKafkaHeaders, and startLinkedSpanFromKafkaEntry are unchanged.

Issue: ARSN-586

@bert-e

bert-e commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

Comment thread package.json
@scality scality deleted a comment from bert-e Jun 8, 2026
@bert-e

bert-e commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.94%. Comparing base (5944736) to head (a4a20c6).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           development/8.4    #2635      +/-   ##
===================================================
+ Coverage            73.92%   73.94%   +0.02%     
===================================================
  Files                  229      229              
  Lines                18480    18483       +3     
  Branches              3847     3848       +1     
===================================================
+ Hits                 13661    13667       +6     
+ Misses                4814     4811       -3     
  Partials                 5        5              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@delthas delthas requested review from a team, SylvainSenechal and benzekrimaha June 8, 2026 14:22
delthas added 2 commits June 8, 2026 16:24
Wrap traceHeadersFromCurrentContext as stampTraceHeaders(entry), which
returns a copy of the entry with the active span's trace headers attached (or
the entry unchanged when tracing is off). traceHeadersFromCurrentContext becomes
an internal helper; consumers stamp directly onto the kafka entry instead.

Issue: ARSN-586
@delthas delthas force-pushed the improvement/ARSN-586/kafka-stamp-trace-headers branch from b7efd79 to a4a20c6 Compare June 8, 2026 14:24
Comment thread package.json
@claude

claude Bot commented Jun 8, 2026

Copy link
Copy Markdown
  • Removing the traceHeadersFromCurrentContext export is a breaking API change, but the version bump is patch (8.4.5 → 8.4.6) instead of at least minor
    - Bump to 8.5.0, or keep the old function exported (deprecated) alongside the new stampTraceHeaders so downstream consumers aren't broken

    Review by Claude Code

@scality scality deleted a comment from claude Bot Jun 8, 2026
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