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
1. Binding your handler method allows your handler to access `this`.
@@ -412,6 +412,69 @@ Use **`POWERTOOLS_TRACER_CAPTURE_RESPONSE=false`** environment variable to instr
412
412
2. You might manipulate **streaming objects that can be read only once**; this prevents subsequent calls from being empty
413
413
3. You might return **more than 64K** of data _e.g., `message too long` error_
414
414
415
+
Alternatively, use the `captureResponse: false` option in both `tracer.captureLambdaHandler()` and `tracer.captureMethod()` decorators, or use the same option in the Middy `captureLambdaHander` middleware to instruct Tracer **not** to serialize function responses as metadata.
416
+
417
+
=== "method.ts"
418
+
419
+
```typescript hl_lines="6"
420
+
import { Tracer } from '@aws-lambda-powertools/tracer';
421
+
422
+
const tracer = new Tracer({ serviceName: 'serverlessAirline' });
423
+
424
+
class Lambda implements LambdaInterface {
425
+
@tracer.captureMethod({ captureResult: false })
426
+
public getChargeId(): string {
427
+
/* ... */
428
+
return 'foo bar';
429
+
}
430
+
431
+
public async handler(_event: any, _context: any): Promise<void> {
0 commit comments