From 9747f9e258ed939eef4336b0ea6e9109cb032530 Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Thu, 25 Jan 2024 15:54:11 -0800 Subject: [PATCH] mend --- .../core/metrics/reporter/DimensionedCloudWatchReporter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flint-core/src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java b/flint-core/src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java index 3d1876448..8d2257e28 100644 --- a/flint-core/src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java +++ b/flint-core/src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java @@ -372,7 +372,10 @@ public MetricInfo getMetricInfo(DimensionedName dimensionedName) { Set dimensions = new HashSet<>(); if (doesNameConsistsOfMetricNameSpace(parts)) { metricName = Stream.of(parts).skip(2).collect(Collectors.joining(".")); - addInstanceRoleDimension(dimensions, parts); + // Exclude instance role for OpenSearch metrics + if (!parts[3].equals("opensearch")) { + addInstanceRoleDimension(dimensions, parts); + } } addDefaultDimensionsForSparkJobMetrics(dimensions); dimensions.addAll(dimensionedName.getDimensions());