Skip to content

(apigateway): get metrics from a resource #16433

@j-ohara

Description

@j-ohara

With API GW CDK it is possible today to easily get metrics at the RestAPI level like this:

RestApi restApi = new RestApi(...);
...
restApi.metricLatency();
restApi.metricServerError();
restApi.metricCount();

This is super useful. These metrics are provided by default with API GW. It is possible to get metrics at the resource level if you enable advanced Cloudwatch Metrics on the API. It would be great if we could have similar methods at the Resource level.

Use Case

If an organization uses one API Gateway RestApi with many resources in it each linked to a unique integrations then the API level metrics are not very useful. When the metrics present a problem then it is unclear which specific resource/integration is the cause of it. Being able to easily get these metrics at the resource level would resolve this.

Proposed Solution

IResource resource = new Resource(..);
...
resource.metricLatency();
resource.metricServerError();
resource.metricCount();

Other

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

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-apigatewayRelated to Amazon API Gatewayeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions