-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(apigatewayv2): http api - metric methods for api and stage #10686
Conversation
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue you've pointed at - #10325 - is referring to apigatewayv2, and not this module. Please provide a proper description in your commit message on what you're looking to achieve here.
If you're looking to add helper metric method to the RestApi
construct, this is not done via Cfn augmentation. Instead, it's done explicitly in the source code. See here for examples - https://github.com/aws/aws-cdk/search?q=public+metric
Please also note that there is an open PR on related changes here - #10667
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. My comments are below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the suggested changes.
Just one major comment around where the constructor should go. See below.
/** | ||
* Return the given named metric for this HTTP Api Gateway Stage | ||
* | ||
* @default Average over 5 minutes | ||
*/ | ||
public metric(metricName: string, props?: MetricOptions): Metric { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could apply the same logic as HttpApi
of moving this into the interface and creating an abstract HttpStageBase
class.
This is entirely optional if you want to skip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you prefer. Currently I can import an api and get its metrics (created a new test for it) but I can't for a stage, what is correct as I cannot either associate an imported stage to an api and therefore cannot set the metric dimensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine. It can be done later as a separate PR.
Co-authored-by: Niranjan Jayakar <[email protected]>
Co-authored-by: Niranjan Jayakar <[email protected]>
Co-authored-by: Niranjan Jayakar <[email protected]>
Co-authored-by: Niranjan Jayakar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great now!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
fixes #10325
closes #10726
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license