SymDB: Remove telemetry from Extractor#5693
Conversation
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]>
Typing analysisNote: Ignored files are excluded from the next sections.
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 0593109 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-05-08 02:02:00 Comparing candidate commit 0593109 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
|
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]>
|
Thanks for the review! |
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.
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.
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]>
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.
What does this PR do?
Removes the
telemetryparameter fromDatadog::SymbolDatabase::Extractorand 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)becomesExtractor.new(logger:, settings:). Callers passingtelemetry:will getunknown keyword: :telemetry. Master has no non-test callers ofExtractor.new— only spec files instantiate it directly — so this is contained to the tests in this PR.The
returns [] and increments telemetry when collection raisestest inextract_all's top-level rescue context is replaced withreturns [] 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?
Verification on this branch:
bundle exec steep check lib/datadog/symbol_database/extractor.rb— No type error detectedbundle exec rake standard— clean