-
Notifications
You must be signed in to change notification settings - Fork 504
feat(tracing): support http client error status configuration #17095
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
Draft
quinna-h
wants to merge
13
commits into
main
Choose a base branch
from
quinna/http-client-error-codes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8f308ea
add http client error status codes
quinna-h e6a75cf
add release note + fix old http server release note
quinna-h 58f8439
add default fallback for config
quinna-h cacb078
small refactor for deduplication
quinna-h 49d59e7
add httpx and httplib test case
quinna-h fcfa00e
refactor httpx test case
quinna-h 6d26da0
check for span kind to determine whether it should be http client / h…
quinna-h d98ea98
address PR comments - refactor out into base class, and add deprecati…
quinna-h 380ce8b
fix references / imports
quinna-h dfc1eb8
preserve http server default for backward compatibility
quinna-h c161c26
fix http type check fallback
quinna-h 3061d01
Merge branch 'main' into quinna/http-client-error-codes
quinna-h a0c9aff
Merge branch 'main' into quinna/http-client-error-codes
quinna-h File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
4 changes: 4 additions & 0 deletions
4
releasenotes/notes/add-http-client-error-codes-8a5f6510061df45f.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| features: | ||
| - | | ||
| tracing: Adds ``DD_TRACE_HTTP_CLIENT_ERROR_STATUSES`` environment variable to configure list of HTTP status codes that should be considered errors when instrumenting HTTP clients. |
2 changes: 1 addition & 1 deletion
2
releasenotes/notes/support_http_client_error_status_env-acdf049c64330a20.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| --- | ||
| features: | ||
| - | | ||
| tracing: Adds ``DD_TRACE_HTTP_CLIENT_ERROR_STATUSES`` environment variable to configure the list of HTTP status codes that should be considered errors when instrumenting HTTP severs. | ||
| tracing: Adds ``DD_TRACE_HTTP_SERVER_ERROR_STATUSES`` environment variable to configure the list of HTTP status codes that should be considered errors when instrumenting HTTP servers. |
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
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
34 changes: 34 additions & 0 deletions
34
tests/snapshots/tests.contrib.httpx.test_httpx.test_custom_client_error_statuses.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| [[ | ||
| { | ||
| "name": "http.request", | ||
| "service": "tests.contrib.httpx", | ||
| "resource": "http.request", | ||
| "trace_id": 0, | ||
| "span_id": 1, | ||
| "parent_id": 0, | ||
| "type": "http", | ||
| "error": 1, | ||
| "meta": { | ||
| "_dd.p.dm": "-0", | ||
| "_dd.p.tid": "69c6d8aa00000000", | ||
| "_dd.tags.process": "entrypoint.name:pytest,entrypoint.type:script,entrypoint.workdir:project,svc.auto:tests.contrib.httpx", | ||
| "component": "httpx", | ||
| "http.method": "GET", | ||
| "http.status_code": "404", | ||
| "http.url": "http://localhost:8001/status/404", | ||
| "http.useragent": "python-httpx/x.xx.x", | ||
| "language": "python", | ||
| "out.host": "localhost", | ||
| "runtime-id": "90b215813a13422b9ee8d6073de1d5d8", | ||
| "span.kind": "client" | ||
| }, | ||
| "metrics": { | ||
| "_dd.measured": 1.0, | ||
| "_dd.top_level": 1.0, | ||
| "_dd.tracer_kr": 1.0, | ||
| "_sampling_priority_v1": 1.0, | ||
| "process_id": 21766.0 | ||
| }, | ||
| "duration": 7996583, | ||
| "start": 1774639274668166804 | ||
| }]] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that changes to this file will only have an effect if this release note has not yet been included in a stable release.