Skip to content

Fix:Rails Runner instrumentation #4681

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix:Rails Runner instrumentation #4681

wants to merge 5 commits into from

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented May 22, 2025

What does this PR do?
The Rails Runner instrumentation was being loaded too late, effectively not being able to create its spans.

Change log entry
Yes. The Rails Runner instrumentation has been fixed, and should now create Rails Runner spans.

How to test the change?
All changes have tests. And this time, they reflect a real Rails setup.

@marcotc marcotc self-assigned this May 22, 2025
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels May 22, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

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

Datadog Report

Branch report: fix-runner
Commit report: 1fd6d88
Test service: dd-trace-rb

❌ 1 Failed (0 Known Flaky), 20935 Passed, 1298 Skipped, 4m 14.73s Total Time

❌ Failed Tests (1)

  • Datadog::Tracing::Contrib::Rails::Runner with a file path with an error reading the source file creates an error span - rspec - Details

    Expand for error
     expected LoadError but nothing was raised
     
     Failure/Error: expect { run }.to raise_error(LoadError)
       expected LoadError but nothing was raised
     ./spec/datadog/tracing/contrib/rails/runner_spec.rb:102:in 'block (4 levels) in <top (required)>'
     ./spec/datadog/tracing/contrib/rails/runner_spec.rb:67:in 'block (4 levels) in <top (required)>'
     ./spec/datadog/tracing/contrib/rails/runner_spec.rb:62:in 'block (3 levels) in <top (required)>'
     ./spec/datadog/tracing/contrib/rails/support/base.rb:65:in 'block (3 levels) in <top (required)>'
     /usr/local/bundle/gems/climate_control-1.2.0/lib/climate_control.rb:24:in 'block in ClimateControl#modify'
     /usr/local/bundle/gems/climate_control-1.2.0/lib/climate_control.rb:15:in 'Monitor#synchronize'
     ...
    

@pr-commenter
Copy link

pr-commenter bot commented May 22, 2025

Benchmarks

Benchmark execution time: 2025-05-27 22:53:57

Comparing candidate commit 1fd6d88 in PR branch fix-runner with baseline commit ff8ae5b in branch master.

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

scenario:error - error tracking with http - third_party only

  • 🟥 throughput [-106.808op/s; -97.339op/s] or [-97.438%; -88.799%]

@marcotc marcotc marked this pull request as ready for review May 22, 2025 14:57
@marcotc marcotc requested review from a team as code owners May 22, 2025 14:57
@marcotc marcotc added this to the 2.17.0 milestone May 22, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2025

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 97.64%. Comparing base (ff8ae5b) to head (d6820b1).

Files with missing lines Patch % Lines
lib/datadog/tracing/contrib/rails/runner.rb 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4681      +/-   ##
==========================================
- Coverage   97.64%   97.64%   -0.01%     
==========================================
  Files        1470     1470              
  Lines       87685    87683       -2     
  Branches     4544     4540       -4     
==========================================
- Hits        85624    85615       -9     
- Misses       2061     2068       +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.

Copy link
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

Awesome 👏🏼

@p-datadog p-datadog modified the milestones: 2.17.0, 2.18.0 Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants