Skip to content

Cloudwatch: Support live data for SingleValueWidget in CloudWatch dashboards #36915

@Darasimi-Ajewole

Description

@Darasimi-Ajewole

Describe the feature

Currently, the SingleValueWidget in CDK-defined CloudWatch dashboards does not support live or auto-refreshing data. This limits its usefulness for operational monitoring of key metrics (e.g., errors, throttles, queue depth). Other widget types support near-real-time updates, but SingleValue widgets cannot be configured for this behaviour via CDK.

Use Case

I want to display a SingleValue widget on a dashboard that updates automatically to reflect near real-time metrics without manually refreshing the dashboard. For example:

import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as cdk from 'aws-cdk-lib';

const dashboard = new cloudwatch.Dashboard(stack, 'MyDashboard');

dashboard.addWidgets(
  new cloudwatch.SingleValueWidget({
    metrics: [
      new cloudwatch.Metric({
        namespace: 'MyApp',
        metricName: 'ErrorCount',
        period: cdk.Duration.minutes(1),
      }),
    ],
  }),
);

Currently, this widget only shows a static snapshot of the metric, even if the dashboard refreshes.

Proposed Solution

Allow SingleValueWidget to optionally display live or near-real-time data.

Other Information

No response

Acknowledgements

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

AWS CDK Library version (aws-cdk-lib)

2.237.1

AWS CDK CLI version

2.1101.0

Environment details (OS name and version, etc.)

Mac OS Sonoma

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudwatchRelated to Amazon CloudWatcheffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions