-
Notifications
You must be signed in to change notification settings - Fork 841
Use the same naming rules for the names of logging dimensions #4545
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
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e0cebd1
Fixed naming of HttpClient logs, Http Middleware logs, and LoggerMess…
iliar-turdushev 5e63fca
Renamed enrichment properties
iliar-turdushev ec04952
ComplexObjectLogging: use "." instead of "_"
iliar-turdushev 0fb8cd8
Fixed a test
iliar-turdushev 6fcf38a
Merge with release/8.0
iliar-turdushev 8f00e79
Make dimension names in HTTP Client Logging consistent with HTTP Logging
iliar-turdushev c93c1a0
Renamed AppEnricher's dimensions
iliar-turdushev 58afe44
Addressing PR comments
iliar-turdushev 8ea197b
Reverted changes to StackTrace logging
iliar-turdushev 274efcd
Apply semantic-conventions to Application and Process enrichers
iliar-turdushev 2f324a7
Apply semantic-conventions to HttpLogging
iliar-turdushev 00c9cd3
Dimension names in HttpClient Logging
iliar-turdushev 8282a78
Inlined PropertySeparator and NonNullablePropertySeparator constants
iliar-turdushev 2992316
Adjusted code coverage
iliar-turdushev 91968e3
Header normalization
iliar-turdushev 466b9a1
HttpLogging header name normalization
iliar-turdushev fe0f620
Normalize headers added by RequestHeadersLogEnricher
iliar-turdushev dd45788
Header name normalization in HttpClientLogging
iliar-turdushev cd73076
Merge with main
iliar-turdushev 7fc9a02
Updated API json files
iliar-turdushev f44ed27
Header name normalization now doesn't require replacing '-' with '_'
iliar-turdushev 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
28 changes: 28 additions & 0 deletions
28
src/Libraries/Microsoft.AspNetCore.Diagnostics.Middleware/Logging/HeaderNormalizer.cs
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,28 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Collections.Generic; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Microsoft.Extensions.Compliance.Classification; | ||
|
|
||
| internal static class HeaderNormalizer | ||
| { | ||
| public static string[] PrepareNormalizedHeaderNames(KeyValuePair<string, DataClassification>[] headers, string prefix) | ||
| { | ||
| var normalizedHeaders = new string[headers.Length]; | ||
|
|
||
| for (int i = 0; i < headers.Length; i++) | ||
| { | ||
| normalizedHeaders[i] = prefix + Normalize(headers[i].Key); | ||
| } | ||
|
|
||
| return normalizedHeaders; | ||
| } | ||
|
|
||
| [SuppressMessage("Globalization", "CA1308:Normalize strings to uppercase", | ||
| Justification = "Normalization to lower case is required by OTel's semantic conventions")] | ||
| private static string Normalize(string header) | ||
| { | ||
| return header.ToLowerInvariant(); | ||
| } | ||
| } |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.