chalice icon indicating copy to clipboard operation
chalice copied to clipboard

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

Open dreamorosi opened this issue 4 years ago • 3 comments

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 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 property that would allow to set CloudWatch access logging on the stage.

dreamorosi avatar Jun 10 '21 22:06 dreamorosi

Looks like this is a bug with the cloudformation/terraform packaging. The chalice deploy backend does create an API Gateway with tracing enabled (source), so I think this was just a miss on our end.

The AccessLogSetting would likely be a separate config option.

jamesls avatar Jun 14 '21 19:06 jamesls

Just for the sake of those who stumble upon this issue, in the meantime that the feature/bug is implemented you can enable both settings via CloudFormation template merge; at the time of opening this issue I wasn't aware of it yet but it worked.

dreamorosi avatar Jun 29 '21 10:06 dreamorosi

I use chalice with cdk and i use cdk deploy without chalice package, so this issue is super important for me as i need manually go and update each apigateway to use xray or write a script for this. Any updates?

Matvii-Boichenko avatar Mar 24 '23 17:03 Matvii-Boichenko