From b2192006f859441e58d7f8f98a4da67bd87a05c7 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Fri, 5 Aug 2022 11:25:41 -0400 Subject: [PATCH] update undefined cluster to global --- google-cloud-bigtable-stats/pom.xml | 6 +++--- .../stats/BigtableStackdriverExportUtils.java | 12 ++--------- .../BigtableStackdriverStatsExporter.java | 2 +- google-cloud-bigtable/pom.xml | 20 +++++++++---------- .../v2/stub/metrics/BuiltinMetricsTracer.java | 4 ++-- .../metrics/BuiltinMetricsTracerTest.java | 4 ++-- 6 files changed, 20 insertions(+), 28 deletions(-) diff --git a/google-cloud-bigtable-stats/pom.xml b/google-cloud-bigtable-stats/pom.xml index 4ea560fde7..10b64dc466 100644 --- a/google-cloud-bigtable-stats/pom.xml +++ b/google-cloud-bigtable-stats/pom.xml @@ -68,15 +68,14 @@ com.google.cloud google-cloud-monitoring - com.google.http-client - google-http-client + google-http-client-gson com.google.http-client - google-http-client-gson + google-http-client @@ -132,6 +131,7 @@ jsr305 + com.google.http-client google-http-client diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java index 1d36adbf70..20fe21c5c2 100644 --- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java +++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java @@ -133,16 +133,8 @@ static TimeSeries convertTimeSeries( List labelValues = timeSeries.getLabelValues(); for (int i = 0; i < labelValues.size(); i++) { if (PROMOTED_RESOURCE_LABELS.contains(labelKeys.get(i).getKey())) { - if (labelKeys.get(i).getKey().equals(BuiltinMeasureConstants.CLUSTER.getName()) - && labelValues.get(i).getValue().equals("undefined")) { - monitoredResourceBuilder.putLabels(labelKeys.get(i).getKey(), "global"); - } else if (labelKeys.get(i).getKey().equals(BuiltinMeasureConstants.ZONE.getName()) - && labelValues.get(i).getValue().equals("undefined")) { - monitoredResourceBuilder.putLabels(labelKeys.get(i).getKey(), "global"); - } else { - monitoredResourceBuilder.putLabels( - labelKeys.get(i).getKey(), labelValues.get(i).getValue()); - } + monitoredResourceBuilder.putLabels( + labelKeys.get(i).getKey(), labelValues.get(i).getValue()); } else { metricTagKeys.add(labelKeys.get(i)); metricTagValues.add(labelValues.get(i)); diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java index 199cf7936e..6cb24505b5 100644 --- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java +++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java @@ -40,7 +40,7 @@ public class BigtableStackdriverStatsExporter { @GuardedBy("monitor") private static BigtableStackdriverStatsExporter instance = null; - private static final Duration EXPORT_INTERVAL = Duration.create(60, 0); + private static final Duration EXPORT_INTERVAL = Duration.create(600, 0); private static final String RESOURCE_TYPE = "bigtable_client_raw"; private final IntervalMetricReader intervalMetricReader; diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index c672d2f347..4872466846 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -146,6 +146,16 @@ grpc-alts runtime + + com.google.http-client + google-http-client + runtime + + + com.google.http-client + google-http-client-gson + runtime +