aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Investigate AuthN/AuthZ metrics in ASP.NET Core

Open JamesNK opened this issue 1 year ago • 6 comments

Issue https://github.com/dotnet/aspnetcore/issues/47536 adds metrics for existing counters.

We should investigate where adding new metrics makes sense in ASP.NET Core. Metrics are easier to add and test than old event counters. And tags make them more powerful.

Initial ideas:

  • [x] Rate limiting - queue counts
  • [x] Routing - match/fallback/no match counts
  • [ ] AuthN/AuthZ - success/failure counts

AuthZ

  • Number of requests that require authz
    • Policy name
    • Result (success/failure)

AuthN

  • Challenge count
    • Scheme name
  • Authenticated requests count - don't record for result
    • Scheme name
    • Result (success/failure/noop)

Sign in handler

  • Sign in count
    • Scheme name

Sign out handler

  • Sign out count
    • Scheme name

JamesNK avatar Apr 07 '23 03:04 JamesNK

Output Caching metrics might be another good idea. I'm also wondering whether anything makes sense around health checks - although they can probably be seen within the scope of the existing metrics.

mitchdenny avatar May 02 '23 00:05 mitchdenny

This is mostly for outside kestrel, right? #47831 covers the remaining work there?

amcasey avatar May 05 '23 20:05 amcasey

Yes

JamesNK avatar May 06 '23 06:05 JamesNK

cc @halter73 @JeremyLikness

JamesNK avatar Jun 12 '23 03:06 JamesNK

As someone working in the authentication space and looking at metrics currently, I'd be interested in helping out with this.

SeanFarrow avatar Dec 04 '23 04:12 SeanFarrow

The first step is to figure out what the metrics are. The issue includes some notes from discussing metrics with @halter73 @JeremyLikness. I think they're the folks that need to come up with what the spec is we want in .NET 9.

JamesNK avatar Dec 05 '23 02:12 JamesNK

We ended up cutting this out from .NET 9 as we don't have capacity to tackle this in time.

mkArtakMSFT avatar Jul 31 '24 16:07 mkArtakMSFT