Describe the feature
The CloudFront UI and API lets you enable more granular metrics per-distribution, at an additional (fixed) cost.
There is an L1 construct that lets you do this, which can be easily integrated into the L2 construct and enabled via a prop.
Use Case
I want to create a dashboard of data like origin latency, Lambda@Edge error rate etc. and alarm on these metrics.
Proposed Solution
An additional prop for cloudfront.Distribution:
new Distribution(this, 'Distro', {
...,
publishAdditionalMetrics: true, // default: false
});
If this is set to true a CfnMonitoringSubscription instance is created:
new CfnMonitoringSubscription(nextJsDeployment.distribution, 'MonitoringSubscription', {
distributionId: nextJsDeployment.distribution.distributionId,
monitoringSubscription: {
realtimeMetricsSubscriptionConfig: {
realtimeMetricsSubscriptionStatus: 'Enabled',
}
}
});
Also, we probably want to expose these metrics via distro.metricsXyz() methods (should probably throw, if publishAdditionalMetrics is set to false.
Other Information
No response
Acknowledgements
CDK version used
2.50.0
Environment details (OS name and version, etc.)
n/a
Describe the feature
The CloudFront UI and API lets you enable more granular metrics per-distribution, at an additional (fixed) cost.
There is an L1 construct that lets you do this, which can be easily integrated into the L2 construct and enabled via a prop.
Use Case
I want to create a dashboard of data like origin latency, Lambda@Edge error rate etc. and alarm on these metrics.
Proposed Solution
An additional prop for
cloudfront.Distribution:If this is set to
trueaCfnMonitoringSubscriptioninstance is created:Also, we probably want to expose these metrics via
distro.metricsXyz()methods (should probably throw, ifpublishAdditionalMetricsis set to false.Other Information
No response
Acknowledgements
CDK version used
2.50.0
Environment details (OS name and version, etc.)
n/a