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
We currently support a middleware for tracing methods, [let us know](https://github.com/awslabs/aws-lambda-powertools-typecsript/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title=) if you'd like to see one!
* If you use function-based Lambda handlers you can use the [captureLambdaHanlder()](./_aws_lambda_powertools_tracer.Tracer.html) middy middleware to automatically:
25
+
* * handle the subsegment lifecycle
26
+
* * add the `ColdStart` annotation
27
+
* * add the function response as metadata
28
+
* * add the function error as metadata (if any)
29
+
*
30
+
* @example
31
+
* ```typescript
32
+
* import { Tracer, captureLambdaHandler } from '@aws-lambda-powertools/tracer';
33
+
* import middy from '@middy/core';
34
+
*
35
+
* const tracer = new Tracer({ serviceName: 'my-service' });
* If you use TypeScript Classes to wrap your Lambda handler you can use the [@tracer.captureLambdaHanlder()](./_aws_lambda_powertools_tracer.Tracer.html#captureLambdaHanlder) decorator to automatically:
44
+
* If instead you use TypeScript Classes to wrap your Lambda handler you can use the [@tracer.captureLambdaHanlder()](./_aws_lambda_powertools_tracer.Tracer.html#captureLambdaHanlder) decorator to automatically:
0 commit comments