Skip to content

Commit 13b7d5c

Browse files
authored
Merge branch 'main' into client-id-branch
2 parents c770b77 + a8dba0a commit 13b7d5c

File tree

33 files changed

+512
-220
lines changed

33 files changed

+512
-220
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [6.91.1](https://github.com/googleapis/java-spanner/compare/v6.91.0...v6.91.1) (2025-04-21)
4+
5+
6+
### Bug Fixes
7+
8+
* SkipHint in the internal parser skipped too much ([#3827](https://github.com/googleapis/java-spanner/issues/3827)) ([fbf7b4c](https://github.com/googleapis/java-spanner/commit/fbf7b4c4324c4d565bfe3950ecf80de02c88f16e))
9+
310
## [6.91.0](https://github.com/googleapis/java-spanner/compare/v6.90.0...v6.91.0) (2025-04-17)
411

512

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-spanner'
5656
If you are using Gradle without BOM, add this to your dependencies:
5757

5858
```Groovy
59-
implementation 'com.google.cloud:google-cloud-spanner:6.91.0'
59+
implementation 'com.google.cloud:google-cloud-spanner:6.91.1'
6060
```
6161

6262
If you are using SBT, add this to your dependencies:
6363

6464
```Scala
65-
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.91.0"
65+
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.91.1"
6666
```
6767

6868
## Authentication
@@ -728,7 +728,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
728728
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
729729
[stability-image]: https://img.shields.io/badge/stability-stable-green
730730
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
731-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.91.0
731+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.91.1
732732
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
733733
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
734734
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>com.google.cloud</groupId>
2626
<artifactId>google-cloud-spanner-parent</artifactId>
27-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
27+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
2828
</parent>
2929

3030
<properties>

google-cloud-spanner-bom/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner-bom</artifactId>
6-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>pom</packaging>
88
<parent>
99
<groupId>com.google.cloud</groupId>
@@ -53,43 +53,43 @@
5353
<dependency>
5454
<groupId>com.google.cloud</groupId>
5555
<artifactId>google-cloud-spanner</artifactId>
56-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
56+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
5757
</dependency>
5858
<dependency>
5959
<groupId>com.google.cloud</groupId>
6060
<artifactId>google-cloud-spanner</artifactId>
6161
<type>test-jar</type>
62-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
62+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
6363
</dependency>
6464
<dependency>
6565
<groupId>com.google.api.grpc</groupId>
6666
<artifactId>grpc-google-cloud-spanner-v1</artifactId>
67-
<version>6.91.0</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
67+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
6868
</dependency>
6969
<dependency>
7070
<groupId>com.google.api.grpc</groupId>
7171
<artifactId>grpc-google-cloud-spanner-admin-instance-v1</artifactId>
72-
<version>6.91.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
72+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
7373
</dependency>
7474
<dependency>
7575
<groupId>com.google.api.grpc</groupId>
7676
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
77-
<version>6.91.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
77+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
7878
</dependency>
7979
<dependency>
8080
<groupId>com.google.api.grpc</groupId>
8181
<artifactId>proto-google-cloud-spanner-admin-instance-v1</artifactId>
82-
<version>6.91.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
82+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
8383
</dependency>
8484
<dependency>
8585
<groupId>com.google.api.grpc</groupId>
8686
<artifactId>proto-google-cloud-spanner-v1</artifactId>
87-
<version>6.91.0</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
87+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
8888
</dependency>
8989
<dependency>
9090
<groupId>com.google.api.grpc</groupId>
9191
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
92-
<version>6.91.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
92+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
9393
</dependency>
9494
</dependencies>
9595
</dependencyManagement>

google-cloud-spanner-executor/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.google.cloud</groupId>
77
<artifactId>google-cloud-spanner-executor</artifactId>
8-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
8+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
99
<packaging>jar</packaging>
1010
<name>Google Cloud Spanner Executor</name>
1111

1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-spanner-parent</artifactId>
15-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
15+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1616
</parent>
1717

1818
<properties>

google-cloud-spanner/clirr-ignored-differences.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,13 @@
758758
<method>boolean isEnableGRPCBuiltInMetrics()</method>
759759
</difference>
760760

761+
<!-- Added AFE Server Timing option -->
762+
<difference>
763+
<differenceType>7012</differenceType>
764+
<className>com/google/cloud/spanner/SpannerOptions$SpannerEnvironment</className>
765+
<method>boolean isEnableAFEServerTiming()</method>
766+
</difference>
767+
761768
<!-- Added Monitoring host option -->
762769
<difference>
763770
<differenceType>7012</differenceType>
@@ -899,7 +906,7 @@
899906
<className>com/google/cloud/spanner/connection/Connection</className>
900907
<method>java.lang.String getDefaultSequenceKind()</method>
901908
</difference>
902-
909+
903910
<!-- Default isolation level -->
904911
<difference>
905912
<differenceType>7012</differenceType>

google-cloud-spanner/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner</artifactId>
6-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>jar</packaging>
88
<name>Google Cloud Spanner</name>
99
<url>https://github.com/googleapis/java-spanner</url>
1010
<description>Java idiomatic client for Google Cloud Spanner.</description>
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>google-cloud-spanner-parent</artifactId>
14-
<version>6.91.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
14+
<version>6.91.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1515
</parent>
1616
<properties>
1717
<site.installationModule>google-cloud-spanner</site.installationModule>

google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsConstant.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io.opentelemetry.sdk.metrics.InstrumentType;
2828
import io.opentelemetry.sdk.metrics.View;
2929
import java.util.Collection;
30+
import java.util.List;
3031
import java.util.Map;
3132
import java.util.Set;
3233
import java.util.stream.Collectors;
@@ -39,6 +40,9 @@ public class BuiltInMetricsConstant {
3940
static final String SPANNER_METER_NAME = "spanner-java";
4041
static final String GRPC_METER_NAME = "grpc-java";
4142
static final String GFE_LATENCIES_NAME = "gfe_latencies";
43+
static final String AFE_LATENCIES_NAME = "afe_latencies";
44+
static final String GFE_CONNECTIVITY_ERROR_NAME = "gfe_connectivity_error_count";
45+
static final String AFE_CONNECTIVITY_ERROR_NAME = "afe_connectivity_error_count";
4246
static final String OPERATION_LATENCIES_NAME = "operation_latencies";
4347
static final String ATTEMPT_LATENCIES_NAME = "attempt_latencies";
4448
static final String OPERATION_LATENCY_NAME = "operation_latency";
@@ -52,7 +56,10 @@ public class BuiltInMetricsConstant {
5256
ATTEMPT_LATENCIES_NAME,
5357
OPERATION_COUNT_NAME,
5458
ATTEMPT_COUNT_NAME,
55-
GFE_LATENCIES_NAME)
59+
GFE_LATENCIES_NAME,
60+
AFE_LATENCIES_NAME,
61+
GFE_CONNECTIVITY_ERROR_NAME,
62+
AFE_CONNECTIVITY_ERROR_NAME)
5663
.stream()
5764
.map(m -> METER_NAME + '/' + m)
5865
.collect(Collectors.toSet());
@@ -110,14 +117,14 @@ public class BuiltInMetricsConstant {
110117
static final Set<String> GRPC_LB_RLS_ATTRIBUTES =
111118
ImmutableSet.of("grpc.lb.rls.data_plane_target", "grpc.lb.pick_result");
112119

120+
static List<Double> BUCKET_BOUNDARIES =
121+
ImmutableList.of(
122+
0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0,
123+
16.0, 17.0, 18.0, 19.0, 20.0, 25.0, 30.0, 40.0, 50.0, 65.0, 80.0, 100.0, 130.0, 160.0,
124+
200.0, 250.0, 300.0, 400.0, 500.0, 650.0, 800.0, 1000.0, 2000.0, 5000.0, 10000.0, 20000.0,
125+
50000.0, 100000.0, 200000.0, 400000.0, 800000.0, 1600000.0, 3200000.0);
113126
static Aggregation AGGREGATION_WITH_MILLIS_HISTOGRAM =
114-
Aggregation.explicitBucketHistogram(
115-
ImmutableList.of(
116-
0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0,
117-
15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 25.0, 30.0, 40.0, 50.0, 65.0, 80.0, 100.0, 130.0,
118-
160.0, 200.0, 250.0, 300.0, 400.0, 500.0, 650.0, 800.0, 1000.0, 2000.0, 5000.0,
119-
10000.0, 20000.0, 50000.0, 100000.0, 200000.0, 400000.0, 800000.0, 1600000.0,
120-
3200000.0));
127+
Aggregation.explicitBucketHistogram(BUCKET_BOUNDARIES);
121128

122129
static final Collection<String> GRPC_METRICS_ENABLED_BY_DEFAULT =
123130
ImmutableList.of(
@@ -145,14 +152,6 @@ static Map<InstrumentSelector, View> getAllViews() {
145152
BuiltInMetricsConstant.AGGREGATION_WITH_MILLIS_HISTOGRAM,
146153
InstrumentType.HISTOGRAM,
147154
"ms");
148-
defineView(
149-
views,
150-
BuiltInMetricsConstant.SPANNER_METER_NAME,
151-
BuiltInMetricsConstant.GFE_LATENCIES_NAME,
152-
BuiltInMetricsConstant.GFE_LATENCIES_NAME,
153-
BuiltInMetricsConstant.AGGREGATION_WITH_MILLIS_HISTOGRAM,
154-
InstrumentType.HISTOGRAM,
155-
"ms");
156155
defineView(
157156
views,
158157
BuiltInMetricsConstant.GAX_METER_NAME,

google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsRecorder.java

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.opentelemetry.api.common.Attributes;
2424
import io.opentelemetry.api.common.AttributesBuilder;
2525
import io.opentelemetry.api.metrics.DoubleHistogram;
26+
import io.opentelemetry.api.metrics.LongCounter;
2627
import io.opentelemetry.api.metrics.Meter;
2728
import java.util.Map;
2829

@@ -35,6 +36,9 @@
3536
class BuiltInMetricsRecorder extends OpenTelemetryMetricsRecorder {
3637

3738
private final DoubleHistogram gfeLatencyRecorder;
39+
private final DoubleHistogram afeLatencyRecorder;
40+
private final LongCounter gfeHeaderMissingCountRecorder;
41+
private final LongCounter afeHeaderMissingCountRecorder;
3842

3943
/**
4044
* Creates the following instruments for the following metrics:
@@ -59,6 +63,27 @@ class BuiltInMetricsRecorder extends OpenTelemetryMetricsRecorder {
5963
.setDescription(
6064
"Latency between Google's network receiving an RPC and reading back the first byte of the response")
6165
.setUnit("ms")
66+
.setExplicitBucketBoundariesAdvice(BuiltInMetricsConstant.BUCKET_BOUNDARIES)
67+
.build();
68+
this.afeLatencyRecorder =
69+
meter
70+
.histogramBuilder(serviceName + '/' + BuiltInMetricsConstant.AFE_LATENCIES_NAME)
71+
.setDescription(
72+
"Latency between Spanner API Frontend receiving an RPC and starting to write back the response.")
73+
.setExplicitBucketBoundariesAdvice(BuiltInMetricsConstant.BUCKET_BOUNDARIES)
74+
.setUnit("ms")
75+
.build();
76+
this.gfeHeaderMissingCountRecorder =
77+
meter
78+
.counterBuilder(serviceName + '/' + BuiltInMetricsConstant.GFE_CONNECTIVITY_ERROR_NAME)
79+
.setDescription("Number of requests that failed to reach the Google network.")
80+
.setUnit("1")
81+
.build();
82+
this.afeHeaderMissingCountRecorder =
83+
meter
84+
.counterBuilder(serviceName + '/' + BuiltInMetricsConstant.AFE_CONNECTIVITY_ERROR_NAME)
85+
.setDescription("Number of requests that failed to reach the Spanner API Frontend.")
86+
.setUnit("1")
6287
.build();
6388
}
6489

@@ -69,8 +94,25 @@ class BuiltInMetricsRecorder extends OpenTelemetryMetricsRecorder {
6994
* @param gfeLatency Attempt Latency in ms
7095
* @param attributes Map of the attributes to store
7196
*/
72-
void recordGFELatency(double gfeLatency, Map<String, String> attributes) {
73-
gfeLatencyRecorder.record(gfeLatency, toOtelAttributes(attributes));
97+
void recordServerTimingHeaderMetrics(
98+
Long gfeLatency,
99+
Long afeLatency,
100+
Long gfeHeaderMissingCount,
101+
Long afeHeaderMissingCount,
102+
Map<String, String> attributes) {
103+
io.opentelemetry.api.common.Attributes otelAttributes = toOtelAttributes(attributes);
104+
if (gfeLatency != null) {
105+
gfeLatencyRecorder.record(gfeLatency, otelAttributes);
106+
}
107+
if (gfeHeaderMissingCount > 0) {
108+
gfeHeaderMissingCountRecorder.add(gfeHeaderMissingCount, otelAttributes);
109+
}
110+
if (afeLatency != null) {
111+
afeLatencyRecorder.record(afeLatency, otelAttributes);
112+
}
113+
if (afeHeaderMissingCount > 0) {
114+
afeHeaderMissingCountRecorder.add(afeHeaderMissingCount, otelAttributes);
115+
}
74116
}
75117

76118
Attributes toOtelAttributes(Map<String, String> attributes) {

0 commit comments

Comments
 (0)