-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Identity metrics clean up #62671
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
base: main
Are you sure you want to change the base?
Identity metrics clean up #62671
Conversation
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.
Pull Request Overview
This PR updates the default metric value for unknown cases from _UNKNOWN
to _OTHER
across identity-related switch expressions, aligning with the correct metric nomenclature.
- Replaces
_UNKNOWN
with_OTHER
inGetTokenPurpose
- Replaces
_UNKNOWN
with_OTHER
inGetPasswordResult
- Replaces
_UNKNOWN
with_OTHER
inGetUpdateType
Comments suppressed due to low confidence (3)
src/Identity/Extensions.Core/src/UserManagerMetrics.cs:172
- Add a unit test to verify that GetTokenPurpose returns "_OTHER" for unrecognized purposes.
_ => "_OTHER"
src/Identity/Extensions.Core/src/UserManagerMetrics.cs:207
- Add a unit test to verify that GetPasswordResult returns "_OTHER" for cases falling through the specified patterns.
_ => "_OTHER"
src/Identity/Extensions.Core/src/UserManagerMetrics.cs:247
- Add a unit test to verify that GetUpdateType returns "_OTHER" for unhandled UserUpdateType values.
_ => "_OTHER"
Is _UNKNOWN correct here
|
_checkPasswordCounter = _meter.CreateCounter<long>(CheckPasswordCounterName, "count", "The number of check password attempts. Only checks whether the password is valid and not whether the user account is in a state that can log in."); | ||
_verifyTokenCounter = _meter.CreateCounter<long>(VerifyTokenCounterName, "count", "The number of token verification attempts."); | ||
_generateTokenCounter = _meter.CreateCounter<long>(GenerateTokenCounterName, "count", "The number of token generation attempts."); | ||
_createCounter = _meter.CreateCounter<long>(CreateCounterName, "{create}", "The number of users created."); |
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 counts users, so should it be
_createCounter = _meter.CreateCounter<long>(CreateCounterName, "{create}", "The number of users created."); | |
_createCounter = _meter.CreateCounter<long>(CreateCounterName, "{user}", "The number of users created."); |
?
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.
You'd like create, update and delete metrics to have a unit of {user}
?
} | ||
} | ||
|
||
private static void AddExceptionTags(ref TagList tags, Exception? exception) | ||
private static void AddExceptionTags(ref TagList tags, Exception? exception, IdentityResult? result = null) |
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.
nit
private static void AddExceptionTags(ref TagList tags, Exception? exception, IdentityResult? result = null) | |
private static void AddErrrorTags(ref TagList tags, Exception? exception, IdentityResult? result = null) |
_OTHER
is the correct value to use when give a value outside of the known set.