Skip to content

Commit 6b473bd

Browse files
committed
docs: updated return type for all async handlers
1 parent 479820f commit 6b473bd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/core/metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ You can add default dimensions to your metrics by passing them as parameters in
256256
export class MyFunction extends LambdaInterface {
257257
// Decorate your handler class method
258258
@metrics.logMetrics({defaultDimensions: DEFAULT_DIMENSIONS})
259-
public handler(_event: any, _context: any): Promise<unknown> {
259+
public handler(_event: any, _context: any): Promise<void> {
260260
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
261261
}
262262
}
@@ -399,7 +399,7 @@ The `logMetrics` decorator of the metrics utility can be used when your Lambda h
399399
export class MyFunction extends LambdaInterface {
400400

401401
@metrics.logMetrics()
402-
public async handler(_event: any, _context: any): Promise<unknown> {
402+
public async handler(_event: any, _context: any): Promise<void> {
403403
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
404404
}
405405
}
@@ -480,7 +480,7 @@ You can optionally capture cold start metrics with the `logMetrics` middleware o
480480
export class MyFunction extends LambdaInterface {
481481

482482
@metrics.logMetrics({ captureColdStartMetric: true })
483-
public async handler(_event: any, _context: any): Promise<unknown> {
483+
public async handler(_event: any, _context: any): Promise<void> {
484484
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
485485
}
486486
}
@@ -602,7 +602,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use `singleMetr
602602
class Lambda extends LambdaInterface {
603603

604604
@metrics.logMetrics()
605-
public async handler(_event: any, _context: any): Promise<unknown> {
605+
public async handler(_event: any, _context: any): Promise<void> {
606606
metrics.addDimension('metricUnit', 'milliseconds');
607607
// This metric will have the "metricUnit" dimension, and no "metricType" dimension:
608608
metrics.addMetric('latency', MetricUnits.Milliseconds, 56);

docs/core/tracer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the
158158
class Lambda extends LambdaInterface {
159159
// Decorate your handler class method
160160
@tracer.captureLambdaHandler()
161-
public handler(_event: any, _context: any) {
161+
public async handler(_event: any, _context: any): Promise<void> {
162162
/* ... */
163163
}
164164
}
@@ -270,7 +270,7 @@ You can trace other methods using the `captureMethod` decorator or manual instru
270270
return 'foo bar';
271271
}
272272

273-
public async handler(_event: any, _context: any): Promise<unknown> {
273+
public async handler(_event: any, _context: any): Promise<void> {
274274
/* ... */
275275
}
276276
}

0 commit comments

Comments
 (0)