serverless / serverless/serverless

Option to enable AWS api logging without full request/response

Open
#6,209 1 comment 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat/aws-event-api-gateway enhancement
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

Feature proposal for more granular AWS API Gateway logging

Description

Actual behavior:

  • Enabling logging at the API GW level via provider->logs->restApi=true is useful, but it also adds "log full requests/responses data" (/*/*/logging/dataTrace), which may not be desired due to compliance requirements or just plain cost concerns

https://github.com/serverless/serverless/blob/0b53d71a8ff28e51f0080afbe8e0f513bfccb797/lib/plugins/aws/package/compile/events/apiGateway/lib/hack/updateStage.js#L193

Desired behavior:

  • Cloudwatch basic logs, cloudwatch full (dataTrace) logs, and access logging can be individually enabled/disabled.

Nice to have: have option of overriding the access log format and CloudWatch Group (in a shared API GW situation, you don't want the service name being encoded into the CloudWatch Group).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/plugins/aws/package/compile/events/apiGateway/lib/hack/updateStage.js around the referenced logging configuration. Review how provider->logs->restApi currently enables API Gateway logging, then define and implement independently controllable basic logs, dataTrace logs, and access logging; the access-log format and CloudWatch Group overrides are optional nice-to-haves.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
api, cloud, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.