[part 3] refactor!(telemetry): introduce a singleton#195
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. |
dubloom
left a comment
There was a problem hiding this comment.
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.
| [](NoopTelemetry) {}, | |
| [](auto&&) {}, |
There was a problem hiding this comment.
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.
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.
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