Skip to content

Create AspNetRequestCount collection rule trigger #649

@jander-msft

Description

@jander-msft
  • Create a trigger named AspNetRequestCount that 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 RequestCount property is of type int and specifies the threshold count for the trigger condition to be satisfied.
    • The SlidingWindowDuration property is of type TimeSpan and specifies the time window in which the number of requests (as specified by RequestCount) must occur for the trigger condition to be satisfied.
    • The IncludedPaths property is of type string and specifies the list of request paths which should be monitored. If not specified, all paths are monitored (except for those specified in ExcludedPaths). The elements of the list are semi-colon delimited.
    • The ExcludedPaths property is of type string and specifies the list of request paths which should be ignored when monitoring. The elements of the list are semi-colon delimited.
  • Create and register an IValidateOptions<T> for the request duration trigger options:
    • The RequestCount property is required.
    • The SlidingWindowDuration property is required. It must be greater than or equal to 1 second. It cannot be infinite.
    • The IncludedPaths property is optional.
    • The ExcludedPaths property is optional.

Additional notes:

  • Consider allowing the SlidingWindowDuration property 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. AggregateRequestCounts or CountPerPath, depending on one's viewpoint) to make the mode explicit and configurable.

Contingent on #647 investigation.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions