Skip to content

Conversation

@rafaelroquetto
Copy link
Contributor

@rafaelroquetto rafaelroquetto commented Mar 13, 2025

Instead of relying on TC to write the Traceparent: header, leverage beyla_packet_extender at the sk_msg level to not only extend the request buffer, but also write the Traceparent: string at that level.
This ensures that the request buffer is manipulated only once, by a single ebpf program, and prevents corrupt requests that can be caused if one of the programs involved fails to attach.

The TC programs are now only responsible for writing the IP options, and only if the Traceparent: header hasn't been written by the sk_msg program. This is done because the IP injection mechanism derives the span id from the tcp seq and ack values, which are not yet available at the sk_msg level.

The TC programs will also continue to track any new sockets that haven't been picked up by the sockops program.

@rafaelroquetto rafaelroquetto added the do-not-merge WIP or something that musn't be merged label Mar 13, 2025
@codecov
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 66.98%. Comparing base (7dbd664) to head (9b7ec92).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/internal/ebpf/tctracer/tctracer.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1740      +/-   ##
==========================================
- Coverage   66.99%   66.98%   -0.02%     
==========================================
  Files         214      214              
  Lines       22241    22244       +3     
==========================================
- Hits        14901    14900       -1     
- Misses       6605     6607       +2     
- Partials      735      737       +2     
Flag Coverage Δ
integration-test 54.46% <80.00%> (+0.40%) ⬆️
k8s-integration-test 53.93% <80.00%> (-0.10%) ⬇️
oats-test 34.93% <80.00%> (+0.08%) ⬆️
unittests 43.86% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@rafaelroquetto rafaelroquetto force-pushed the beyla_packet_extender branch from 4b91a8f to a9d8c29 Compare March 13, 2025 05:56
@rafaelroquetto rafaelroquetto removed the do-not-merge WIP or something that musn't be merged label Mar 13, 2025
@rafaelroquetto rafaelroquetto changed the title WIP - extend packet at the sock msg level Extend packet at the sock msg level Mar 13, 2025
@rafaelroquetto rafaelroquetto marked this pull request as ready for review March 13, 2025 06:00
@rafaelroquetto rafaelroquetto requested a review from a team as a code owner March 13, 2025 06:00
Copy link
Contributor

@mariomac mariomac left a comment

Choose a reason for hiding this comment

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

amazing! I'd suggest backporting it to 2.0 branch

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

Looks amazing, I do have one concern about removing the sock from the map, but I might be misunderstanding the intent.

@rafaelroquetto rafaelroquetto requested a review from grcevski March 13, 2025 23:08
@rafaelroquetto rafaelroquetto force-pushed the beyla_packet_extender branch from 917c19d to 9b7ec92 Compare March 16, 2025 22:25
@rafaelroquetto
Copy link
Contributor Author

Merging as I've discussed this offline and incorporated the latest feedback.

@rafaelroquetto rafaelroquetto merged commit 5c214d4 into main Mar 16, 2025
15 checks passed
@rafaelroquetto rafaelroquetto deleted the beyla_packet_extender branch March 16, 2025 23:56
rafaelroquetto added a commit that referenced this pull request Mar 19, 2025
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