Skip to content

mongo: fix bson int32 parsing#1453

Merged
mmat11 merged 1 commit into
open-telemetry:mainfrom
coralogix:matt/fix-mongo-int32
Mar 5, 2026
Merged

mongo: fix bson int32 parsing#1453
mmat11 merged 1 commit into
open-telemetry:mainfrom
coralogix:matt/fix-mongo-int32

Conversation

@mmat11
Copy link
Copy Markdown
Contributor

@mmat11 mmat11 commented Mar 4, 2026

Fix silent bug in bson int32 parsing.

The added test would previously fail:

    mongo_detect_transform_test.go:431:
        	Error Trace:	/Users/mattia.meleleo/cx/opentelemetry-ebpf-instrumentation/pkg/ebpf/common/mongo_detect_transform_test.go:431
        	Error:      	Not equal:
        	            	expected: 12345
        	            	actual  : 0
        	Test:       	TestGetMongoInfoErrorRequest
        	Messages:   	Expected ErrorCode to be 12345
--- FAIL: TestGetMongoInfoErrorRequest (0.00s)
=== RUN   TestGetMongoInfoErrorCodeFromBsonRoundTrip
    mongo_detect_transform_test.go:467:
        	Error Trace:	/Users/mattia.meleleo/cx/opentelemetry-ebpf-instrumentation/pkg/ebpf/common/mongo_detect_transform_test.go:467
        	Error:      	Not equal:
        	            	expected: 11000
        	            	actual  : 0
        	Test:       	TestGetMongoInfoErrorCodeFromBsonRoundTrip
        	Messages:   	error code must be parsed from int32 BSON value

Signed-off-by: Mattia Meleleo <mattia.meleleo@coralogix.com>
@mmat11 mmat11 requested a review from a team as a code owner March 4, 2026 15:48
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.87%. Comparing base (b2244db) to head (86a1273).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ebpf/common/mongo_detect_transform.go 11.11% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1453      +/-   ##
==========================================
- Coverage   43.93%   43.87%   -0.06%     
==========================================
  Files         313      313              
  Lines       34213    34216       +3     
==========================================
- Hits        15030    15013      -17     
- Misses      18207    18217      +10     
- Partials      976      986      +10     
Flag Coverage Δ
integration-test 21.51% <0.00%> (-0.21%) ⬇️
integration-test-arm 0.00% <0.00%> (ø)
integration-test-vm-x86_64-5.15.152 ?
integration-test-vm-x86_64-6.10.6 ?
k8s-integration-test 2.29% <0.00%> (+<0.01%) ⬆️
oats-test 0.00% <0.00%> (ø)
unittests 44.86% <11.11%> (-0.04%) ⬇️

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.

@mmat11 mmat11 merged commit 74343b5 into open-telemetry:main Mar 5, 2026
66 of 67 checks passed
@mmat11 mmat11 deleted the matt/fix-mongo-int32 branch March 5, 2026 10:17
@MrAlias MrAlias added this to the v0.6.0 milestone Mar 5, 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