Skip to content

[part 2] refactor!(telemetry): move telemetry logic from DatadogAgent#194

Merged
dmehala merged 4 commits intomainfrom
dmehala/telemetry/part-2-move-telemetry-exporter
Apr 3, 2025
Merged

[part 2] refactor!(telemetry): move telemetry logic from DatadogAgent#194
dmehala merged 4 commits intomainfrom
dmehala/telemetry/part-2-move-telemetry-exporter

Conversation

@dmehala
Copy link
Copy Markdown
Collaborator

@dmehala dmehala commented Mar 31, 2025

Description

This PR continues the work of refactoring the telemetry module to provide a clear and structured telemetry API. The goal is to make it easier for Datadog engineers to collect telemetry metrics and logs on the usage of our products.

Specifically, this PR moves the telemetry logic out of DatadogAgent and into a the telemetry module.
For reference, Part 1 of this refactoring can be found here: #166.

@dmehala dmehala requested a review from a team as a code owner March 31, 2025 09:28
@dmehala dmehala requested review from dubloom, pablomartinezbernardo and zacharycmontoya and removed request for a team March 31, 2025 09:28
@dmehala dmehala changed the title [part 2] refactor!: move telemetry logic from DatadogAgent [part 2] refactor!(telemetry): move telemetry logic from DatadogAgent Mar 31, 2025
tracer_signature_(tracer_signature),
integration_name_(integration_name),
integration_version_(integration_version),
user_metrics_(user_metrics) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Can now remove user_metrics_ from tracer_telemetry.h

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a mistake, thank you for raising this. Addressed in b493cee

Copy link
Copy Markdown
Contributor

@dubloom dubloom left a comment

Choose a reason for hiding this comment

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

This PR introduces a coupling between tracer_telemetry and telemetry which does not seem standard in comparison with the other tracers. Is there any objective or removing the tracer_telemetry later ? I would personally prefer if everything was centralized.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 3, 2025

Benchmarks

Benchmark execution time: 2025-04-03 09:49:11

Comparing candidate commit 56ddaaf in PR branch dmehala/telemetry/part-2-move-telemetry-exporter with baseline commit 67ab91f in branch main.

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

scenario:BM_TraceTinyCCSource

  • 🟥 execution_time [+1.971ms; +2.179ms] or [+2.644%; +2.923%]

@dmehala
Copy link
Copy Markdown
Collaborator Author

dmehala commented Apr 3, 2025

@dubloom the coupling in temporary. While we aim for standardization and feature parity, only public facing code and API are bound by that requirement.

@dmehala dmehala merged commit 5013321 into main Apr 3, 2025
22 checks passed
@dmehala dmehala deleted the dmehala/telemetry/part-2-move-telemetry-exporter branch April 3, 2025 09:56
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.57364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 93.38%. Comparing base (67ab91f) to head (56ddaaf).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/datadog/telemetry/telemetry.cpp 96.73% 3 Missing ⚠️
src/datadog/tracer.cpp 84.61% 2 Missing ⚠️
src/datadog/datadog_agent.cpp 80.00% 1 Missing ⚠️
src/datadog/tracer_config.cpp 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   93.15%   93.38%   +0.22%     
==========================================
  Files          76       78       +2     
  Lines        4471     4487      +16     
==========================================
+ Hits         4165     4190      +25     
+ Misses        306      297       -9     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants