dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.54k stars 10.05k forks source link

Metrics for caching #54182

Open JamesNK opened 9 months ago

JamesNK commented 9 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

Caching is a largely invisible operation. It's useful to have metrics to observe what is happening with caching.

Describe the solution you'd like

Caching has many APIs and usages in ASP.NET Core. See https://learn.microsoft.com/en-us/aspnet/core/performance/caching/overview?view=aspnetcore-8.0

Find the most useful places to add metrics. Note that we should try to design metrics so that all implementations of a cache benefit. For example, all distributed caching implementations get metrics, rather than just Redis and leaving SQL Server cache out.

Additional context

No response

JamesNK commented 9 months ago

FYI @mgravell (part of caching epic) @eerhardt