Skip to content

Conversation

@dmehala
Copy link
Collaborator

@dmehala dmehala commented Apr 23, 2025

Description

Introduce additional telemetry metrics to gain deeper insights into our tracer usage.

Introduce additional telemetry metrics to gain deeper insights into
our tracer usage.
@dmehala dmehala requested a review from a team as a code owner April 23, 2025 16:00
@dmehala dmehala requested review from dubloom, pablomartinezbernardo and zacharycmontoya and removed request for a team April 23, 2025 16:00
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 70.27027% with 22 lines in your changes missing coverage. Please review.

Project coverage is 87.01%. Comparing base (bc73b15) to head (be713f7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/datadog/telemetry/telemetry_impl.cpp 54.54% 20 Missing ⚠️
src/datadog/tracer.cpp 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
- Coverage   87.09%   87.01%   -0.08%     
==========================================
  Files          80       80              
  Lines        5084     5138      +54     
==========================================
+ Hits         4428     4471      +43     
- Misses        656      667      +11     

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

std::move(body), std::move(on_response),
std::move(on_error), clock_().tick + request_timeout_);
if (auto* error = post_result.if_error()) {
// NOTE(@dmehala): `technical` is a better kind of errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this comment mean?


void Telemetry::log_error(std::string message) {
if (!config_.report_logs) return;
increment_counter(internal_metrics::logs_created, {"level:error"});
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to do these inside the log function itself?

Copy link
Collaborator Author

@dmehala dmehala Apr 26, 2025

Choose a reason for hiding this comment

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

Because increment_counter(internal_metrics::logs_created, {"level:error"}); is more readable than increment_counter(internal_metrics::logs_created, {std::string("level:) + to_string(level)"});

};

send_telemetry("app-started", app_started());
http_client_->drain(clock_().tick + 2s);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this is here to make sure app-started is the absolute first. What is the problem if it is not the first?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Per telemetry doc:

Telemetry Lifecycle

The first event we should receive is app-started. [...]

Comment on lines 19 to 23
const telemetry::Distribution trace_chunk_size_bytes = {
"trace_chunk_serialization.bytes", "tracers", true};

const telemetry::Distribution trace_chunk_size_ms = {
"trace_chunk_serialization.ms", "tracers", true};
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: size_* -> serialization_*?

@pr-commenter
Copy link

pr-commenter bot commented Apr 30, 2025

Benchmarks

Benchmark execution time: 2025-04-30 12:35:42

Comparing candidate commit be713f7 in PR branch dmehala/moar-telemetry-metrics with baseline commit bc73b15 in branch main.

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

@dmehala dmehala merged commit 1261138 into main Apr 30, 2025
22 checks passed
@dmehala dmehala deleted the dmehala/moar-telemetry-metrics branch April 30, 2025 12:50
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