Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DI progress logs #4283

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

DI progress logs #4283

wants to merge 16 commits into from

Conversation

p-datadog
Copy link
Member

What does this PR do?

Motivation:

Change log entry

Additional Notes:

How to test the change?

Copy link

github-actions bot commented Jan 13, 2025

👋 Hey @p-datadog, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2025-01-14 16:40:36 UTC

@datadog-datadog-prod-us1
Copy link
Contributor

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

Datadog Report

Branch report: di-progress-logs
Commit report: 73b4959
Test service: dd-trace-rb

❌ 37 Failed (0 Known Flaky), 22043 Passed, 1476 Skipped, 5m 40.21s Total Time

❌ Failed Tests (37)

This report shows up to 5 failed tests.

  • Datadog::DI::ProbeManager#add_probe log probe when instrumentation target is missing returns false and adds probe to the pending probe list - rspec - Details

    Expand for error
     ./lib/datadog/di/probe_manager.rb:118:in 'block in Datadog::DI::ProbeManager#add_probe'
     ./lib/datadog/di/probe_manager.rb:96:in 'Monitor#synchronize'
     ./lib/datadog/di/probe_manager.rb:96:in 'Datadog::DI::ProbeManager#add_probe'
     ./spec/datadog/di/probe_manager_spec.rb:88:in 'block (5 levels) in <top (required)>'
     ./spec/spec_helper.rb:238:in 'block (2 levels) in <top (required)>'
     ./spec/spec_helper.rb:123:in 'block (2 levels) in <top (required)>'
     /usr/local/bundle/gems/webmock-3.24.0/lib/webmock/rspec.rb:39:in 'block (2 levels) in <top (required)>'
     /usr/local/bundle/gems/rspec-wait-0.0.10/lib/rspec/wait.rb:47:in 'block (2 levels) in <top (required)>'
     ------------------
     --- Caused by: ---
     ...
    
  • Datadog::DI::ProbeManager#add_probe log probe when probe is installed successfully returns true and adds probe to the installed probe list - rspec - Details

    Expand for error
     ./lib/datadog/di/probe_manager.rb:114:in 'block in Datadog::DI::ProbeManager#add_probe'
     ./lib/datadog/di/probe_manager.rb:96:in 'Monitor#synchronize'
     ./lib/datadog/di/probe_manager.rb:96:in 'Datadog::DI::ProbeManager#add_probe'
     ./spec/datadog/di/probe_manager_spec.rb:68:in 'block (5 levels) in <top (required)>'
     ./spec/spec_helper.rb:238:in 'block (2 levels) in <top (required)>'
     ./spec/spec_helper.rb:123:in 'block (2 levels) in <top (required)>'
     /usr/local/bundle/gems/webmock-3.24.0/lib/webmock/rspec.rb:39:in 'block (2 levels) in <top (required)>'
     /usr/local/bundle/gems/rspec-wait-0.0.10/lib/rspec/wait.rb:47:in 'block (2 levels) in <top (required)>'
    
  • Datadog::DI::ProbeNotifierWorker started #add_snapshot sends the snapshot - rspec - Details

    Expand for error
     ./lib/datadog/di/probe_notifier_worker.rb:237:in 'block (2 levels) in <class:ProbeNotifierWorker>'
     ./lib/datadog/di/probe_notifier_worker.rb:267:in 'Datadog::DI::ProbeNotifierWorker#maybe_send'
     ./lib/datadog/di/probe_notifier_worker.rb:76:in 'block (2 levels) in Datadog::DI::ProbeNotifierWorker#start'
     ./lib/datadog/di/probe_notifier_worker.rb:49:in 'block in Datadog::DI::ProbeNotifierWorker#start'
     ./spec/spec_helper.rb:254:in 'block in DatadogThreadDebugger#initialize'
    
  • Datadog::DI::ProbeNotifierWorker started #add_snapshot when three snapshots are added in quick succession sends two batches - rspec - Details

    Expand for error
     RSpec::Core::MultipleExceptionError
    
  • DI integration from remote config method probe received matching a loaded class and target method is invoked notifies about execution - rspec - Details

    Expand for error
     expected "di: installed log probe 11" to match /received probe from RC:/
     Diff:
     @@ -1 +1 @@
     -/received probe from RC:/
     +"di: installed log probe 11"
     
     Failure/Error: expect(block.call).to match(expected_msg)
     
       expected "di: installed log probe 11" to match /received probe from RC:/
       Diff:
     ...
    

@pr-commenter
Copy link

pr-commenter bot commented Jan 13, 2025

Benchmarks

Benchmark execution time: 2025-01-13 20:45:30

Comparing candidate commit 73b4959 in PR branch di-progress-logs with baseline commit c5924d7 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 [-11163.591op/s; -10630.986op/s] or [-6.684%; -6.365%]

scenario:method instrumentation

  • 🟥 throughput [-9984.572op/s; -9488.732op/s] or [-5.553%; -5.277%]

@p-datadog p-datadog changed the base branch from master to di-railtie January 14, 2025 16:40
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

Current draft looks reasonable, left a small note

Comment on lines +61 to +64
if %w'1 true debug'.include?(ENV['DD_TRACE_DEBUG'])
# We seem to have Datadog.logger here already
Datadog.logger.debug("di: activating code tracking")
end
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure the DD_TRACE_DEBUG check is needed -- the logger initialization is already supposed to be looking at this setting? https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/core/configuration.rb#L279 and https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/core/configuration/components.rb#L37 should take care of it.

Base automatically changed from di-railtie to master January 14, 2025 20:07
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.

3 participants