Skip to content

feat: re-implement go jsonrpc detector with net/rpc.Request#335

Merged
grcevski merged 10 commits into
open-telemetry:mainfrom
titaneric:feat/go-jsonrpc-v2
Jul 21, 2025
Merged

feat: re-implement go jsonrpc detector with net/rpc.Request#335
grcevski merged 10 commits into
open-telemetry:mainfrom
titaneric:feat/go-jsonrpc-v2

Conversation

@titaneric
Copy link
Copy Markdown
Contributor

@titaneric titaneric commented Jul 19, 2025

As @rafaelroquetto suggest here, I change the uprobe from http.body to jsonrpcReadRequestHeader , and remove the old implememtation completely.

This new implementation expects more robust and stable detection, and possibly resolve flaky test reported inhttps://github.com//issues/273

Special thanks for @rafaelroquetto!

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 19, 2025

Codecov Report

Attention: Patch coverage is 24.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 69.76%. Comparing base (502110d) to head (d2bf9b2).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
configs/offsets/std_inspect.go 0.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #335      +/-   ##
==========================================
- Coverage   69.82%   69.76%   -0.06%     
==========================================
  Files         213      213              
  Lines       22230    22213      -17     
==========================================
- Hits        15522    15497      -25     
- Misses       5908     5915       +7     
- Partials      800      801       +1     
Flag Coverage Δ
integration-test 56.56% <100.00%> (-0.12%) ⬇️
integration-test-arm 35.20% <100.00%> (+0.12%) ⬆️
k8s-integration-test 51.53% <100.00%> (-0.14%) ⬇️
oats-test 35.50% <100.00%> (-0.11%) ⬇️
unittests 43.25% <0.00%> (+0.06%) ⬆️

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

@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.

Good stuff!! When you remove the draft status I will approve and merge it unless @rafaelroquetto has extra comments.

@titaneric titaneric marked this pull request as ready for review July 21, 2025 10:15
@titaneric titaneric requested a review from a team as a code owner July 21, 2025 10:15
@titaneric titaneric force-pushed the feat/go-jsonrpc-v2 branch from f179ceb to dd345c3 Compare July 21, 2025 14:36
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.

LGTM, thank you so much for doing this. All I have is a bunch of nits regarding const-correctness and clarity, but the code looks good.

And I will forward your thanks to @grcevski as he's the one who actually came up with this insight in first place :)

Comment thread bpf/gotracer/go_nethttp.c Outdated
Comment thread bpf/gotracer/go_nethttp.c Outdated
Comment thread bpf/gotracer/go_nethttp.c Outdated
Comment thread bpf/gotracer/go_str.h Outdated
Comment thread bpf/gotracer/go_str.h Outdated
Comment thread configs/offsets/std_inspect.go 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.

Excellent work! I just left a small comment about a name of a function.

Comment thread bpf/gotracer/go_str.h Outdated
return 1;
}

static __always_inline u64 peak_go_str_len(const char *name, const void *base_ptr, u8 offset) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small nit, just a spelling mistake, it should be peek_go_str_len :).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed

@grcevski grcevski merged commit 6b69694 into open-telemetry:main Jul 21, 2025
16 checks passed
@MrAlias MrAlias added this to the v0.1.0 milestone Oct 30, 2025
marctc pushed a commit to grafana/opentelemetry-ebpf-instrumentation that referenced this pull request Dec 9, 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.

5 participants