contrib/http/net: adding integration-level option to configure error codes#3012
Conversation
BenchmarksBenchmark execution time: 2025-01-08 15:46:21 Comparing candidate commit 031dbfc in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics. |
Co-authored-by: Mikayla Toffler <[email protected]>
Datadog ReportBranch report: ✅ 0 Failed, 2996 Passed, 24 Skipped, 2m 32.75s Total Time |
There was a problem hiding this comment.
System test is failing because, with your changes, DD_TRACE_HTTP_SERVER_ERROR_STATUSES no longer applies to net/http.
When set, DD_TRACE_HTTP_SERVER_ERROR_STATUSES should impact all http integrations — this is kind of best effort, but for the purposes of this integration, let's say DD_TRACE_HTTP_SERVER_ERROR_STATUSES should impact all integrations that use contrib/internal/httptrace to start/finish spans.
However, if both DD_TRACE_HTTP_SERVER_ERROR_STATUSES and integration-level config WithStatusCheck are set, the former loses its effect and only the latter applies.
Make sure the system test passes by making sure DD_TRACE_HTTP_SERVER_ERROR_STATUSES applies to the net/http integration when WithStatusCheck has not been called. Take a look at contrib/go-chi for hints.
mtoffl01
left a comment
There was a problem hiding this comment.
LGTM, but make sure the PR title conforms to Go standards: https://github.com/DataDog/dd-trace-go/blob/main/CONTRIBUTING.md#contributing
mtoffl01
left a comment
There was a problem hiding this comment.
Tiny nit, but really good work, good to merge!
|
@rachelyangdog @mtoffl01 Should we merge this? |
…rror codes (#3012) Co-authored-by: Mikayla Toffler <[email protected]>
What does this PR do?
Closes #2882
Users want a way to configure error codes for http server spans generated from the net/http integration. If configured, these codes are the only codes that should be considered errors on relevant spans.
Motivation
Reviewer's Checklist
v2-devbranch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!