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
Copy file name to clipboardExpand all lines: packages/metrics/README.md
+65-4Lines changed: 65 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,7 @@ class Lambda implements LambdaInterface {
258
258
> CloudWatch EMF supports a max of 100 metrics per batch. Metrics utility will flush all metrics when adding the 100th metric. Subsequent metrics, e.g. 101th, will be aggregated into a new EMF object, for your convenience.
259
259
260
260
>### ! Do not create metrics or dimensions outside the handler
261
-
> Metrics or dimensions added in the global scope will only be added during cold start. Disregard if you that's the intended behaviour.
261
+
> Metrics or dimensions added in the global scope will only be added during cold start. Disregard if that's the intended behaviour.
262
262
263
263
### Adding default dimensions
264
264
You can use either setDefaultDimensions method or by passing a defaultDimensions object to either the decorator or to the constructor
@@ -346,6 +346,8 @@ If you need to log the metrics from within your code or if you do not wish to us
thrownewError(`Adding ${Object.keys(dimensions).length} dimensions would exceed max dimension count of${MAX_DIMENSION_COUNT}`);
47
+
thrownewRangeError(`Unable to add ${Object.keys(dimensions).length} dimensions: the number of metric dimensions must be lower than${MAX_DIMENSION_COUNT}`);
48
48
}
49
49
this.dimensions=newDimensions;
50
50
}
@@ -106,10 +106,8 @@ class Metrics implements MetricsInterface {
106
106
Name: metricDefinition.name,
107
107
Unit: metricDefinition.unit
108
108
}));
109
-
if(metricDefinitions.length===0){
110
-
if(this.raiseOnEmptyMetrics){
111
-
thrownewError('Must contain at least one metric');
0 commit comments