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 namespace, metric and timestamp (#135)
* add validation for namespace, metric and timestamp
* update typescript, eslint, prettier, npm-pack-zip
* replace faker with non deprecated faker
* update repo to comply with new eslint rules
* update readme with validation errors
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Requirements:
113
113
- Name Length 1-255 characters
114
114
- Name must be ASCII characters only
115
115
- 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.
116
-
-Units must meet CW Metrics unit requirements, if not it will default to None.
116
+
-Metrics must meet CloudWatch Metrics requirements, otherwise a `InvalidMetricError` will be thrown. See [MetricDatum](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) for valid values.
117
117
118
118
Examples:
119
119
@@ -149,6 +149,7 @@ using `setProperty` instead.
149
149
Requirements:
150
150
- Length 1-255 characters
151
151
- ASCII characters only
152
+
- Dimensions must meet CloudWatch Dimensions requirements, otherwise a `InvalidDimensionError` or `DimensionSetExceededError` will be thrown. See [Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Dimension.html) for valid values.
152
153
153
154
Examples:
154
155
```js
@@ -167,6 +168,7 @@ using `setProperty` instead.
167
168
Requirements:
168
169
- Length 1-255 characters
169
170
- ASCII characters only
171
+
- Dimensions must meet CloudWatch Dimensions requirements, otherwise a `InvalidDimensionError` or `DimensionSetExceededError` will be thrown. See [Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Dimension.html) for valid values.
170
172
171
173
Examples:
172
174
@@ -184,6 +186,7 @@ Requirements:
184
186
185
187
- Name Length 1-255 characters
186
188
- Name must be ASCII characters only
189
+
- Namespaces must meet CloudWatch Namespace requirements, otherwise a `InvalidNamespaceError` will be thrown. See [Namespace](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) for valid values.
187
190
188
191
Examples:
189
192
@@ -198,7 +201,7 @@ Sets the CloudWatch [timestamp](https://docs.aws.amazon.com/AmazonCloudWatch/lat
198
201
If set for a given `MetricsLogger`, timestamp will be preserved across calls to flush().
199
202
200
203
Requirements:
201
-
* Date or Unix epoch millis, up to two weeks in the past and up to two hours in the future, as enforced by [CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#about_timestamp).
204
+
* Date or Unix epoch millis, up to two weeks in the past and up to two hours in the future, as enforced by [CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#about_timestamp). If the timestamp is outside of this range, a `InvalidTimestampError` will be thrown.
0 commit comments