Skip to content

gotracer: set trace context in shared map for http and other protocols#1370

Merged
grcevski merged 2 commits into
open-telemetry:mainfrom
coralogix:matt/pid-tc-goroutines
Feb 27, 2026
Merged

gotracer: set trace context in shared map for http and other protocols#1370
grcevski merged 2 commits into
open-telemetry:mainfrom
coralogix:matt/pid-tc-goroutines

Conversation

@mmat11
Copy link
Copy Markdown
Contributor

@mmat11 mmat11 commented Feb 26, 2026

  • set trace context in shared map for http and other protocols
  • refactor go probes with gotracer/maps/ and gotracer/types/
  • remove unused hpack.h

@mmat11 mmat11 requested a review from a team as a code owner February 26, 2026 16:13
@mmat11 mmat11 force-pushed the matt/pid-tc-goroutines branch 2 times, most recently from 9a7d415 to e6082bc Compare February 26, 2026 16:24
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.75%. Comparing base (4d58815) to head (a4c2d78).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1370   +/-   ##
=======================================
  Coverage   43.75%   43.75%           
=======================================
  Files         310      310           
  Lines       33772    33772           
=======================================
  Hits        14777    14777           
  Misses      18044    18044           
  Partials      951      951           
Flag Coverage Δ
integration-test 21.58% <ø> (-0.01%) ⬇️
integration-test-arm 0.00% <ø> (ø)
integration-test-vm-x86_64-5.15.152 0.00% <ø> (ø)
integration-test-vm-x86_64-6.10.6 0.00% <ø> (ø)
k8s-integration-test 2.32% <ø> (+<0.01%) ⬆️
oats-test 0.00% <ø> (ø)
unittests 44.65% <ø> (+<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.

Copy link
Copy Markdown
Contributor

@rafaelroquetto rafaelroquetto left a comment

Choose a reason for hiding this comment

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

Man, these maps are complicated... but it LGTM, apart from the usage of macros - perhaps this is a good opportunity for us to migrate away from them in the code we are touching anyway, what do you think?

(I'm mostly referring to the #define <CONSTANT> statements that could be turned into enum { k_constant = X };

Comment thread bpf/gotracer/types/kafka.h Outdated
Comment thread bpf/gotracer/go_common.h Outdated
Copy link
Copy Markdown
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.

LGTM! Looks great, do you know if the overhead increased now that we check all those maps in the runtime probe?

Signed-off-by: Mattia Meleleo <mattia.meleleo@coralogix.com>
@mmat11 mmat11 force-pushed the matt/pid-tc-goroutines branch from e6082bc to fffac4f Compare February 27, 2026 12:58
@mmat11 mmat11 force-pushed the matt/pid-tc-goroutines branch from fffac4f to a4c2d78 Compare February 27, 2026 13:02
@mmat11
Copy link
Copy Markdown
Contributor Author

mmat11 commented Feb 27, 2026

This branch

  █ TOTAL RESULTS

    HTTP
    http_req_duration..............: avg=159.95µs min=65.75µs med=128.37µs max=3.31ms p(90)=251.87µs p(95)=298.67µs
      { expected_response:true }...: avg=159.95µs min=65.75µs med=128.37µs max=3.31ms p(90)=251.87µs p(95)=298.67µs
    http_req_failed................: 0.00%  0 out of 15001
    http_reqs......................: 15001  500.008854/s

    EXECUTION
    iteration_duration.............: avg=178.41µs min=80.25µs med=145.21µs max=3.88ms p(90)=276.75µs p(95)=325µs
    iterations.....................: 15001  500.008854/s
    vus............................: 1      min=0          max=1
    vus_max........................: 10     min=10         max=10

    NETWORK
    data_received..................: 2.2 MB 74 kB/s
    data_sent......................: 2.6 MB 85 kB/s

Baseline (main)

  █ TOTAL RESULTS

    HTTP
    http_req_duration..............: avg=158.91µs min=69.5µs  med=127.83µs max=3.09ms p(90)=254.5µs  p(95)=299µs
      { expected_response:true }...: avg=158.91µs min=69.5µs  med=127.83µs max=3.09ms p(90)=254.5µs  p(95)=299µs
    http_req_failed................: 0.00%  0 out of 15001
    http_reqs......................: 15001  500.016858/s

    EXECUTION
    iteration_duration.............: avg=177.54µs min=84.71µs med=145.58µs max=3.11ms p(90)=280.54µs p(95)=326.04µs
    iterations.....................: 15001  500.016858/s
    vus............................: 1      min=0          max=1
    vus_max........................: 10     min=10         max=10

    NETWORK
    data_received..................: 2.2 MB 74 kB/s
    data_sent......................: 2.6 MB 85 kB/s

I think it's pretty much the same because the benchmark doesn't hit the last map lookup in order to hit the "slowest path"

@grcevski
Copy link
Copy Markdown
Contributor

Amazing, thanks for doing the run @mmat11 !

@grcevski grcevski merged commit 4353b7e into open-telemetry:main Feb 27, 2026
67 checks passed
NimrodAvni78 pushed a commit to coralogix/opentelemetry-ebpf-instrumentation that referenced this pull request Mar 1, 2026
@MrAlias MrAlias added this to the v0.6.0 milestone Mar 2, 2026
@MrAlias MrAlias mentioned this pull request Mar 5, 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.

4 participants