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

Rescue instrumentation errors #3951

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Rescue instrumentation errors #3951

merged 2 commits into from
Sep 26, 2024

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Sep 25, 2024

What does this PR do?

Rescue instrumentation errors.

Motivation:

During instrumentation, we often annotate the span or trace based on the data available. There are risk that the assumption of existing data are not met.

For instance,

  1. the payload from ActiveSupport::Notifications event, might not carry your expected data.
  2. The http response object responds to different methods
  3. Fail to parse an invalid string.

This PR tries to rescue them and fail gracefully. It is not a silver bullet. We still need to expand our test coverage to catch those failures (example: 93438f4)

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 88.17204% with 11 lines in your changes missing coverage. Please review.

Project coverage is 97.84%. Comparing base (2209a7c) to head (14681aa).

Files with missing lines Patch % Lines
lib/datadog/tracing/contrib/faraday/middleware.rb 20.00% 4 Missing ⚠️
lib/datadog/tracing/contrib/aws/instrumentation.rb 0.00% 2 Missing ⚠️
...adog/tracing/contrib/httpclient/instrumentation.rb 0.00% 2 Missing ⚠️
.../datadog/tracing/contrib/httprb/instrumentation.rb 0.00% 2 Missing ⚠️
lib/datadog/tracing/contrib/mongodb/subscribers.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3951      +/-   ##
==========================================
- Coverage   97.85%   97.84%   -0.01%     
==========================================
  Files        1303     1307       +4     
  Lines       78139    78229      +90     
  Branches     3894     3894              
==========================================
+ Hits        76461    76543      +82     
- Misses       1678     1686       +8     
Flag Coverage Δ
97.84% <88.17%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 25, 2024

Benchmarks

Benchmark execution time: 2024-09-25 14:34:36

Comparing candidate commit 14681aa in PR branch tonycthsu/rescue-error with baseline commit 2209a7c in branch master.

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

@TonyCTHsu TonyCTHsu marked this pull request as ready for review September 25, 2024 13:49
@TonyCTHsu TonyCTHsu requested a review from a team as a code owner September 25, 2024 13:49
@TonyCTHsu TonyCTHsu added the dev/internal Other internal work that does not need to be included in the changelog label Sep 25, 2024
@TonyCTHsu TonyCTHsu merged commit 7cfcefb into master Sep 26, 2024
196 checks passed
@TonyCTHsu TonyCTHsu deleted the tonycthsu/rescue-error branch September 26, 2024 10:31
@github-actions github-actions bot added this to the 2.4.0 milestone Sep 26, 2024
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.

3 participants