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
Explicitly clear all custom dimensions. Set `useDefault` to `true` to keep the default dimensions.
191
+
192
+
Example:
193
+
194
+
```js
195
+
resetDimensions(false) // this will clear all custom dimensions as well as disable default dimensions
179
196
```
180
197
181
198
-**setNamespace**(String value)
@@ -188,7 +205,7 @@ Requirements:
188
205
- Name must be ASCII characters only
189
206
- 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.
Flushes the current MetricsContext to the configured sink and resets all properties, dimensions and metric values. The namespace and default dimensions will be preserved across flushes. Timestamp will be preserved if set explicitly via `setTimestamp()`.
232
+
Flushes the current MetricsContext to the configured sink and resets all properties and metric values. The namespace and default dimensions will be preserved across flushes. Custom dimensions are preserved by default, but this behavior can be changed by setting `logger.flushPreserveDimensions = false`. Timestamp will be preserved if set explicitly via `setTimestamp()`.
233
+
234
+
Examples:
235
+
236
+
```js
237
+
logger.flush() // custom and default dimensions will be preserved after each flush
238
+
```
239
+
240
+
```js
241
+
logger.flushPreserveDimensions=false
242
+
logger.flush() // only default dimensions will be preserved after flush()
243
+
```
244
+
245
+
```js
246
+
logger.flushPreserveDimensions=false
247
+
logger.resetDimensions(false)
248
+
logger.flush() // default dimensions are disabled - no dimensions will be preserved after flush()
0 commit comments