Skip to content

Disable Asp.Net Core EventCounters by default. #1759

Closed

Description

AspNetCore SDK 2.8.0 onwards, we were collecting Asp.Net Core EventCounters by default (only on .NET Core 3.0/3.1 app).

Proposing to remove Asp.Net Core counters from the list by default.
The following are the counters collected:
"Request Rate", "Total Requests", "Current Requests", "Failed Requests"

Reasons:

  1. All the above counters are already available as Application Insights standard metrics. The AI standard metrics are superior because they have dimensions like Request Status Code. The EventCounter ones don't have any dimensions, so they don't offer any additional value beyond whats available from Standard Metrics.

  2. The standard metrics are free of cost for users. The EventCounter metrics are not free, and are subject to ingestion billing based on GBs ingested.

  3. In all the latest SDKs Standard metrics are extracted at the SDK side itself, before sampling. Hence its equally good as EventCounters, at getting metric unaffected by sampling or any other telemetry reduction techniques.

Additional reasons, which are really issues about the publishing if counters itself: (will open separate issues in the Asp.Net Core Hosting repo, but listing here for immediate reference)

  1. "Total Requests", "Current Requests", "Failed Requests" - These 3 counters are published by Asp.Net Core runtime using PollingCounters (https://github.com/dotnet/aspnetcore/blob/master/src/Hosting/Hosting/src/Internal/HostingEventSource.cs#L96)

This essentially means that consumers (in our case AI SDK), gets the standard Min,Max,Count,Mean about these counters. However, these counters are values since the start of the process, and hence makes sense to be used only for 'Rates'.
i.e Knowing Total Requests since the start of process is of little value, but the Rates per sec is of value.

Inorder to calculate 'Rates', these counters must be published using IncrementingPollingCounter, as opposed to PollingCounter. AI SDK calculates Rates for IncrementingPollingCounter or IncrementingCounter only.

  1. "Request Rate" is published as IncrementingPollingCounter which allows SDK to calculate rate. SDK currently calculates per sec rate, which (happened t)o match the DisplayRateTimeScale of 1 sec suggested by the publisher. This counter alone may be used as such, but standard metric already offer this same metric, in a superior way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions