Skip to content

Is there a way to debug Tracing? #2062

Answered byam29d
juaoose asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @juaoose ,

you can attach the logger to the tracer and see debug statements.

import{Tracer}from'@aws-lambda-powertools/tracer';import{Logger}from'@aws-lambda-powertools/logger';consttracer=newTracer();constlogger=newLogger();tracer.provider.setLogger(logger);

if you set POWERTOOLS_LOG_LEVEL to DEBUG you will see something like this

{ "cold_start": true, "function_arn": "arn:aws:lambda:eu-west-1:xxxx:function:CdkStack-MyFunction3BAA72D1-Dt80v4r2LZZq", "function_memory_size": 1024, "function_name": "CdkStack-MyFunction3BAA72D1-Dt80v4r2LZZq", "function_request_id": "e822c766-ad93-45b0-af22-b6037e145111", "level": "DEBUG", "message": "UDP…

Replies: 1 comment

Comment options

am29d
Feb 14, 2024
Maintainer

You must be logged in to vote
0 replies
Answer selected bydreamorosi
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@juaoose@am29d
close