Skip to content

APMS-14883 Add option for Mongo span resource as JSON#4403

Merged
marcotc merged 1 commit into
masterfrom
mongo-resource
Apr 29, 2025
Merged

APMS-14883 Add option for Mongo span resource as JSON#4403
marcotc merged 1 commit into
masterfrom
mongo-resource

Conversation

@marcotc

@marcotc marcotc commented Feb 18, 2025

Copy link
Copy Markdown
Member

Motivation:
A MongoDB command is expected to be serialized as JSON, but we were doing Hash#to_s instead. This causes issues in the Agent and Datadog App. There's no advantage to keep using Hash#to_s, but it's a breaking change to update this since it affects the resource name of the mongo.cmd span.

Change log entry
Yes. Add MongoDB option to serialize Mongo command as a JSON (instead of Hash#to_s). The Datadog App expects the Mongo command to be a JSON, so all MongoDB users are highly encouraged to enable this option: DD_TRACE_MONGO_JSON_COMMAND=1 or c.tracing.instrument :mongo, json_command: true. This change will modify the resource name for the span mongo.cmd, which can be a breaking change for monitors and dashboards that depend on this resource name.

APMS-14883

@github-actions

github-actions Bot commented Feb 18, 2025

Copy link
Copy Markdown

Thank you for updating Change log entry section 👏

Visited at: 2025-04-24 22:03:48 UTC

@github-actions github-actions Bot added integrations Involves tracing integrations tracing labels Feb 18, 2025
@pr-commenter

pr-commenter Bot commented Feb 19, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-04-28 21:32:10

Comparing candidate commit 2997d20 in PR branch mongo-resource with baseline commit b9e1364 in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 30 metrics, 2 unstable metrics.

scenario:profiler - stack collector

  • 🟥 throughput [-154.830op/s; -153.262op/s] or [-5.442%; -5.387%]

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Feb 19, 2025

Copy link
Copy Markdown
Contributor

Datadog Report

Branch report: mongo-resource
Commit report: 2997d20
Test service: dd-trace-rb

✅ 0 Failed, 21281 Passed, 1376 Skipped, 3m 34.28s Total Time

@TonyCTHsu

Copy link
Copy Markdown
Collaborator

Lets extract mongo to its own dependency group, a similar approach can be find here: #4405

@marcotc

marcotc commented Apr 24, 2025

Copy link
Copy Markdown
Member Author

Lets extract mongo to its own dependency group, a similar approach can be find here: #4405

I tried and it adds 100+ files to this PR, so I'll do it in a follow up.

@marcotc

marcotc commented Apr 24, 2025

Copy link
Copy Markdown
Member Author

Lets extract mongo to its own dependency group, a similar approach can be find here: #4405

I tried and it adds 100+ files to this PR, so I'll do it in a follow up.

Nvm, after the rebase I notice the gemfiles changes were already done, so I'm adding it to this PR.

@codecov-commenter

codecov-commenter commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.76%. Comparing base (b9e1364) to head (2997d20).
⚠️ Report is 2813 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4403      +/-   ##
==========================================
+ Coverage   97.74%   97.76%   +0.01%     
==========================================
  Files        1412     1412              
  Lines       86256    86274      +18     
  Branches     4354     4343      -11     
==========================================
+ Hits        84315    84347      +32     
+ Misses       1941     1927      -14     

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

Comment thread spec/support/core_helpers.rb Outdated
@marcotc
marcotc marked this pull request as ready for review April 28, 2025 21:08
@marcotc
marcotc requested review from a team as code owners April 28, 2025 21:08
@marcotc marcotc self-assigned this Apr 28, 2025
@marcotc marcotc changed the title Add option for Mongo span resource as JSON APMS-14883 Add option for Mongo span resource as JSON Apr 28, 2025
@marcotc marcotc added this to the 2.16.0 milestone Apr 28, 2025
@marcotc
marcotc merged commit 96e635e into master Apr 29, 2025
@marcotc
marcotc deleted the mongo-resource branch April 29, 2025 20:09
@Strech Strech mentioned this pull request May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants