Always set response header tags in ASP.NET Core#2480
Merged
Conversation
Merged
andrewlock
force-pushed
the
andrew/always-apply-headers
branch
from
February 21, 2022 12:30
446f11f to
2afc19e
Compare
kevingosse
approved these changes
Feb 21, 2022
Member
Author
Code Coverage Report 📊✔️ Merging #2480 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
View the full reports for further details: |
andrewlock
added a commit
that referenced
this pull request
Feb 21, 2022
andrewlock
added a commit
that referenced
this pull request
Feb 21, 2022
andrewlock
added a commit
that referenced
this pull request
Feb 21, 2022
* Fix missing `http.status_code` tag on ASP.NET Core spans with errors (#2458) * Add tests for case where an exception is set on a span and a non-200 status code is set Shows that the tests are failing for the "legacy" (feature-flag disabled) use case. * Fix missing HTTP status code tag when span is manually marked as an error * Support cleaning filenames in http-client + aspnet (#2471) The HttpClient integration (and the ASP.NET/ASP.NET Core integration when the feature flag is disabled) all do "cleaning" of URLs to try and reduce the cardinality introduced by number/guid route parameters. This works by examining each "segment" in a URL, and using heuristics to see if we should replace it with `?`. This works as expected for the following paths: - `/some/value/123` => `/some/value/?` - `/some/value/123/123-456 => `/some/value/?/?` - `/some/value/123/example.png => `/some/value/?/example.png` However, it treats the whole final segment as a single unit, which means filenames with extensions will never be obfuscated, e.g. - `/some-filevalue/123.png` - `/some-filevalue/123.456` - `/some-filevalue/123.c` That can lead to high cardinality, which in turn can cause problems for customers with too many endpoints in their account. To work around it, we treat the filename as a separate segment from the file extension, and don't try and obfuscate the extension * Always set response header tags in ASP.NET Core (#2480) * Fix sample helpers and update snapshots Thes changes were necessary because of the significant differences between master and release/1.x
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.
Summary of changes
Reason for change
Initially Discovered while investigating #2458, but also spotted when preparing a hotfix. We noticed that we were not calling SetHeaderTags() to record response headers when an unhandled exception occurs in the middleware/mvc pipeline, and in the latter case, if the status code was already set on the span.
Other details
Supersedes #2460