-
Notifications
You must be signed in to change notification settings - Fork 863
Drop FailureResultContext #4600
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
13 commits
Select commit
Hold shift + click to select a range
24e36f7
Drop FailureResultContext
martintmk 1191e47
Build fixes
martintmk e3e539a
Cleanup
martintmk f6105d0
test fixes
martintmk 6b73edb
fixes
martintmk 24f4d88
fixes
martintmk a55e286
Merge remote-tracking branch 'origin/release/8.0' into mtomka/drop-fa…
martintmk d870601
fixes
martintmk ea6e180
new tests
martintmk 8a1319b
te error.type should not include addiitonal details
martintmk d437c87
EnumStrings are not required
martintmk 7ef0252
Drop unused code
martintmk b3adad8
Build fix
martintmk 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
24 changes: 24 additions & 0 deletions
24
...Microsoft.Extensions.Http.Resilience/Resilience/Internal/HttpResilienceMetricsEnricher.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,24 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Net.Http; | ||
| using Microsoft.Shared.Text; | ||
| using Polly.Telemetry; | ||
|
|
||
| namespace Microsoft.Extensions.Http.Resilience.Internal; | ||
|
|
||
| internal sealed class HttpResilienceMetricsEnricher : MeteringEnricher | ||
| { | ||
| public override void Enrich<TResult, TArgs>(in EnrichmentContext<TResult, TArgs> context) | ||
| { | ||
| if (typeof(TResult) != typeof(HttpResponseMessage)) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| if (context.TelemetryEvent.Outcome.HasValue && context.TelemetryEvent.Outcome.Value.Result is HttpResponseMessage response) | ||
| { | ||
| context.Tags.Add(new(HttpResilienceTagNames.ErrorType, ((int)response.StatusCode).ToInvariantString())); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...raries/Microsoft.Extensions.Http.Resilience/Resilience/Internal/HttpResilienceTagNames.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,9 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.Extensions.Http.Resilience.Internal; | ||
|
|
||
| internal static class HttpResilienceTagNames | ||
| { | ||
| public const string ErrorType = "error.type"; | ||
| } |
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
50 changes: 0 additions & 50 deletions
50
src/Libraries/Microsoft.Extensions.Resilience/Resilience/FailureResultContext.cs
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...braries/Microsoft.Extensions.Resilience/Resilience/Internal/FailureEventMetricsOptions.cs
This file was deleted.
Oops, something went wrong.
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.
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.
Should be at 100, but code coverage is reporting lower number :/
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.
It's been reported as

Because of this:

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.
...though the validation script reports it as 97.38%...
