Skip to content

Conversation

@p-datadog
Copy link
Member

@p-datadog p-datadog commented Oct 29, 2025

What does this PR do?
Changes how ddsketch / libdatadog integration is handled:

Before, there was a lib/datadog/core/ddsketch.rb file which contained a class-level supported? method. Having this file meant that you could always require datadog/core/ddsketch, but you wouldn't always get a functional ddsketch out of that require.

The proposed change is to delete this file completely. Loading datadog/core will attempt to bring in ddsketch (and this is already behavior in master), therefore no additional require is needed for ddsketch.

To check for ddsketch presence, the supported? method was moved up to Datadog::Core module (up from Datadog::Core::DDSketch). Meaning:

  1. if ddsketch is not supported, Datadog::Core::DDSketch will be not defined at all.
  2. one does not need to require ddsketch to see if it's supported.

Motivation:
Removing circular dependency: ddsketch -> core -> configuration -> ddsketch

Change log entry
None

Additional Notes:

How to test the change?
Existing CI

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Thank you for updating Change log entry section 👏

Visited at: 2025-11-06 13:31:16 UTC

@github-actions github-actions bot added core Involves Datadog core libraries integrations Involves tracing integrations tracing labels Oct 29, 2025
@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Typing analysis

This PR does not change typing compared to the base branch.

@pr-commenter
Copy link

pr-commenter bot commented Oct 29, 2025

Benchmarks

Benchmark execution time: 2025-11-07 11:06:56

Comparing candidate commit 78bce97 in PR branch core-libdatadog-dep with baseline commit 4d6369e in branch master.

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

scenario:profiling - gvl benchmark samples

  • 🟥 throughput [-733.678op/s; -722.403op/s] or [-5.574%; -5.488%]

@p-datadog p-datadog force-pushed the core-libdatadog-dep branch from b17d209 to 0d84417 Compare November 5, 2025 21:48
@datadog-official
Copy link

datadog-official bot commented Nov 5, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Total Coverage: 98.53% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 78bce97 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@p-datadog p-datadog marked this pull request as ready for review November 6, 2025 13:36
@p-datadog p-datadog requested review from a team as code owners November 6, 2025 13:36
@p-datadog p-datadog requested a review from vpellan November 6, 2025 13:36
@p-datadog
Copy link
Member Author

CI is failing due to missing type declaration, I'll add it if there is consensus that this change is the way to go.

Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

👍 So I think this change is fine, but I'm curious -- where is the circular dependency again?

You listed

Removing circular dependency: ddsketch -> core -> configuration -> ddsketch

But... lib/datadog/core/ddsketch.rb did not require anything before, so I'm not sure where the circular dependency again? I played with the master branch before a bit and I could not see any circular require warnings.

@p-datadog
Copy link
Member Author

The technical circular dependency was removed in 43e1f23#diff-6566ed78aec0d0209e0f3b7776e7db57d4694f438d12d3b6b9312f1209bfd994L3, specifically the require of 'datadog/core' from 'datadog/core/ddsketch'. However, 'datadog/core/ddsketch' still references Datadog::Core, but now without the require being present.

So, technically, the circular dependency is there, but not in 'require' form at the moment.

@ivoanjo
Copy link
Member

ivoanjo commented Nov 7, 2025

Oh, right, I understand. Indeed Datadog::Core::DDSketch.supported? would break unless core was loaded.

@p-datadog p-datadog requested a review from ericfirth November 7, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants