Skip to content

Commit b219200

Browse files
committed
update undefined cluster to global
1 parent d8f6162 commit b219200

File tree

6 files changed

+20
-28
lines changed

6 files changed

+20
-28
lines changed

google-cloud-bigtable-stats/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@
6868
<dependency>
6969
<groupId>com.google.cloud</groupId>
7070
<artifactId>google-cloud-monitoring</artifactId>
71-
<!-- exclude these dependencies since they are not used and are causing conflict in google-cloud-bigtable -->
7271
<exclusions>
7372
<exclusion>
7473
<groupId>com.google.http-client</groupId>
75-
<artifactId>google-http-client</artifactId>
74+
<artifactId>google-http-client-gson</artifactId>
7675
</exclusion>
7776
<exclusion>
7877
<groupId>com.google.http-client</groupId>
79-
<artifactId>google-http-client-gson</artifactId>
78+
<artifactId>google-http-client</artifactId>
8079
</exclusion>
8180
</exclusions>
8281
</dependency>
@@ -132,6 +131,7 @@
132131
<artifactId>jsr305</artifactId>
133132
</dependency>
134133

134+
<!-- runtime dependency for native image integration test -->
135135
<dependency>
136136
<groupId>com.google.http-client</groupId>
137137
<artifactId>google-http-client</artifactId>

google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,8 @@ static TimeSeries convertTimeSeries(
133133
List<LabelValue> labelValues = timeSeries.getLabelValues();
134134
for (int i = 0; i < labelValues.size(); i++) {
135135
if (PROMOTED_RESOURCE_LABELS.contains(labelKeys.get(i).getKey())) {
136-
if (labelKeys.get(i).getKey().equals(BuiltinMeasureConstants.CLUSTER.getName())
137-
&& labelValues.get(i).getValue().equals("undefined")) {
138-
monitoredResourceBuilder.putLabels(labelKeys.get(i).getKey(), "global");
139-
} else if (labelKeys.get(i).getKey().equals(BuiltinMeasureConstants.ZONE.getName())
140-
&& labelValues.get(i).getValue().equals("undefined")) {
141-
monitoredResourceBuilder.putLabels(labelKeys.get(i).getKey(), "global");
142-
} else {
143-
monitoredResourceBuilder.putLabels(
144-
labelKeys.get(i).getKey(), labelValues.get(i).getValue());
145-
}
136+
monitoredResourceBuilder.putLabels(
137+
labelKeys.get(i).getKey(), labelValues.get(i).getValue());
146138
} else {
147139
metricTagKeys.add(labelKeys.get(i));
148140
metricTagValues.add(labelValues.get(i));

google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class BigtableStackdriverStatsExporter {
4040
@GuardedBy("monitor")
4141
private static BigtableStackdriverStatsExporter instance = null;
4242

43-
private static final Duration EXPORT_INTERVAL = Duration.create(60, 0);
43+
private static final Duration EXPORT_INTERVAL = Duration.create(600, 0);
4444
private static final String RESOURCE_TYPE = "bigtable_client_raw";
4545

4646
private final IntervalMetricReader intervalMetricReader;

google-cloud-bigtable/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@
146146
<artifactId>grpc-alts</artifactId>
147147
<scope>runtime</scope>
148148
</dependency>
149+
<dependency>
150+
<groupId>com.google.http-client</groupId>
151+
<artifactId>google-http-client</artifactId>
152+
<scope>runtime</scope>
153+
</dependency>
154+
<dependency>
155+
<groupId>com.google.http-client</groupId>
156+
<artifactId>google-http-client-gson</artifactId>
157+
<scope>runtime</scope>
158+
</dependency>
149159
<!--
150160
grpc-stub is needed directly by our tests and transitively by grpc-alts at runtime.
151161
So it has to be declared as a direct dependency and to avoid overriding grpc-alts'
@@ -269,16 +279,6 @@
269279
<artifactId>opencensus-impl</artifactId>
270280
<scope>test</scope>
271281
</dependency>
272-
<dependency>
273-
<groupId>com.google.http-client</groupId>
274-
<artifactId>google-http-client</artifactId>
275-
<scope>test</scope>
276-
</dependency>
277-
<dependency>
278-
<groupId>com.google.http-client</groupId>
279-
<artifactId>google-http-client-gson</artifactId>
280-
<scope>test</scope>
281-
</dependency>
282282
<dependency>
283283
<groupId>junit</groupId>
284284
<artifactId>junit</artifactId>

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class BuiltinMetricsTracer extends BigtableTracer {
6767

6868
// Monitored resource labels
6969
private String tableId = "undefined";
70-
private String zone = "undefined";
71-
private String cluster = "undefined";
70+
private String zone = "global";
71+
private String cluster = "global";
7272

7373
// gfe stats
7474
private AtomicLong gfeMissingHeaders = new AtomicLong(0);

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ public void testMutateRowAttempts() {
339339
// and when the record() is called in onOperationCompletion().
340340
verify(statsRecorderWrapper, timeout(50).times(fakeService.getAttemptCounter().get() + 1))
341341
.record(status.capture(), tableId.capture(), zone.capture(), cluster.capture());
342-
assertThat(zone.getAllValues()).containsExactly("undefined", "undefined", ZONE, ZONE);
343-
assertThat(cluster.getAllValues()).containsExactly("undefined", "undefined", CLUSTER, CLUSTER);
342+
assertThat(zone.getAllValues()).containsExactly("global", "global", ZONE, ZONE);
343+
assertThat(cluster.getAllValues()).containsExactly("global", "global", CLUSTER, CLUSTER);
344344
assertThat(status.getAllValues()).containsExactly("UNAVAILABLE", "UNAVAILABLE", "OK", "OK");
345345
}
346346

0 commit comments

Comments
 (0)