Fix MongoDB heartbeat filtering when DD_TRACE_MONGODB_HEARTBEAT_ENABL…#5558
Fix MongoDB heartbeat filtering when DD_TRACE_MONGODB_HEARTBEAT_ENABL…#5558aitrics-ray wants to merge 4 commits intoDataDog:masterfrom
Conversation
…ED is set to 'false'
|
This is a bug fix. Could someone with write access please add the semver-patch label to this PR? Thank you! |
|
Thank you for the PR, it indeed looks like we've made a mistake here. We'll do a first draft here, and once we agree on the changes, our team will recreate this PR, as the CI is not allowed to run on external contributions. |
|
@simon-id Thanks for the response! I understand. If you need any further assistance or if there's anything else I should do, please let me know. |
|
I'd say we should also write a test for this configuration, as we're clearly missing coverage if we didn't realize the feature was not working correctly. @tlhunter |
|
ok fix is LGTM now, we should take over the rest and probably add a test |
|
Cherrypicked your commits in #5562, let's move the discussion there |
…ED is set to 'false'
What does this PR do?
This PR fixes an issue where MongoDB heartbeat traces were still being collected even when the environment variable
DD_TRACE_MONGODB_HEARTBEAT_ENABLEDwas set to 'false'. The fix properly converts the string 'false' to a boolean value to ensure the heartbeat filtering works as expected.Motivation
While testing MongoDB tracing, we discovered that setting

DD_TRACE_MONGODB_HEARTBEAT_ENABLED=falsedidn't actually disable heartbeat traces. This was because the string value 'false' is truthy in JavaScript, causing the heartbeat filtering condition to fail. This fix ensures that MongoDB monitoring heartbeats can be properly excluded from traces when users want to reduce trace volume.Plugin Checklist
Additional Notes