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

feat(apigatewayv2): http api - metric methods for api and stage #10686

Merged
merged 25 commits into from
Oct 15, 2020

Conversation

cyuste
Copy link
Contributor

@cyuste cyuste commented Oct 5, 2020

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

@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2020

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@cyuste cyuste changed the title fix (ApiGateway): Add ApiGateway metric methods fix(ApiGateway): Add ApiGateway metric methods Oct 5, 2020
nija-at
nija-at previously requested changes Oct 7, 2020
Copy link
Contributor

@nija-at nija-at left a 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

packages/@aws-cdk/aws-apigateway/lib/rest-api-base.ts Outdated Show resolved Hide resolved
Carlos Yuste added 4 commits October 8, 2020 10:35
@mergify mergify bot dismissed nija-at’s stale review October 11, 2020 20:33

Pull request has been modified.

@cyuste cyuste changed the title fix(ApiGateway): Add ApiGateway metric methods fix(ApiGateway): Add ApiGateway v2 metric methods Oct 11, 2020
Copy link
Contributor

@nija-at nija-at left a 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.

packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts Outdated Show resolved Hide resolved
@nija-at nija-at changed the title fix(ApiGateway): Add ApiGateway v2 metric methods feat(apigatewayv2): http api - metric methods for api and stage Oct 12, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 12, 2020

@mergify mergify bot dismissed nija-at’s stale review October 12, 2020 20:38

Pull request has been modified.

Copy link
Contributor

@nija-at nija-at left a 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.

packages/@aws-cdk/aws-apigatewayv2/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Outdated Show resolved Hide resolved
Comment on lines 123 to 128
/**
* Return the given named metric for this HTTP Api Gateway Stage
*
* @default Average over 5 minutes
*/
public metric(metricName: string, props?: MetricOptions): Metric {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed nija-at’s stale review October 15, 2020 10:06

Pull request has been modified.

Copy link
Contributor

@nija-at nija-at left a 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!

@mergify
Copy link
Contributor

mergify bot commented Oct 15, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: f80c189
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Oct 15, 2020

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).

@mergify mergify bot merged commit aae5d1d into aws:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[apigateway] Getter for restApiName of RestApi class [apigateway] Metric Method for HttpApi
3 participants