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.
Si vous ne l’avez pas déjà fait, configurez d’abord l’intégration Amazon Web Services.
Dans le carré d’intégration AWS, assurez-vous que l’option API Gateway
est cochée dans la section concernant la collecte des métriques.
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
Configurez l'intégration Datadog/AWS API Gateway.
Pour activer la journalisation API Gateway :
Accédez à API Gateway dans votre console AWS.
Sélectionnez l’API souhaitée et accédez à la section Stages.
Dans l’onglet Logs, activez Enable CloudWatch Logs et Enable Access Logging.
Sélectionnez le niveau INFO
afin de récupérer l’ensemble des requêtes.
Assurez-vous d’inclure apigateway
dans le nom de votre groupe Cloudwatch.
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 :
{
"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
}
Accédez ensuite à la section Log de Datadog pour commencer à explorer vos logs !
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 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 |
Chacune des métriques récupérées à partir d’AWS se verra 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é.
L’intégration AWS API Gateway n’inclut aucun événement.
L’intégration AWS API Gateway n’inclut aucun check de service.
Besoin d’aide ? Contactez l’assistance Datadog.
Sur cette page