Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Missing EventCounter from Asp.Net Core #945

Closed
cijothomas opened this issue Jul 24, 2019 · 0 comments
Closed

Missing EventCounter from Asp.Net Core #945

cijothomas opened this issue Jul 24, 2019 · 0 comments
Assignees
Milestone

Comments

@cijothomas
Copy link
Contributor

"Microsoft.AspNetCore.Hosting" is the correct name. Current default list uses "Microsoft.AspNetCore" and hence these counters are not appearing.

workaround is to add manually:

 public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();



            services.AddApplicationInsightsTelemetry("ikey");

            services.ConfigureTelemetryModule<EventCounterCollectionModule>((eventCounterModule, options) =>
            {
                eventCounterModule.Counters.Add(new EventCounterCollectionRequest("Microsoft.AspNetCore.Hosting", "requests-per-second"));
                eventCounterModule.Counters.Add(new EventCounterCollectionRequest("Microsoft.AspNetCore.Hosting", "total-requests"));
                eventCounterModule.Counters.Add(new EventCounterCollectionRequest("Microsoft.AspNetCore.Hosting", "current-requests"));
                eventCounterModule.Counters.Add(new EventCounterCollectionRequest("Microsoft.AspNetCore.Hosting", "failed-requests"));
            });
        }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant