Skip to content

Conversation

grcevski
Copy link
Contributor

The Java route harvester was parsing the output from the JVM with a scanner which is by default limited to 64K. On larger Java applications this buffer limit may not be enough for all symbols, so instead of extending the scanner to another limit, I re-wrote the code to directly parse the output buffer.

I also improved the loop that handles the partial Java routes by reducing the allocations required and I added an extra test for the edge case where the optimisation may not work:

Prior benchmark results:

goos: linux
goarch: amd64
pkg: go.opentelemetry.io/obi/pkg/components/transform/route
cpu: 12th Gen Intel(R) Core(TM) i7-1280P
BenchmarkPartialRouteMatcherSimple-20     	 1177230	       964.7 ns/op	     736 B/op	      20 allocs/op
BenchmarkPartialRouteMatcherComplex-20    	  355447	      3185 ns/op	    2040 B/op	      32 allocs/op

New benchmark results:

goos: linux
goarch: amd64
pkg: go.opentelemetry.io/obi/pkg/components/transform/route
cpu: 12th Gen Intel(R) Core(TM) i7-1280P
BenchmarkPartialRouteMatcherSimple-20     	 1369430	       833.6 ns/op	     496 B/op	      11 allocs/op
BenchmarkPartialRouteMatcherComplex-20    	  454360	      2606 ns/op	    1016 B/op	      12 allocs/op

@grcevski grcevski requested a review from a team as a code owner September 16, 2025 22:13
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.48%. Comparing base (b523ed4) to head (aec664a).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
pkg/components/transform/route/part_matcher.go 76.47% 3 Missing and 1 partial ⚠️
pkg/components/transform/route/harvest/java.go 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
- Coverage   61.52%   61.48%   -0.04%     
==========================================
  Files         199      199              
  Lines       22086    22111      +25     
==========================================
+ Hits        13588    13596       +8     
- Misses       7527     7539      +12     
- Partials      971      976       +5     
Flag Coverage Δ
integration-test-arm 34.43% <0.00%> (-0.11%) ⬇️
k8s-integration-test-1861- ?
k8s-integration-test-1893- 49.96% <0.00%> (?)
oats-test 37.16% <85.00%> (+0.03%) ⬆️

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

LGTM!!

@grcevski grcevski merged commit 779450a into open-telemetry:main Sep 17, 2025
19 checks passed
@grcevski grcevski deleted the improve_harvesting branch September 17, 2025 14:17
carsontham pushed a commit to carsontham/opentelemetry-ebpf-instrumentation that referenced this pull request Sep 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.

2 participants