From 768202c757c91721a8bf8dcb3f243fe6446acf65 Mon Sep 17 00:00:00 2001 From: Jared Nance Date: Thu, 18 Mar 2021 17:34:18 -0500 Subject: [PATCH] Fix documentation for setDimension --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c9adc98..0d2d52a2 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ putDimensions(DimensionSet.of("Operation", "Aggregator")) putDimensions(DimensionSet.of("Operation", "Aggregator", "DeviceType", "Actuator")) ``` -- MetricsLogger **setDimensions**(DimensionSet dimensions) +- MetricsLogger **setDimensions**(DimensionSet... dimensionSets) Explicitly override all dimensions. This will remove the default dimensions. @@ -129,9 +129,20 @@ setDimensions(DimensionSet.of( "Operation", "Aggregator", "DeviceType", "Actuator") ) +``` + +To create an aggregate metric across all dimensions, you can use an empty `DimensionsSet`: +```java +setDimensions( + DimensionSet.of( + "Operation", "Aggregator", + "DeviceType", "Actuator"), + new DimensionSet() +) ``` + - MetricsLogger **setNamespace**(String value) Sets the CloudWatch [namespace](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) that extracted metrics should be published to. If not set, a default value of aws-embedded-metrics will be used.