Skip to content

Add support for TrimmedSum (TS) statistics in MetricStatistic enum #671

@aman1995

Description

@aman1995

Feature scope

All

Describe your suggested feature

Describe your suggested feature

Add support for TrimmedSum (TS) statistics to the MetricStatistic enum in the CDK Monitoring Constructs library.

Problem:
Currently, the MetricStatistic enum is missing TrimmedSum statistics, which are valid and supported AWS CloudWatch statistics. This prevents users from creating monitoring dashboards and alarms that use TrimmedSum aggregations, limiting the library's compatibility with the full range of CloudWatch statistics.

Proposed Solution:
Extend the MetricStatistic enum to include all TrimmedSum variants supported by AWS CloudWatch:

  1. Basic TrimmedSum statistics (removes highest percentages):

    • TS50, TS70, TS90, TS95, TS99, TS999, TS9999
  2. Bidirectional TrimmedSum statistics (removes both lowest and highest percentages):

    • TS99_BOTH, TS95_BOTH, TS90_BOTH, TS85_BOTH, TS80_BOTH, TS75_BOTH, TS70_BOTH
  3. Top-range TrimmedSum statistics (removes lowest percentages):

    • TS95_TOP, TS99_TOP, TS999_TOP, TS9999_TOP

Benefits:

  • Complete CloudWatch compatibility: Users can utilize all AWS CloudWatch statistics
  • Enhanced monitoring capabilities: TrimmedSum is useful for metrics where outliers need to be excluded from sum calculations
  • Consistency: Aligns with existing support for TrimmedMean and WinsorizedMean statistics
  • Future-proofing: Ensures the library stays current with AWS CloudWatch capabilities

Use Cases:

  • Monitoring request volumes while excluding extreme outliers
  • Calculating sums of latency metrics with outlier removal
  • Creating more robust sum-based alarms that aren't skewed by anomalous data points

This enhancement would provide users with the full spectrum of AWS CloudWatch statistics for comprehensive monitoring solutions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions