aws / aws/chalice

Support for AccessLogSetting and TracingEnabled from AWS::Serverless::Api

Open
#1,753 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Currently Chalice allows for an `xray` key that according to the documentation is:
> A boolean that turns on AWS XRay’s Active tracing configuration. This will turn on XRay for both Lambda functions and API Gateway stages.

What it actually does is to enable tracing only for the functions but not the API Gateway. The generated CloudFormation template has a `"Tracing": "Active"` property in the `AWS::Serverless::Function` resource but doesn't have the [`TracingEnabled`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-tracingenabled) needed in the `AWS::Serverless::Api` resources to enable tracing.

Also the access logs are not implemented at all and would be great to have them to implement best observability practices. `AWS::Serverless::Api` exposes a [`AccessLogSetting`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-accesslogsetting) property that would allow to set CloudWatch access logging on the stage.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the xray key becomes the generated CloudFormation template, comparing the AWS::Serverless::Function and AWS::Serverless::Api resources. Determine where the API resource should receive TracingEnabled and AccessLogSetting, then verify that the generated template enables API Gateway tracing and CloudWatch access logging as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
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.