Skip to content

Add typing for Remote::Dispatcher and Telemetry Worker/Events#5451

Draft
marcotc wants to merge 1 commit intomasterfrom
marcotc/type-core-remote-telemetry
Draft

Add typing for Remote::Dispatcher and Telemetry Worker/Events#5451
marcotc wants to merge 1 commit intomasterfrom
marcotc/type-core-remote-telemetry

Conversation

@marcotc
Copy link
Member

@marcotc marcotc commented Mar 13, 2026

What does this PR do?
Removes untyped from Remote::Dispatcher, Telemetry::Worker, and Telemetry::Event::AppDependenciesLoaded.

Motivation:
Replaces untyped with precise types determined from the source.

Change log entry
None.

Additional Notes:

  • Remote::Dispatcher#dispatch: -> untyped-> void (method calls receivers.each for its side effect; return is unused by callers).
  • Telemetry::Event::AppDependenciesLoaded#payload: { dependencies: untyped }{ dependencies: Array[Hash[Symbol, String]] } (matches the typed dependencies private method already in the sig).
  • Telemetry::Worker#buffer_klass: -> untyped-> singleton(Core::Buffer::Random) (returns either CRuby or ThreadSafe, both subclasses of Random; this lets Steep verify .new(@buffer_size) call).
  • SynthAppClientConfigurationChange#payload fields left as untyped — they delegate to complex AppStarted payload structure.

How to test the change?

bundle exec steep check lib/datadog/core/remote/dispatcher.rb lib/datadog/core/telemetry/event/app_dependencies_loaded.rb lib/datadog/core/telemetry/worker.rb

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marcotc marcotc added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Mar 13, 2026
@github-actions
Copy link

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR clears 2 untyped methods and 1 partially typed method. It increases the percentage of typed methods from 61.14% to 61.29% (+0.15%).

Untyped methods (+0-2)Cleared:
sig/datadog/core/telemetry/event/app_dependencies_loaded.rbs:8
└── def payload: () -> { dependencies: untyped }
sig/datadog/core/telemetry/worker.rbs:61
└── def buffer_klass: () -> untyped
Partially typed methods (+0-1)Cleared:
sig/datadog/core/remote/dispatcher.rbs:9
└── def dispatch: (Remote::Configuration::Repository::ChangeSet changes, Remote::Configuration::Repository repository) -> untyped

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Mar 13, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 95.15% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 93d2911 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Mar 13, 2026

Benchmarks

Benchmark execution time: 2026-03-13 20:09:43

Comparing candidate commit 93d2911 in PR branch marcotc/type-core-remote-telemetry with baseline commit 6b340a0 in branch master.

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

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

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant