Skip to content

SymDB: Remove telemetry from Extractor#5693

Merged
p-datadog merged 3 commits into
masterfrom
symdb-extractor-remove-telemetry
May 8, 2026
Merged

SymDB: Remove telemetry from Extractor#5693
p-datadog merged 3 commits into
masterfrom
symdb-extractor-remove-telemetry

Conversation

@p-datadog

Copy link
Copy Markdown
Member

What does this PR do?

Removes the telemetry parameter from Datadog::SymbolDatabase::Extractor and the two @telemetry&.inc(...) counter calls in Extractor's top-level rescue blocks. The rescue blocks still log at debug level.

Constructor change: Extractor.new(logger:, settings:, telemetry: nil) becomes Extractor.new(logger:, settings:). Callers passing telemetry: will get unknown keyword: :telemetry. Master has no non-test callers of Extractor.new — only spec files instantiate it directly — so this is contained to the tests in this PR.

The returns [] and increments telemetry when collection raises test in extract_all's top-level rescue context is replaced with returns [] and logs when collection raises — same coverage of the rescue path, asserting on the log message instead of the dropped telemetry counter.

Motivation:

Telemetry reporting for symbol database extraction is moving to Component (the orchestrator that decides when to extract and what to do with failures), so Extractor itself no longer needs to depend on telemetry.

Extracted from #5431 to land the change independently of the broader symbol-database upload work.

Change log entry

None.

How to test the change?

bundle exec rspec spec/datadog/symbol_database/extractor_spec.rb

Verification on this branch:

  • 124 examples, 0 failures
  • bundle exec steep check lib/datadog/symbol_database/extractor.rb — No type error detected
  • bundle exec rake standard — clean

Drops the +telemetry+ constructor parameter and the two
+@telemetry&.inc(...)+ counter calls in Extractor's top-level rescue
blocks. Telemetry reporting for symbol database extraction is moving
to Component (the orchestrator that decides when to extract and what
to do with failures), so Extractor itself no longer needs to depend
on telemetry. The rescue blocks still log at debug level.

Constructor change: +Extractor.new(logger:, settings:, telemetry: nil)+
becomes +Extractor.new(logger:, settings:)+. Callers passing
+telemetry:+ will get +unknown keyword: :telemetry+. Master has no
non-test callers of Extractor.new — only spec files instantiate it
directly — so this is contained to the tests in this PR.

The +returns [] and increments telemetry when collection raises+ test
in extract_all_spec is replaced with +returns [] and logs when
collection raises+ — same coverage of the rescue path, asserting on
the log message instead of the dropped telemetry counter.

Extracted from #5431 to land the telemetry removal independently of
the broader symbol-database upload work.

Verification:
- bundle exec rspec spec/datadog/symbol_database/extractor_spec.rb
  → 124 examples, 0 failures
- bundle exec steep check lib/datadog/symbol_database/extractor.rb
  → No type error detected.
- bundle exec rake standard → clean

Co-Authored-By: Claude <[email protected]>
@p-datadog
p-datadog requested a review from a team as a code owner May 6, 2026 19:28
@p-datadog p-datadog 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 May 6, 2026
@dd-octo-sts

dd-octo-sts Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

steep:ignore comments

This PR introduces 12 steep:ignore comments, and clears 12 steep:ignore comments.

steep:ignore comments (+12-12)Introduced:
lib/datadog/symbol_database/extractor.rb:245
lib/datadog/symbol_database/extractor.rb:257
lib/datadog/symbol_database/extractor.rb:271
lib/datadog/symbol_database/extractor.rb:416
lib/datadog/symbol_database/extractor.rb:527
lib/datadog/symbol_database/extractor.rb:557
lib/datadog/symbol_database/extractor.rb:650
lib/datadog/symbol_database/extractor.rb:714
lib/datadog/symbol_database/extractor.rb:715
lib/datadog/symbol_database/extractor.rb:795
lib/datadog/symbol_database/extractor.rb:796
lib/datadog/symbol_database/extractor.rb:844
Cleared:
lib/datadog/symbol_database/extractor.rb:254
lib/datadog/symbol_database/extractor.rb:266
lib/datadog/symbol_database/extractor.rb:280
lib/datadog/symbol_database/extractor.rb:425
lib/datadog/symbol_database/extractor.rb:536
lib/datadog/symbol_database/extractor.rb:566
lib/datadog/symbol_database/extractor.rb:659
lib/datadog/symbol_database/extractor.rb:723
lib/datadog/symbol_database/extractor.rb:724
lib/datadog/symbol_database/extractor.rb:804
lib/datadog/symbol_database/extractor.rb:805
lib/datadog/symbol_database/extractor.rb:853

Untyped methods

This PR introduces 1 untyped method and 7 partially typed methods, and clears 1 untyped method and 7 partially typed methods.

Untyped methods (+1-1)Introduced:
sig/datadog/symbol_database/extractor.rbs:13
└── def initialize: (logger: untyped, settings: untyped) -> void
Cleared:
sig/datadog/symbol_database/extractor.rbs:14
└── def initialize: (logger: untyped, settings: untyped, ?telemetry: untyped?) -> void
Partially typed methods (+7-7)Introduced:
sig/datadog/symbol_database/extractor.rbs:37
└── def build_class_language_specifics: (Class klass) -> Hash[::Symbol, untyped]
sig/datadog/symbol_database/extractor.rbs:51
└── def collect_extractable_modules: () -> Hash[String, untyped]
sig/datadog/symbol_database/extractor.rbs:53
└── def group_methods_by_file: (Module mod) -> Hash[String, Array[untyped]]
sig/datadog/symbol_database/extractor.rbs:55
└── def build_file_trees: (Hash[String, untyped] entries) -> Hash[String, untyped]
sig/datadog/symbol_database/extractor.rbs:57
└── def place_in_tree: (untyped root, Array[String] name_parts, Module mod, String mod_name, Array[untyped] methods, String file_path) -> void
sig/datadog/symbol_database/extractor.rbs:61
└── def convert_trees_to_scopes: (Hash[String, untyped] file_trees) -> Array[Scope]
sig/datadog/symbol_database/extractor.rbs:63
└── def convert_node_to_scope: (untyped node) -> Scope
Cleared:
sig/datadog/symbol_database/extractor.rbs:38
└── def build_class_language_specifics: (Class klass) -> Hash[::Symbol, untyped]
sig/datadog/symbol_database/extractor.rbs:52
└── def collect_extractable_modules: () -> Hash[String, untyped]
sig/datadog/symbol_database/extractor.rbs:54
└── def group_methods_by_file: (Module mod) -> Hash[String, Array[untyped]]
sig/datadog/symbol_database/extractor.rbs:56
└── def build_file_trees: (Hash[String, untyped] entries) -> Hash[String, untyped]
sig/datadog/symbol_database/extractor.rbs:58
└── def place_in_tree: (untyped root, Array[String] name_parts, Module mod, String mod_name, Array[untyped] methods, String file_path) -> void
sig/datadog/symbol_database/extractor.rbs:62
└── def convert_trees_to_scopes: (Hash[String, untyped] file_trees) -> Array[Scope]
sig/datadog/symbol_database/extractor.rbs:64
└── def convert_node_to_scope: (untyped node) -> Scope

Untyped other declarations

This PR clears 1 untyped other declaration. It increases the percentage of typed other declarations from 78.12% to 78.17% (+0.05%).

Untyped other declarations (+0-1)Cleared:
sig/datadog/symbol_database/extractor.rbs:12
└── @telemetry: untyped?

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented May 6, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.24% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0593109 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented May 6, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-08 02:02:00

Comparing candidate commit 0593109 in PR branch symdb-extractor-remove-telemetry with baseline commit 2280d85 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 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 ----------------------------------'

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 LGTM

Comment thread lib/datadog/symbol_database/extractor.rb Outdated
p-datadog and others added 2 commits May 7, 2026 21:34
The 3-line paragraph explaining that the class is constructed by Component
with injected dependencies and uses @logger / @settings directly restated
information that the constructor signature on the next page already conveys.
The reviewer flagged this paragraph for being more verbose than the code
it describes.

Address review comment 3199943345.

- Removed lib/datadog/symbol_database/extractor.rb:12-15

Co-Authored-By: Claude <[email protected]>
@p-datadog

Copy link
Copy Markdown
Member Author

Thanks for the review!

@p-datadog
p-datadog merged commit f0be2db into master May 8, 2026
575 of 586 checks passed
@p-datadog
p-datadog deleted the symdb-extractor-remove-telemetry branch May 8, 2026 05:00
@dd-octo-sts dd-octo-sts Bot added this to the 2.33.0 milestone May 8, 2026
p-datadog pushed a commit that referenced this pull request May 8, 2026
Fix three issues identified in di-pr-review:

1. extractor_spec.rb:1809 — class fixture name mismatch.
   `class ExtractAllInjectableTest` was the pre-rename name; the
   test references `ExtractAllTargetableTest` post-rename (#5692).
   The mismatch was introduced by `git merge --squash -X theirs`,
   which favored the branch's pre-rename version on conflict while
   the surrounding references use master's renamed version. Tests
   were unrunnable as written. Renamed the fixture class to match.

2. integration_spec.rb:90, 115 — code comments still said "Injectable
   lines" while referencing `targetable_lines` / `targetable_lines?`
   methods. Updated comments.

3. component.rb:52, 56 — added YARD docs for the class methods
   `uploaded_this_process?` and `mark_uploaded` for consistency with
   the rest of the file's documentation style.

Not addressed (intentional):

- Sleep usage in component_spec.rb — used for negative-assertion
  tests ("verify nothing happens given X seconds"). Comments
  justify duration; the cleanest deterministic alternative would
  require adding a "scheduler decision made" hook to production
  code, which is scope expansion beyond this PR.

- Missing telemetry in component.rb / remote.rb rescue blocks —
  matches the established SymDB direction (#5693 explicitly
  removed telemetry from Extractor). Adding telemetry here would
  contradict the recent project decision.
p-datadog pushed a commit that referenced this pull request May 11, 2026
Fix three issues identified in di-pr-review:

1. extractor_spec.rb:1809 — class fixture name mismatch.
   `class ExtractAllInjectableTest` was the pre-rename name; the
   test references `ExtractAllTargetableTest` post-rename (#5692).
   The mismatch was introduced by `git merge --squash -X theirs`,
   which favored the branch's pre-rename version on conflict while
   the surrounding references use master's renamed version. Tests
   were unrunnable as written. Renamed the fixture class to match.

2. integration_spec.rb:90, 115 — code comments still said "Injectable
   lines" while referencing `targetable_lines` / `targetable_lines?`
   methods. Updated comments.

3. component.rb:52, 56 — added YARD docs for the class methods
   `uploaded_this_process?` and `mark_uploaded` for consistency with
   the rest of the file's documentation style.

Not addressed (intentional):

- Sleep usage in component_spec.rb — used for negative-assertion
  tests ("verify nothing happens given X seconds"). Comments
  justify duration; the cleanest deterministic alternative would
  require adding a "scheduler decision made" hook to production
  code, which is scope expansion beyond this PR.

- Missing telemetry in component.rb / remote.rb rescue blocks —
  matches the established SymDB direction (#5693 explicitly
  removed telemetry from Extractor). Adding telemetry here would
  contradict the recent project decision.
p-datadog pushed a commit to p-datadog/dd-trace-rb that referenced this pull request May 11, 2026
Removes the `telemetry` parameter from `Datadog::SymbolDatabase::ScopeBatcher`
and the three `@telemetry&.report(...)` calls in its rescue blocks
(`add_scope`, `timer_loop`, `perform_upload`). The rescue blocks still log
at debug level.

Constructor change: `ScopeBatcher.new(uploader, logger:, telemetry: nil,
on_upload: nil, timer_enabled: true)` becomes `ScopeBatcher.new(uploader,
logger:, on_upload: nil, timer_enabled: true)`. Master has no non-test
callers of `ScopeBatcher.new` — only its spec instantiates it directly —
so this is contained to the tests in this PR.

The three "logs and reports telemetry without propagating" / "logs and
reports telemetry without crashing" rescue-path tests are rewritten to
assert on the log message only (the dropped telemetry assertion).

Motivation: matches the SymDB direction set by DataDog#5693 (telemetry removal
from Extractor). Telemetry reporting for internal SymDB lifecycle errors
is being replaced by debug-level logging; only the upload boundary
(Uploader) retains telemetry reporting.

Extracted from DataDog#5717.

Verification:
- bundle exec rspec spec/datadog/symbol_database/scope_batcher_spec.rb
  → 30 examples, 0 failures
- bundle exec steep check lib/datadog/symbol_database/scope_batcher.rb
  → No type error detected
- bundle exec standardrb lib/datadog/symbol_database/scope_batcher.rb
  spec/datadog/symbol_database/scope_batcher_spec.rb → clean

Co-Authored-By: Claude <[email protected]>
p-datadog pushed a commit that referenced this pull request May 11, 2026
Fix three issues identified in di-pr-review:

1. extractor_spec.rb:1809 — class fixture name mismatch.
   `class ExtractAllInjectableTest` was the pre-rename name; the
   test references `ExtractAllTargetableTest` post-rename (#5692).
   The mismatch was introduced by `git merge --squash -X theirs`,
   which favored the branch's pre-rename version on conflict while
   the surrounding references use master's renamed version. Tests
   were unrunnable as written. Renamed the fixture class to match.

2. integration_spec.rb:90, 115 — code comments still said "Injectable
   lines" while referencing `targetable_lines` / `targetable_lines?`
   methods. Updated comments.

3. component.rb:52, 56 — added YARD docs for the class methods
   `uploaded_this_process?` and `mark_uploaded` for consistency with
   the rest of the file's documentation style.

Not addressed (intentional):

- Sleep usage in component_spec.rb — used for negative-assertion
  tests ("verify nothing happens given X seconds"). Comments
  justify duration; the cleanest deterministic alternative would
  require adding a "scheduler decision made" hook to production
  code, which is scope expansion beyond this PR.

- Missing telemetry in component.rb / remote.rb rescue blocks —
  matches the established SymDB direction (#5693 explicitly
  removed telemetry from Extractor). Adding telemetry here would
  contradict the recent project decision.
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.

3 participants