Search code examples
asp.net-coreinfluxdb

App Metrics .netCore 3.0 does not tracking endpoint


When I using App Metric to report into influxDb for an web API with .netcore 2.1, it return the calling enpoint info like the image .netcore 2.1

But when I upgrade it to .netcore 2.2 or 3.1 then it return nothing .netcore 2.2

Is it wrong in config some thing when i upgrade? Looking for your help!


Solution

  • I found out that it worked after adding .AddMetrics() right behind .AddMvc() in Startup.cs

    using Microsoft.AspNetCore.Mvc;
    ....
    public void ConfigureServices(IServiceCollection services) {
    ....
    services.AddMvc().AddMetrics()....
    }