-
Notifications
You must be signed in to change notification settings - Fork 522
Description
Currently, we support an OOTB integration for API Gateway following the default log format provided by AWS.
Default Log Format
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"}
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"}
WebSocket:
{ "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"}
Custom Access Logging
We expect users to make use of Custom Access Logging to customize their log output using context variables available for each API type (HTTP, REST, WebSocket).
Following discussions, the additional context variables should be taken into consideration as they provide the most value including filtering via dashboards, mapped as follows:
{"apiId": "$context.apiId", "domainName": "$context.domainName", "stage": "$context.stage"}
To be noted that since users can define their own schemas, we should specify in the integration documentation our recommended schema that works with the integration pipeline (which matches the default variable names and our chosen log names for additional context variables). In case of custom schemas, users should be directed to create custom pipelines.
Future support for additional context variables is expected by demand.