-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Labels
Description
- Create a trigger named
AspNetRequestCountthat notifies when a number of HTTP requests exceeds a threshold during a specified sliding window of time. - Create a strong-typed options class, e.g.
AspNetRequestCountTriggerOptions, that has the following properties:- The
RequestCountproperty is of typeintand specifies the threshold count for the trigger condition to be satisfied. - The
SlidingWindowDurationproperty is of typeTimeSpanand specifies the time window in which the number of requests (as specified byRequestCount) must occur for the trigger condition to be satisfied. - The
IncludedPathsproperty is of typestringand specifies the list of request paths which should be monitored. If not specified, all paths are monitored (except for those specified inExcludedPaths). The elements of the list are semi-colon delimited. - The
ExcludedPathsproperty is of typestringand specifies the list of request paths which should be ignored when monitoring. The elements of the list are semi-colon delimited.
- The
- Create and register an
IValidateOptions<T>for the request duration trigger options:- The
RequestCountproperty is required. - The
SlidingWindowDurationproperty is required. It must be greater than or equal to 1 second. It cannot be infinite. - The
IncludedPathsproperty is optional. - The
ExcludedPathsproperty is optional.
- The
Additional notes:
- Consider allowing the
SlidingWindowDurationproperty to be optional with default values (e.g. 1 minute). - It is ambiguous whether the request count is aggregated across all paths or if the request count is consider on a per-path basis. Existing capabilities (e.g. Azure App Service Diagnose and Solve) seem to imply that total request count is monitored; however this can be done using the EventCounter trigger with the "Microsoft.AspNetCore.Hosting" event provider and the "current-requests" or "requests-per-second" counter (but this does not allow filtering to specific paths). If that is the case, then this trigger should collect event counts per-path and only trigger when the count for an individual path has exceeded the threshold. If not the case, another property can be added (e.g.
AggregateRequestCountsorCountPerPath, depending on one's viewpoint) to make the mode explicit and configurable.
Contingent on #647 investigation.