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
Using the Middy middleware or decorator will **automatically validate, serialize, and flush** all your metrics. During metrics validation, if no metrics are provided then a warning will be logged, but no exception will be raised.
277
+
Using the Middy middleware or decorator will **automatically validate, serialize, and flush** all your metrics. During metrics validation, if no metrics are provided then a warning will be logged, but no exception will be thrown.
278
278
If you do not use the middleware or decorator, you have to flush your metrics manually.
279
279
280
280
281
281
!!! warning "Metric validation"
282
-
If metrics are provided, and any of the following criteria are not met, a **`RangeError`** exception will be raised:
282
+
If metrics are provided, and any of the following criteria are not met, a **`RangeError`** exception will be thrown:
283
283
284
284
* Maximum of 9 dimensions
285
285
* Namespace is set only once (or none)
@@ -433,7 +433,7 @@ The `logMetrics` decorator of the metrics utility can be used when your Lambda h
433
433
434
434
#### Throwing a RangeError when no metrics are emitted
435
435
436
-
If you want to ensure that at least one metric is emitted before you flush them, you can use the `raiseOnEmptyMetrics` parameter and pass it to the middleware or decorator:
436
+
If you want to ensure that at least one metric is emitted before you flush them, you can use the `throwOnEmptyMetrics` parameter and pass it to the middleware or decorator:
0 commit comments