@@ -145,7 +145,7 @@ See examples below:
145
145
import { Context } from 'aws-lambda';
146
146
import middy from '@middy/core';
147
147
148
- const metrics = new Metrics({namespace:" serverlessAirline" , service:" orders" });
148
+ const metrics = new Metrics({ namespace: ' serverlessAirline' , service: ' orders' });
149
149
150
150
const lambdaHandler = async (event: any, context: Context) => {
151
151
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
@@ -205,7 +205,7 @@ If you do not the middleware or decorator, you have to flush your metrics manual
205
205
If metrics are provided, and any of the following criteria are not met, a ** ` RangeError ` ** exception will be raised:
206
206
207
207
* Maximum of 9 dimensions
208
- * Namespace is set, and no more than one
208
+ * Namespace is set only once (or none)
209
209
* Metric units must be [supported by CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html)
210
210
211
211
@@ -219,7 +219,7 @@ See below an example of how to automatically flush metrics with the Middy-compat
219
219
import { Context } from ' aws-lambda' ;
220
220
import middy from ' @middy/core' ;
221
221
222
- const metrics = new Metrics ({namespace:" exampleApplication" , service:" exampleService" });
222
+ const metrics = new Metrics ({ namespace: ' exampleApplication' , service: ' exampleService' });
223
223
224
224
const lambdaHandler = async (event : any , context : Context ) => {
225
225
metrics .addMetric (' bookingConfirmation' , MetricUnits .Count , 1 );
@@ -360,7 +360,7 @@ You can optionally capture cold start metrics with the `logMetrics` middleware o
360
360
import { Context } from 'aws-lambda';
361
361
import middy from '@middy/core';
362
362
363
- const metrics = new Metrics({namespace:" serverlessAirline" , service:" orders" });
363
+ const metrics = new Metrics({namespace: ' serverlessAirline' , service: ' orders' });
364
364
365
365
const lambdaHandler = async (event: any, context: Context) => {
366
366
metrics.addMetric('successfulBooking', MetricUnits.Count, 1);
@@ -377,7 +377,7 @@ You can optionally capture cold start metrics with the `logMetrics` middleware o
377
377
import { Context, Callback } from 'aws-lambda';
378
378
import middy from '@middy/core';
379
379
380
- const metrics = new Metrics({namespace:" serverlessAirline" , service:" orders" });
380
+ const metrics = new Metrics({namespace: ' serverlessAirline' , service: ' orders' });
381
381
382
382
export class MyFunction {
383
383
0 commit comments