-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup to move to a common instrumentation class (#428)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f18b2c6
commit e71e184
Showing
10 changed files
with
52 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Diagnostics.Metrics; | ||
|
||
namespace TagzApp.Common.Telemetry; | ||
|
||
public class ProviderInstrumentation | ||
{ | ||
public Counter<int> MessagesReceivedCounter { get; set; } | ||
|
||
public ProviderInstrumentation(IMeterFactory meterFactory) | ||
{ | ||
var meter = meterFactory.Create("tagzapp-provider-metrics"); | ||
|
||
MessagesReceivedCounter = meter.CreateCounter<int>("messages-received", "message", "Counter for messages received"); | ||
} | ||
|
||
public void AddMessage(string provider, string author) => | ||
MessagesReceivedCounter.Add(1, | ||
new KeyValuePair<string, object?>(nameof(provider), provider), | ||
new KeyValuePair<string, object?>(nameof(author), author)); | ||
} |
This file was deleted.
Oops, something went wrong.
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
20 changes: 0 additions & 20 deletions
20
src/TagzApp.Providers.TwitchChat/TwitchChatInstrumentation.cs
This file was deleted.
Oops, something went wrong.
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