Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs: SubscriptionFilter does not provide metric* helpers #8141

Open
2 tasks
arnab opened this issue May 21, 2020 · 3 comments
Open
2 tasks

logs: SubscriptionFilter does not provide metric* helpers #8141

arnab opened this issue May 21, 2020 · 3 comments
Labels
@aws-cdk/aws-logs Related to Amazon CloudWatch Logs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@arnab
Copy link

arnab commented May 21, 2020

The AWS Logs SubscriptionFilter construct should provide metric* methods that CDK resources typically provide. See for example:

Use Case

All SubscriptionFilter metrics (e.g. see ForwardedLogEvents, DeliveryErrors, DeliveryThrottling in the Monitoring AWS Logs with CloudWatch Metrics docs) requires some dimensions to be specified:

  • LogGroupName
  • DestinationType
  • FilterName

The first two are easy to specify since the LogGroupName is also required while creating the construct and DestinationType a service name (e.g. Lambda). However, there appears to be no way to get FilterName using CDK:

  • The CDK construct (and the underlying CloudFormation resource: AWS::Logs::SubscriptionFilter) does not let me specify the FilterName - so it can't be directly specified ( and is always dynamically generated).
  • There are no properties on the SubscriptionFilter object that will return this.
    • In fact, unlike most other CDK constructs, this one seems pretty bare and returns absolutely no information about the resource.
  • The synthesized FilterName is like MyStackName-MyLogicalID29669D87-GCMA0Q4KKALH (in CloudFormation): so it can't directly be specified using a Fn.ref (since the logicalId for CDK constructs is dynamic). Possibly related to: CDK Refactoring Tools aws-cdk-rfcs#162.

Proposed Solution

  • Please provide metric* methods on SubscriptionFilter construct.
  • Also provide properties on the SubscriptionFilter construct to get references to properties, such as the related logGroup (which is required as a constructor argument), like most CDK constructs.

Other

For more details, see this StackOverflow question.

As shown in the SO post above, a possible workaround is to use the Stack#getLogicalId method.

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

This is a 🚀 Feature Request

@arnab arnab added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 21, 2020
@SomayaB SomayaB added the @aws-cdk/aws-logs Related to Amazon CloudWatch Logs label May 26, 2020
@rix0rrr rix0rrr added the effort/medium Medium work item – several days of effort label May 27, 2020
@rix0rrr rix0rrr added the p2 label Aug 12, 2020
@SomayaB SomayaB assigned shivlaks and unassigned rix0rrr Aug 20, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 6, 2020
@NGL321 NGL321 assigned rix0rrr and unassigned shivlaks Jan 25, 2021
@rix0rrr rix0rrr removed their assignment Jun 3, 2021
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 3, 2022
@github-actions github-actions bot closed this as completed Jun 8, 2022
@arnab
Copy link
Author

arnab commented Jun 8, 2022

I was away and not watching my email. Not sure why this was auto-closed without any details of the fix.

Can you please re-open this (I don’t seem to be able to)?

@peterwoodworth peterwoodworth removed the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Jun 8, 2022
@peterwoodworth peterwoodworth reopened this Jun 8, 2022
@peterwoodworth
Copy link
Contributor

Sorry about this @arnab, we have automation which closes issues if they haven't had any activity in over a year. Thanks for letting us know 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-logs Related to Amazon CloudWatch Logs effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

5 participants