Amazon Api Gateway

Présentation

Amazon API Gateway est un service entièrement géré qui permet aux développeurs de créer, publier, gérer, surveiller et sécuriser facilement des API quelque soit l’échelle.

Activez cette intégration pour visualiser dans Datadog toutes vos métriques dʼAPI Gateway.

Configuration

Installation

Si vous ne l’avez pas déjà fait, configurez l’intégration Amazon Web Services.

Collecte de métriques

  1. Sur la page de l’intégration AWS, vérifiez que API Gateway est activé dans l’onglet Metric Collection.

  2. Ajoutez les autorisations suivantes à votre stratégie IAM Datadog afin de récupérer les tags personnalisés appliqués aux étapes API Gateway :

    • apigateway:GET
    • tag:GetResources
  3. Installez l’intégration Datadog/Amazon API Gateway.

Chacune des métriques récupérées à partir d’AWS se voit assigner les mêmes tags que ceux qui apparaissent dans la console AWS, y compris, mais sans s’y limiter, le hostname et les groupes de sécurité.

Remarque : si vous avez activé les métriques CloudWatch détaillées, vous devez les activer pour toutes les ressources ou toutes les routes d’une étape. Sinon, les valeurs agrégées dans Datadog seront incorrectes.

APM

Pour activer la journalisation API Gateway :

  1. Accédez à API Gateway dans votre console AWS.

  2. Sélectionnez l’API souhaitée et accédez à la section Stages.

  3. Dans l’onglet Logs, activez Enable CloudWatch Logs et Enable Access Logging.

  4. Sélectionnez le niveau INFO afin de récupérer l’ensemble des requêtes.

  5. Assurez-vous que le nom de votre groupe CloudWatch commence par api-gateway.

  6. Sélectionnez le format JSON (les formats CLF et CSV sont également pris en charge), et ajoutez ce qui suit dans le champ Log format :

    {
        "apiId": "$context.apiId",
        "stage": "$context.stage",
        "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
    }
    

Envoi de logs à Datadog

  1. Si vous ne l’avez pas déjà fait, configurez la fonction AWS Lambda de collecte de logs avec Datadog.
  2. Une fois la fonction Lambda installée, ajoutez manuellement un déclencheur sur le groupe de logs CloudWatch qui contient vos logs API Gateway depuis la console AWS. Sélectionnez le groupe de logs CloudWatch correspondant, ajoutez un nom de filtre (vous pouvez toutefois laisser le filtre vide) et ajoutez le déclencheur.

Accédez ensuite à la page Logs pour commencer à explorer vos logs.

Données collectées

Métriques

aws.apigateway.4xx
(count)
The number of client-side errors for HTTP APIs
Shown as operation
aws.apigateway.4xxerror
(count)
The number of client-side errors for REST APIs
Shown as operation
aws.apigateway.5xx
(count)
The number of server-side errors for HTTP APIs
Shown as operation
aws.apigateway.5xxerror
(count)
The number of server-side errors for REST APIs
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.client_error
(count)
The average number of requests that have a 4XX response returned by API Gateway before the integration is invoked.
Shown as operation
aws.apigateway.client_error.sum
(count)
The total number of requests that have a 4XX response returned by API Gateway before the integration is invoked.
Shown as operation
aws.apigateway.connect_count
(count)
The average number of messages sent to the $connect route integration.
Shown as operation
aws.apigateway.connect_count.sum
(count)
The total number of messages sent to the $connect route integration.
Shown as operation
aws.apigateway.count
(count)
The number call to API methods
Shown as operation
aws.apigateway.execution_error
(count)
Average errors that occurred when calling the integration.
Shown as operation
aws.apigateway.execution_error.sum
(count)
Total errors that occurred when calling the integration.
Shown as operation
aws.apigateway.integration_error
(count)
The average number of requests that return a 4XX/5XX response from the integration.
Shown as operation
aws.apigateway.integration_error.sum
(count)
The total number of requests that return a 4XX/5XX response from the integration.
Shown as operation
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 99th 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.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.p50
(gauge)
The 50th percentile time between when requests are received and when responses returned
Shown as millisecond
aws.apigateway.latency.p75
(gauge)
The 75th percentile 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.message_count
(count)
The average number of messages sent to the WebSocket API, either from or to the client.
Shown as operation
aws.apigateway.message_count.sum
(count)
The total number of messages sent to the WebSocket API, either from or to the client.
Shown as operation

Événements

L’intégration Amazon APIP Gateway n’inclut aucun événement.

Checks de service

L’intégration Amazon API Gateway n’inclut aucun check de service.

Dépannage

Besoin d’aide ? Contactez l’assistance Datadog.

PREVIEWING: rtrieu/product-analytics-ui-changes