You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exposing the log group created by cdk for a lambda function as a property.
Use Case
When making metrics to monitor lambda memory consumption, the only way to do it currently is by using a metric filter on the cloudwatch logs. However the metric filter requires a log group object to apply the filter on and in order to get the log group object currently, we need to parse the arn of the generated log group and use that to capture the ILogGroup object which we would use to apply metric filters.
Proposed Solution
Expose the log group that cdk creates for the lambda function as a property
Proposed solution:
public logGroup: ILogGroup;constructor(scope: Construct,id: string,props: FunctionProps){
...
this.logGroup=logs.LogGroup.fromLogGroupArn(scope,id,parsedLogGroupArn);}
Thank you for commenting! This seems like a reasonable feature request. We can definitely look into it, however if you would like to see this fast, your best bet is submitting a PR yourself!
Either way, someone will comment here to let you know when there is an update!
😸
nija-at
changed the title
Expose lambda function log group as property
[lambda] Expose function's log group as property
Oct 18, 2019
Exposing the log group created by cdk for a lambda function as a property.
Use Case
When making metrics to monitor lambda memory consumption, the only way to do it currently is by using a metric filter on the cloudwatch logs. However the metric filter requires a log group object to apply the filter on and in order to get the log group object currently, we need to parse the arn of the generated log group and use that to capture the ILogGroup object which we would use to apply metric filters.
Proposed Solution
Expose the log group that cdk creates for the lambda function as a property
Proposed solution:
Expected result:
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: