aspnet / DependencyInjection

[Archived] Contains common DI abstractions that ASP.NET Core and Entity Framework Core use. Project moved to https://github.com/aspnet/Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add EventSource/EventCounter tracing and metrics for DependencyInjection

analogrelay opened this issue · comments

The primary goal here is to give users insight as to when services are constructed and how many services they have active in their application. This can be useful when correlated to requests and helps give more insight into memory issues.

There is also a useful effect of putting EventSources in DI. Since DI is below Logging in the dependency graph, it has no logging. However, EventSource is in corefx, which means DI can use it.

I'm going to do this one via a PR rather than listing proposed counters since it's relatively simple.

See https://gist.github.com/anurse/af1859663ac91c6cf69c820cebe92303 for some guidance on adding EventSources and EventCounters to ASP.NET projects.

This issue was moved to dotnet/aspnetcore#2330