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

DEBUG-2334 DI: method probes: pass block to target method when rate limited #4206

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

p-datadog
Copy link
Member

@p-datadog p-datadog commented Dec 9, 2024

What does this PR do?

Fixes a bug in dynamic instrumentation where once a method was instrumented with a method probe and the rate limit for the probe was reached, the block would not be passed to target method from DI.

Motivation:

Code inspection when implementing snapshot benchmarks (#4207).

Change log entry

No.

Additional Notes:

Reason: while this issue would have affected customer applications, DI has not yet been shipped.

I added many tests but could not yet reproduce the scenario where the separated calls to super were necessary as they are in the non-rate limited path. I added the separated calls in case they are indeed required.

How to test the change?

Unit tests are included.

@p-datadog p-datadog requested a review from a team as a code owner December 9, 2024 14:03
Copy link

github-actions bot commented Dec 9, 2024

👋 Hey @Strech, 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: 2024-12-10 10:05:59 UTC

spec/datadog/di/hook_method.rb Show resolved Hide resolved
spec/datadog/di/hook_method.rb Show resolved Hide resolved
spec/datadog/di/hook_method.rb Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Dec 9, 2024

Benchmarks

Benchmark execution time: 2024-12-09 14:35:22

Comparing candidate commit c7ab921 in PR branch di-rate-limit-block with baseline commit c07a8d4 in branch master.

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

scenario:tracing - 100 span trace - no writer

  • 🟩 throughput [+17.670op/s; +18.572op/s] or [+5.324%; +5.596%]

scenario:tracing - Propagation - Trace Context

  • 🟩 throughput [+4199.193op/s; +4298.031op/s] or [+12.325%; +12.616%]

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 96.29630% with 6 lines in your changes missing coverage. Please review.

Project coverage is 97.76%. Comparing base (c07a8d4) to head (c7ab921).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
spec/datadog/di/instrumenter_spec.rb 97.16% 4 Missing ⚠️
lib/datadog/di/instrumenter.rb 87.50% 1 Missing ⚠️
spec/datadog/di/hook_method.rb 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4206      +/-   ##
==========================================
- Coverage   97.77%   97.76%   -0.01%     
==========================================
  Files        1357     1357              
  Lines       81973    82120     +147     
  Branches     4168     4174       +6     
==========================================
+ Hits        80145    80285     +140     
- Misses       1828     1835       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ivoanjo ivoanjo added this to the 2.8.0 milestone Dec 9, 2024
@p-datadog p-datadog added the dev/internal Other internal work that does not need to be included in the changelog label Dec 9, 2024
@p-datadog p-datadog merged commit 18171cc into master Dec 10, 2024
349 checks passed
@p-datadog p-datadog deleted the di-rate-limit-block branch December 10, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/internal Other internal work that does not need to be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants