@@ -256,7 +256,7 @@ You can add default dimensions to your metrics by passing them as parameters in
256
256
export class MyFunction extends LambdaInterface {
257
257
// Decorate your handler class method
258
258
@metrics.logMetrics({defaultDimensions: DEFAULT_DIMENSIONS})
259
- public handler(_event: any, _context: any): Promise<unknown > {
259
+ public handler(_event: any, _context: any): Promise<void > {
260
260
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
261
261
}
262
262
}
@@ -399,7 +399,7 @@ The `logMetrics` decorator of the metrics utility can be used when your Lambda h
399
399
export class MyFunction extends LambdaInterface {
400
400
401
401
@metrics.logMetrics()
402
- public async handler(_event: any, _context: any): Promise<unknown > {
402
+ public async handler(_event: any, _context: any): Promise<void > {
403
403
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
404
404
}
405
405
}
@@ -480,7 +480,7 @@ You can optionally capture cold start metrics with the `logMetrics` middleware o
480
480
export class MyFunction extends LambdaInterface {
481
481
482
482
@metrics.logMetrics({ captureColdStartMetric: true })
483
- public async handler(_event: any, _context: any): Promise<unknown > {
483
+ public async handler(_event: any, _context: any): Promise<void > {
484
484
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
485
485
}
486
486
}
@@ -602,7 +602,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use `singleMetr
602
602
class Lambda extends LambdaInterface {
603
603
604
604
@metrics.logMetrics()
605
- public async handler(_event: any, _context: any): Promise<unknown > {
605
+ public async handler(_event: any, _context: any): Promise<void > {
606
606
metrics.addDimension('metricUnit', 'milliseconds');
607
607
// This metric will have the "metricUnit" dimension, and no "metricType" dimension:
608
608
metrics.addMetric('latency', MetricUnits.Milliseconds, 56);
0 commit comments