Skip to content

cloudwatch: make metricName field public #33570

Open
@rantoniuk

Description

@rantoniuk

Describe the feature

In the following code:

    const sigkillMetricFilter = new MetricFilter(this, 'SigkillMetricFilter', {
      filterPattern: FilterPattern.literal('SIGKILL'),
      logGroup: this.logGroup,
      metricNamespace,
      metricName: 'SigkillCount',
      metricValue: '1',
    });

    // Create a metric using the filter
    const sigkillMetric = new Metric({
      namespace: metricNamespace,
      metricName: 'SigkillCount',
      statistic: 'Sum',
      period: Duration.minutes(5),
    });

the metricName field is duplicated in two constructs, because it's not possible to do:

    const sigkillMetric = new Metric({
      namespace: metricNamespace,
      metricName: sigkillMetricFilter.metricName, // this field is private
      statistic: 'Sum',
      period: Duration.minutes(5),
    });

This doesn't allow for proper object dependency/relationship.

Use Case

As above.

Proposed Solution

Make the field public.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

[email protected]

Environment details (OS name and version, etc.)

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions