Skip to content

Commit 24db439

Browse files
committed
chore: add tips to the docs about setting custom name
1 parent 0628206 commit 24db439

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: docs/core/tracer.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ You can trace other Class methods using the `captureMethod` decorator or any arb
244244

245245
class Lambda implements LambdaInterface {
246246
// Decorate your class method
247-
@tracer.captureMethod()
247+
@tracer.captureMethod() // (1)
248248
public getChargeId(): string {
249249
/* ... */
250250
return 'foo bar';
@@ -256,10 +256,11 @@ You can trace other Class methods using the `captureMethod` decorator or any arb
256256
}
257257
258258
const handlerClass = new Lambda();
259-
export const handler = handlerClass.handler.bind(handlerClass); // (1)
259+
export const handler = handlerClass.handler.bind(handlerClass); // (2)
260260
```
261261

262-
1. Binding your handler method allows your handler to access `this`.
262+
1. You can set a custom name ofr the subsegment by passing `subsegmentName` to the decorator, like: `@tracer.captureMethod({ subSegmentName: '### myCustomMethod' })`.
263+
2. Binding your handler method allows your handler to access `this`.
263264

264265
=== "Manual"
265266

0 commit comments

Comments
 (0)