aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.37k stars 3.78k forks source link

(aws-logs): Add metric methods for log group IncomingLogEvents and IncomingBytes #30034

Open yattoni opened 2 months ago

yattoni commented 2 months ago

Describe the feature

Add metric methods for log group IncomingLogEvents and IncomingBytes, similar to existing metric methods like metricInvocations on Lambda functions.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Monitoring-CloudWatch-Metrics.html

Use Case

Create alarms on log ingestion to ensure it is working.

Proposed Solution

Create metricIncomingLogEvents and metricIncomingBytes and maybe a generic metric methods on the LogGroup class similar to other resources with metric* methods.

Other Information

No response

Acknowledgements

CDK version used

2.139.1

Environment details (OS name and version, etc.)

Amazon Linux 2

ashishdhingra commented 2 months ago

Perhaps needs to be implemented using guideline at https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md#metrics.

@yattoni Thanks for submitting feature request. Feel free to contribute a PR which could be reviewed by the team.

Thanks, Ashish