Merged
Conversation
szokeasaurusrex
approved these changes
Jul 9, 2024
Member
szokeasaurusrex
left a comment
There was a problem hiding this comment.
Looks good, please consider suggestions before merging
| """ | ||
|
|
||
|
|
||
| class SPANSTATUS: |
Comment on lines
+164
to
+188
| elif 400 <= http_status_code < 500: | ||
| if http_status_code == 403: | ||
| return SPANSTATUS.PERMISSION_DENIED | ||
| elif http_status_code == 404: | ||
| return SPANSTATUS.NOT_FOUND | ||
| elif http_status_code == 429: | ||
| return SPANSTATUS.RESOURCE_EXHAUSTED | ||
| elif http_status_code == 413: | ||
| return SPANSTATUS.FAILED_PRECONDITION | ||
| elif http_status_code == 401: | ||
| return SPANSTATUS.UNAUTHENTICATED | ||
| elif http_status_code == 409: | ||
| return SPANSTATUS.ALREADY_EXISTS | ||
| else: | ||
| return SPANSTATUS.INVALID_ARGUMENT | ||
|
|
||
| elif 500 <= http_status_code < 600: | ||
| if http_status_code == 504: | ||
| return SPANSTATUS.DEADLINE_EXCEEDED | ||
| elif http_status_code == 501: | ||
| return SPANSTATUS.UNIMPLEMENTED | ||
| elif http_status_code == 503: | ||
| return SPANSTATUS.UNAVAILABLE | ||
| else: | ||
| return SPANSTATUS.INTERNAL_ERROR |
Member
There was a problem hiding this comment.
Would be nice to sort the if statements in increasing order by status code. Although, perhaps this would better belong in a separate PR
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3261 +/- ##
==========================================
+ Coverage 79.36% 79.39% +0.03%
==========================================
Files 132 132
Lines 14227 14247 +20
Branches 2987 2988 +1
==========================================
+ Hits 11291 11312 +21
Misses 2092 2092
+ Partials 844 843 -1
|
Contributor
Author
|
Thanks for the quick review @szokeasaurusrex |
arjennienhuis
pushed a commit
to arjennienhuis/sentry-python
that referenced
this pull request
Sep 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Having the Sentry span statuses in a class and introducing
get_span_status_from_http_code(). This will be used in our new OpenTelementry instrumentation.General Notes
Thank you for contributing to
sentry-python!Please add tests to validate your changes, and lint your code using
tox -e linters.Running the test suite on your PR might require maintainer approval. Some tests (AWS Lambda) additionally require a maintainer to add a special label to run and will fail if the label is not present.
For maintainers
Sensitive test suites require maintainer review to ensure that tests do not compromise our secrets. This review must be repeated after any code revisions.
Before running sensitive test suites, please carefully check the PR. Then, apply the
Trigger: tests using secretslabel. The label will be removed after any code changes to enforce our policy requiring maintainers to review all code revisions before running sensitive tests.