Skip to content

Conversation

@p-datadog
Copy link
Member

@p-datadog p-datadog commented May 12, 2025

What does this PR do?

Injects telemetry into metrics client instead of retrieving it from the components tree.

Motivation:

References to the components tree currently create the tree if it does not exist by default (allow_initialization option to components). This creation is problematic in the test suite (see #4619). Some components appear to rely on this automatic instantiation (profiling, possibly tracing), therefore removing it is non-trivial. In the meantime, metrics client can have telemetry injected into it to avoid the issue altogether (and remove what is effectively a global variable reference).

Change log entry
None

Additional Notes:

How to test the change?

Existing CI

@github-actions github-actions bot added the core Involves Datadog core libraries label May 12, 2025
@github-actions
Copy link

github-actions bot commented May 12, 2025

Thank you for updating Change log entry section 👏

Visited at: 2025-05-12 19:03:24 UTC

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented May 12, 2025

Datadog Summary

✅ Dependencies

Test Optimization Report

Branch report: components-init-metrics
Commit report: c7359b6
Test service: dd-trace-rb

✅ 0 Failed, 21254 Passed, 1377 Skipped, 3m 46.84s Total Time


Was this helpful? Give us feedback!

@codecov-commenter
Copy link

codecov-commenter commented May 12, 2025

Codecov Report

Attention: Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.76%. Comparing base (df9dba8) to head (e85c6b5).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
lib/datadog/core/metrics/client.rb 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4641      +/-   ##
==========================================
- Coverage   97.77%   97.76%   -0.01%     
==========================================
  Files        1419     1422       +3     
  Lines       86624    86703      +79     
  Branches     4397     4403       +6     
==========================================
+ Hits        84697    84769      +72     
- Misses       1927     1934       +7     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@p-datadog p-datadog marked this pull request as ready for review May 12, 2025 19:03
@p-datadog p-datadog requested a review from a team as a code owner May 12, 2025 19:03
@p-datadog p-datadog changed the title inject telemetry into metrics client DEBUG-3700 Inject telemetry into metrics client May 12, 2025
@pr-commenter
Copy link

pr-commenter bot commented May 13, 2025

Benchmarks

Benchmark execution time: 2025-05-15 15:35:48

Comparing candidate commit e85c6b5 in PR branch components-init-metrics with baseline commit df9dba8 in branch master.

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

scenario:line instrumentation - targeted

  • 🟥 throughput [-11197.199op/s; -10612.677op/s] or [-6.697%; -6.348%]

scenario:method instrumentation

  • 🟥 throughput [-12488.587op/s; -11843.119op/s] or [-6.947%; -6.588%]

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented May 13, 2025

Datadog Report

Branch report: components-init-metrics
Commit report: e85c6b5
Test service: dd-trace-rb

✅ 0 Failed, 21046 Passed, 1373 Skipped, 3m 44.83s Total Time

@p-datadog p-datadog force-pushed the components-init-metrics branch from 2251148 to 2c47270 Compare May 14, 2025 22:31
@p-datadog p-datadog requested a review from a team as a code owner May 14, 2025 22:31
@p-datadog p-datadog added this to the 2.16.0 milestone May 14, 2025
@p-datadog p-datadog merged commit 2a4e711 into master May 15, 2025
820 of 823 checks passed
@p-datadog p-datadog deleted the components-init-metrics branch May 15, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants