-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64ef5ec
commit 7064310
Showing
2 changed files
with
40 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Diagnostics.Metrics; | ||
|
||
namespace oidc_guard.Services | ||
{ | ||
public class Instrumentation | ||
{ | ||
public Counter<long> SignInCounter { get; private set; } | ||
public Counter<long> SignOutCounter { get; private set; } | ||
public Counter<long> AuthorizedCounter { get; private set; } | ||
public Counter<long> UnauthorizedCounter { get; private set; } | ||
|
||
public Instrumentation(IMeterFactory meterFactory) | ||
{ | ||
const string prefix = "oidc_guard"; | ||
var meter = meterFactory.Create(prefix); | ||
|
||
SignInCounter = meter.CreateCounter<long>(prefix + "_signin", description: "Number of Sign-in operations ongoing."); | ||
SignOutCounter = meter.CreateCounter<long>(prefix + "_signout", description: "Number of Sign-out operations ongoing."); | ||
AuthorizedCounter = meter.CreateCounter<long>(prefix + "_authorized", description: "Number of Authorized operations ongoing."); | ||
UnauthorizedCounter = meter.CreateCounter<long>(prefix + "_unauthorized", description: "Number of Unauthorized operations ongoing."); | ||
} | ||
} | ||
} |