-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Steeltoe Metrics extensions play nice with Otel (#848)
* Adds checks and warnings when extension methods are used incorrectly with Opentelemetry * Fix Threaddump extension methods * Apply suggestions from code review Co-authored-by: Tim Hess <[email protected]> * Easy configuration for actuators & Otel. Fix thread dump extension for non-windows * Fix failing testS * CR Fixes Co-authored-by: Tim Hess <[email protected]>
- Loading branch information
Showing
11 changed files
with
251 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
35 changes: 35 additions & 0 deletions
35
src/Management/test/EndpointCore.Test/ConsoleOutputBorrower.cs
This file contains 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,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the Apache 2.0 License. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Text; | ||
|
||
namespace Steeltoe.Management.Endpoint.Test | ||
{ | ||
internal class ConsoleOutputBorrower : IDisposable | ||
{ | ||
private readonly StringWriter _borrowedOutput; | ||
private readonly TextWriter _originalOutput; | ||
|
||
public ConsoleOutputBorrower() | ||
{ | ||
_borrowedOutput = new StringWriter(); | ||
_originalOutput = Console.Out; | ||
Console.SetOut(_borrowedOutput); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return _borrowedOutput.ToString(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Console.SetOut(_originalOutput); | ||
_borrowedOutput.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.