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
Add validation for dimension, metric, namespace and timestamp (#119)
* add validation for dimension, metric, namespace and timestamp
* fix thread safety test using invalid log group name
* migrate for junit5 for some test classes
* fix code smells
* fix integ tests
* add DimensionSetExceededException to readme
* linter fix
* update link to timestamp specs
* update readme with validation errors
* update packages and rm duplicates
- Values must be in the range of 8.515920e-109 to 1.174271e+108. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.
88
-
-Units must meet CloudWatch Metrics unit requirements, if not it will default to None. See [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) for valid values.
100
+
-Metrics must meet CloudWatch Metrics requirements, otherwise a `InvalidMetricException` will be thrown. See [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) for valid values.
- Dimensions must meet CloudWatch Dimension requirements, otherwise a `InvalidDimensionException` or `DimensionSetExceededException` will be thrown. See [Dimension](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Dimension.html) for valid values.
Explicitly override all dimensions. This will remove the default dimensions.
153
+
Explicitly override all dimensions. This will remove the default dimensions unless `useDefault` is set to `true`.
140
154
141
155
**WARNING**:Each dimension set will result in a new CloudWatch metric (even dimension sets with the same values).
142
156
If the cardinality of a particular value is expected to be high, you should consider
@@ -146,6 +160,7 @@ Requirements:
146
160
147
161
- Length 1-255 characters
148
162
- ASCII characters only
163
+
- Dimensions must meet CloudWatch Dimension requirements, otherwise a `InvalidDimensionException` or `DimensionSetExceededException` will be thrown. See [Dimension](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Dimension.html) for valid values.
Explicitly clear all custom dimensions. The behavior of whether default dimensions should be used can be configured by the input parameter.
@@ -189,6 +200,7 @@ Requirements:
189
200
190
201
- Name Length 1-255 characters
191
202
- Name must be ASCII characters only
203
+
- Namespace must meet CloudWatch requirements, otherwise a `InvalidNamespaceException` will be thrown. See [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) for valid values.
192
204
193
205
Examples:
194
206
@@ -200,6 +212,8 @@ setNamespace("MyApplication")
200
212
201
213
Sets the timestamp of the metrics. If not set, current time of the client will be used.
202
214
215
+
Timestamp must meet CloudWatch requirements, otherwise a `InvalidTimestampException` will be thrown. See [Timestamps](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#about_timestamp) for valid values.
0 commit comments