-
Notifications
You must be signed in to change notification settings - Fork 15
[part 3] refactor!(telemetry): introduce a singleton #195
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
Conversation
BenchmarksBenchmark execution time: 2025-04-03 10:07:39 Comparing candidate commit 6b62265 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
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.
Overall LGTM, just some small comments
| std::visit( | ||
| details::Overload{ | ||
| [&](Telemetry& telemetry) { telemetry.send_app_started(conf); }, | ||
| [](NoopTelemetry) {}, |
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.
| [](NoopTelemetry) {}, | |
| [](auto&&) {}, |
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.
That's on purpose. While auto&& acts as a sink, I prefer the explicitness of the implementation. It reduces the risk of errors if someone, for any reason, decides to add a new value to the variant.
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.
Do we want to do the same in the below implementations ? Or the goal is to show the two versions ?
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.
Good catch, that's a mistake on my end
The introduction of a singleton for the telemetry modules allow external usage outside of the tracer API to access the same instance. This change also simplified internal telemetry usage.
Co-authored-by: pablomartinezbernardo <134320516+pablomartinezbernardo@users.noreply.github.com>
b37bfdc to
36a0cd6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
==========================================
- Coverage 93.38% 90.30% -3.08%
==========================================
Files 78 80 +2
Lines 4487 4621 +134
==========================================
- Hits 4190 4173 -17
- Misses 297 448 +151 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This is Part 3 of the telemetry module refactoring. This PR introduces a singleton for the telemetry module, allowing external usage outside of the tracer API while ensuring all components access the same instance. Additionally, this change simplifies internal telemetry usage.
For reference:
DatadogAgent#194