The Service Map for APM is here!

AWS API Gateway

Crawler Crawler

Overview

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

Enable this integration to see in Datadog all your API Gateway metrics.

Setup

Installation

If you haven’t already, set up the Amazon Web Services integration first.

Metric collection

  1. In the AWS integration tile, ensure that API Gateway is checked under metric collection.

  2. Install the Datadog - AWS API Gateway integration.

Log collection

Enable API Gateway logging:

  1. Go to API gateway in your aws console
  2. Select the wanted API and go to the Stages section
  3. In the Logs tab, enable the cloudwatch logging and the Access logging
  4. Select the INFO level to make sure you have all the requests
  5. Make sure “apigateway” is included in the name of your Cloudwatch log group
    AWS api gateway log collection
  6. Select the JSON format (CLF and CSV are also supported) and we recommend to add the following in the format box:

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

Send Logs to Datadog

  1. If you haven’t already, set up the Datadog log collection AWS Lambda function.
  2. Once the lambda function is installed, manually add a trigger on the Cloudwatch Log group that contains your API Gateway logs in the AWS console:
    cloudwatch log group
    Select the corresponding CloudWatch Log group, add a filter name (but feel free to leave the filter empty) and add the trigger:
    cloudwatch trigger

Once done, go in your Datadog Log section to start exploring your logs!

Data Collected

Metrics

aws.apigateway.4xxerror
(count)
The number of client-side errors
shown as operation
aws.apigateway.5xxerror
(count)
The number of server-side errors
shown as operation
aws.apigateway.count
(count)
The number call to API methods
shown as operation
aws.apigateway.cache_hit_count
(count)
The number of requests served from the API cache
shown as operation
aws.apigateway.cache_miss_count
(count)
The number of requests served from the back end when API caching is enabled
shown as operation
aws.apigateway.latency
(gauge)
The time between when API Gateway receives a request from a client and when it returns a response to the client. The latency includes the integration_latency and other API Gateway overhead.
shown as millisecond
aws.apigateway.latency.maximum
(gauge)
The maximum time between when requests are received and when responses returned
shown as millisecond
aws.apigateway.latency.minimum
(gauge)
The minimum time between when requests are received and when responses returned
shown as millisecond
aws.apigateway.latency.p90
(gauge)
The 90th percentile time between when requests are received and when responses returned
shown as millisecond
aws.apigateway.latency.p95
(gauge)
The 95th percentile time between when requests are received and when responses returned
shown as millisecond
aws.apigateway.latency.p99
(gauge)
The 99th percentile time between when requests are received and when responses returned
shown as millisecond
aws.apigateway.integration_latency
(gauge)
The time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond
aws.apigateway.integration_latency.maximum
(gauge)
The maximum time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond
aws.apigateway.integration_latency.minimum
(gauge)
The minimum time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond
aws.apigateway.integration_latency.p90
(gauge)
The 90th percentile time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond
aws.apigateway.integration_latency.p95
(gauge)
The 95th percentile time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond
aws.apigateway.integration_latency.p99
(gauge)
The 90th percentile time between when API Gateway relays a request to the back end and when it receives a response from the back end.
shown as millisecond

Each of the metrics retrieved from AWS will be assigned the same tags that appear in the AWS console, including but not limited to host name, security-groups, and more.

Events

The AWS API Gateway integration does not include any event at this time.

Service Checks

The AWS API Gateway integration does not include any service check at this time.

Troubleshooting

Need help? Contact Datadog Support.