Skip to content

Commit 7b2ae04

Browse files
CopilotJamesNK
andcommitted
Add AddMetrics() call when registering UserManager and SignInManager
Co-authored-by: JamesNK <[email protected]>
1 parent bb2a007 commit 7b2ae04

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

src/Identity/Core/src/IdentityServiceCollectionExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public static class IdentityServiceCollectionExtensions
8989

9090
// Hosting doesn't add IHttpContextAccessor by default
9191
services.AddHttpContextAccessor();
92+
services.AddMetrics();
9293
// Identity services
9394
services.TryAddScoped<IUserValidator<TUser>, UserValidator<TUser>>();
9495
services.TryAddScoped<IPasswordValidator<TUser>, PasswordValidator<TUser>>();

src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<Reference Include="Microsoft.AspNetCore.Authentication.BearerToken" />
2424
<Reference Include="Microsoft.AspNetCore.Authorization.Policy" />
2525
<Reference Include="Microsoft.AspNetCore.Http.Results" />
26+
<Reference Include="Microsoft.Extensions.Diagnostics" />
2627
<Reference Include="Microsoft.Extensions.Identity.Core" />
2728
<Reference Include="System.Formats.Cbor" />
2829
</ItemGroup>

src/Identity/Extensions.Core/src/IdentityServiceCollectionExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static IdentityBuilder AddIdentityCore<TUser>(this IServiceCollection ser
3535
{
3636
// Services identity depends on
3737
services.AddOptions().AddLogging();
38+
services.AddMetrics();
3839

3940
// Services used by identity
4041
services.TryAddScoped<IUserValidator<TUser>, UserValidator<TUser>>();

src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<ItemGroup>
1414
<Reference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" />
15+
<Reference Include="Microsoft.Extensions.Diagnostics" />
1516
<Reference Include="Microsoft.Extensions.Logging" />
1617
<Reference Include="Microsoft.Extensions.Options" />
1718

0 commit comments

Comments
 (0)