You might use third party solutions for monitoring serverless applications. If this is the case, enabling tracing for your AWS Lambda functions might be optional. Refer to the documentation of your monitoring solutions to see if you should enable AWS X-Ray tracing or not.
Resources:MyFunction:Type:AWS::Serverless::FunctionProperties:# Required propertiesCodeUri:.Runtime:python3.8Handler:main.handler# Enable active tracingTracing:Active
12345678
provider:tracing:# Enable active tracing for Lambda functionslambda:truefunctions:hello:handler:handler.hello
1 2 3 4 5 6 7 8 91011
resource"aws_lambda_function""this"{function_name="my-function"runtime="python3.8"handler="main.handler"filename="function.zip" # Enable active tracingtracing_config{mode="Active"}}