-
Notifications
You must be signed in to change notification settings - Fork 397
Streamline ddsketch loading, remove circular dependencies #5008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for updating Change log entry section 👏 Visited at: 2025-11-06 13:31:16 UTC |
Typing analysisThis PR does not change typing compared to the base branch. |
BenchmarksBenchmark execution time: 2025-11-07 11:06:56 Comparing candidate commit 78bce97 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 43 metrics, 2 unstable metrics. scenario:profiling - gvl benchmark samples
|
… but tests still run" This reverts commit 76df349.
…datadog/core/ddsketch
b17d209 to
0d84417
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: 78bce97 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
|
CI is failing due to missing type declaration, I'll add it if there is consensus that this change is the way to go. |
ivoanjo
left a comment
There was a problem hiding this 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.
Co-authored-by: Ivo Anjo <[email protected]>
|
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. |
|
Oh, right, I understand. Indeed |
What does this PR do?
Changes how ddsketch / libdatadog integration is handled:
Before, there was a
lib/datadog/core/ddsketch.rbfile which contained a class-levelsupported?method. Having this file meant that you could always requiredatadog/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/corewill 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 toDatadog::Coremodule (up fromDatadog::Core::DDSketch). Meaning:Datadog::Core::DDSketchwill be not defined at all.Motivation:
Removing circular dependency: ddsketch -> core -> configuration -> ddsketch
Change log entry
None
Additional Notes:
How to test the change?
Existing CI