Loading

AWS API Gateway

<div class="condensed-table">
| | |
| --- | --- |
| Version | 2.38.2 (View all) |
| Compatible Kibana version(s) | 8.16.2 or higher |
| Supported Serverless project types
What’s this? | Security
Observability |
| Subscription level
What’s this? | Basic |

</div>
The AWS API Gateway integration allows you to monitor API Gateway — a centralized API management service.

Use the AWS API Gateway integration to collect metrics and logs related to your HTTP, REST or WebSockets APIs. Then visualize that data in Kibana, create alerts to notify you if something goes wrong, and reference metrics when troubleshooting an issue.

For example, you could use this integration to examine metrics related to error rates, response codes, and latency. You can pinpoint problematic areas, identify error-prone API endpoints, and troubleshoot performance issues.

Important

Extra AWS charges on API requests will be generated by this integration. Check API Requests for more details.

The API Gateway integration collects two types of data: metrics and logs.

Logs help you keep a record of events happening in Amazon API Gateway. Logs collected by the Amazon API Gateway integration include the HTTP method, status code, request details and more.

AWS API Gateway allows you to set up Custom Access Logging to gain deeper insights into the requests and responses through your API by making use of context variables (HTTP, WebSockets), input, stage and util variables (REST).

The Elastic integration for AWS API Gateway supports the following Log Format by API type:

HTTP:
{"requestId": "$context.requestId","ip": "$context.identity.sourceIp","requestTime": "$context.requestTime","httpMethod": "$context.httpMethod","routeKey": "$context.routeKey","status": "$context.status","protocol": "$context.protocol","responseLength": "$context.responseLength",apiId": "$context.apiId", "domainName": "$context.domainName", "stage": "$context.stage"}

REST:
{"requestId": "$context.requestId","ip": "$context.identity.sourceIp","caller": "$context.identity.caller","user": "$context.identity.user""requestTime": "$context.requestTime","httpMethod": "$context.httpMethod","resourcePath": "$context.resourcePath","status": "$context.status","protocol": "$context.protocol","responseLength": "$context.responseLength",apiId": "$context.apiId", "domainName": "$context.domainName", "stage": "$context.stage"}

WebSockets:
{"requestId": "$context.requestId","ip": "$context.identity.sourceIp","caller": "$context.identity.caller","user": "$context.identity.user","requestTime": "$context.requestTime","eventType": "$context.eventType","routeKey": "$context.routeKey","status": "$context.status","connectionId": "$context.connectionId", apiId": "$context.apiId", "domainName": "$context.domainName", "stage": "$context.stage"}

Beyond the standard Log Formats we provide, you can use a wide range of fields for each API type when enabling Custom Access Logging.

To utilize these fields in the integration, create custom pipelines. These pipelines will process field names or values. You’ll also need to create a custom mapping to store your data efficiently. For more information on how to do this, check out our official documentation.

See more details in the Logs reference.

Metrics give you insight into the state of API Gateway. Metrics collected by the AWS API Gateway integration include the number of client and server errors, request and error counts and cache counts.

See more details in the Metrics reference.

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended, or self-manage the Elastic Stack on your hardware.

Before using any AWS integration you will need:

  • AWS Credentials to connect with your AWS account.
  • AWS Permissions to make sure the user you’re using to connect has permission to share the relevant data.

For more details about these requirements, please take a look at the AWS integration documentation.

Use this integration if you only need to collect data from the AWS API Gateway service.

If you want to collect data from two or more AWS services, consider using the AWS integration. When you configure the AWS integration, you can collect data from as many AWS services as you’d like.

For step-by-step instructions on how to set up an integration, see the Getting started guide.

ECS Field Reference

Please refer to the following document for detailed information on ECS fields.

ECS Field Reference

Please refer to the following document for detailed information on ECS fields.