You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -572,13 +572,15 @@ It's a [two-step process](https://docs.aws.amazon.com/lambda/latest/dg/services-
572
572
573
573
=== "template.yaml"
574
574
575
-
```yaml hl_lines="14"
575
+
```yaml hl_lines="7-8 14"
576
576
AWSTemplateFormatVersion: "2010-09-09"
577
577
Transform: AWS::Serverless-2016-10-31
578
578
Description: Sample SAM Template for powertools-quickstart
579
579
Globals:
580
580
Function:
581
581
Timeout: 3
582
+
Api:
583
+
TracingEnabled: true
582
584
Resources:
583
585
HelloWorldFunction:
584
586
Type: AWS::Serverless::Function
@@ -613,7 +615,10 @@ Let's break it down:
613
615
???+ question
614
616
But how do I enable tracing for the Lambda function and what permissions do I need?
615
617
616
-
Within `template.yaml` on line 14, we added a new Serverless Function property: `Tracing: Active`. This will enable tracing for the [Lambda function resource](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html#services-xray-cloudformation){target="_blank"}, and add a managed IAM Policy named [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess){target="_blank"} to allow Lambda to send traces to AWS X-Ray.
618
+
We've made the following changes in `template.yaml` for this to work seamless:
619
+
620
+
***L7-8**: Enables tracing for Amazon API Gateway
621
+
***L14**: Enables tracing for our Serverless Function. This will also add a managed IAM Policy named [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess){target="_blank"} to allow Lambda to send traces to AWS X-Ray.
617
622
618
623
!!! danger "TODO: Revisit to see if it's still necessary"
619
624
@@ -623,6 +628,7 @@ Within `template.yaml` on line 14, we added a new Serverless Function property:
623
628
624
629
### Enriching our generates traces
625
630
631
+
What we've done helps bring an initial visibility
626
632
627
633
cold start invocations
628
634
@@ -704,15 +710,15 @@ Now, let's try to simplify it with Lambda Powertools:
0 commit comments