Skip to content

Set spans as errored in AWS integration when AWS requests fail #4672

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

Merged
merged 6 commits into from
May 28, 2025

Conversation

p-datadog
Copy link
Member

@p-datadog p-datadog commented May 20, 2025

Update of #936 for current master

What does this PR do?

Original description from #936:

I noticed that when calls to AWS error out (5xx), the spans show up as green and are not marked as being an error. The http.status_code tag was however being set correctly to the 5xx status code.

In this PR, the aws/instrumentation.rb code sets the error on the span, if the status_code is in the Datadog::Ext::HTTP::ERROR_RANGE.

Motivation:

Change log entry
Yes: mark AWS integration spans as errored when AWS requests fail

Additional Notes:
At the point where AWS integration runs we do not have any textual description of the error to add to the span. We add the HTTP code (e.g. 500) and the host to which the request is made also makes it into the span.

How to test the change?
Tests are added

Copy link

github-actions bot commented May 20, 2025

Thank you for updating Change log entry section 👏

Visited at: 2025-05-28 15:02:45 UTC

@github-actions github-actions bot added integrations Involves tracing integrations tracing labels May 20, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

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

Datadog Report

Branch report: aws-set-error
Commit report: b23e21b
Test service: dd-trace-rb

✅ 0 Failed, 21700 Passed, 1299 Skipped, 4m 9.68s Total Time

@pr-commenter
Copy link

pr-commenter bot commented May 20, 2025

Benchmarks

Benchmark execution time: 2025-05-27 23:57:26

Comparing candidate commit b23e21b in PR branch aws-set-error with baseline commit ff8ae5b in branch master.

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

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.63%. Comparing base (ff8ae5b) to head (b23e21b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4672      +/-   ##
==========================================
- Coverage   97.64%   97.63%   -0.01%     
==========================================
  Files        1470     1470              
  Lines       87685    87702      +17     
  Branches     4544     4546       +2     
==========================================
+ Hits        85624    85632       +8     
- Misses       2061     2070       +9     

☔ 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.

@p-datadog p-datadog changed the title PR #936 ported to master Set spans as errored in AWS integration when AWS requests fail May 28, 2025
@p-datadog p-datadog marked this pull request as ready for review May 28, 2025 15:03
@p-datadog p-datadog requested a review from a team as a code owner May 28, 2025 15:03
@p-datadog p-datadog merged commit b76fbae into master May 28, 2025
446 checks passed
@p-datadog p-datadog deleted the aws-set-error branch May 28, 2025 15:15
@github-actions github-actions bot added this to the 2.17.0 milestone May 28, 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.

4 participants