Repository: dotnet/aspnetcore
File: src/Identity/Extensions.Core/src/UserManagerMetrics.cs (C#)

Code before:
        return trimmedPurpose switch
        {
            "ResetPassword" => "reset_password",
            "ChangePhoneNumber" => "change_phone_number",
            "EmailConfirmation" => "email_confirmation",
            "ChangeEmail" => "change_email",
            "TwoFactor" => "two_factor",
            _ => "_OTHER"
        };
    }

    private static void AddIdentityResultTags(ref TagList tags, IdentityResult? result)
    {
        if (result == null)
        {
            return;
        }

        tags.Add("aspnetcore.identity.result", result.Succeeded ? "success" : "failure");
        if (!result.Succeeded && result.Errors.FirstOrDefault()?.Code is { Length: > 0 } code)
        {
            tags.Add("aspnetcore.identity.error_code", code);
        }
    }

    private static void AddExceptionTags(ref TagList tags, Exception? exception, IdentityResult? result = null)
    {
        var value = exception?.GetType().FullName ?? result?.Errors.FirstOrDefault()?.Code;
        if (value != null)
        {
            tags.Add("error.type", value);
        }
    }

    private static string GetPasswordResult(PasswordVerificationResult? result, bool? passwordMissing, bool? userMissing)
    {
        return (result, passwordMissing ?? false, userMissing ?? false) switch
        {
            (PasswordVerificationResult.Success, false, false) => "success",
            (PasswordVerificationResult.SuccessRehashNeeded, false, false) => "success_rehash_needed",
            (PasswordVerificationResult.Failed, false, false) => "failure",
            (null, true, false) => "password_missing",
            (null, false, true) => "user_missing",
            _ => "_OTHER"
        };
    }

    private static string GetUpdateType(UserUpdateType updateType)
    {
        return updateType switch
        {

Review comment (suggestion):
nit


```suggestion
    private static void AddErrrorTags(ref TagList tags, Exception? exception, IdentityResult? result = null)
```

Code after:
        // These are known purposes that are specified in ASP.NET Core Identity.
        return trimmedPurpose switch
        {
            "ResetPassword" => "reset_password",
            "ChangePhoneNumber" => "change_phone_number",
            "EmailConfirmation" => "email_confirmation",
            "ChangeEmail" => "change_email",
            "TwoFactor" => "two_factor",
            _ => "_OTHER"
        };
    }

    private static void AddIdentityResultTags(ref TagList tags, IdentityResult? result)
    {
        if (result == null)
        {
            return;
        }

        tags.Add("aspnetcore.identity.result", result.Succeeded ? "success" : "failure");
        if (!result.Succeeded && result.Errors.FirstOrDefault()?.Code is { Length: > 0 } code)
        {
            tags.Add("aspnetcore.identity.error_code", code);
        }
    }

    private static void AddErrorTag(ref TagList tags, Exception? exception, IdentityResult? result = null)
    {
        var value = exception?.GetType().FullName ?? result?.Errors.FirstOrDefault()?.Code;
        if (value != null)
        {
            tags.Add("error.type", value);
        }
    }

    private static string GetPasswordResult(PasswordVerificationResult? result, bool? passwordMissing, bool? userMissing)
    {
        return (result, passwordMissing ?? false, userMissing ?? false) switch
        {
            (PasswordVerificationResult.Success, false, false) => "success",
            (PasswordVerificationResult.SuccessRehashNeeded, false, false) => "success_rehash_needed",
            (PasswordVerificationResult.Failed, false, false) => "failure",
            (null, true, false) => "password_missing",
            (null, false, true) => "user_missing",
            _ => "_OTHER"
        };
    }

    private static string GetUpdateType(UserUpdateType updateType)
    {
        return updateType switch