Skip to content

Commit

Permalink
Merge branch 'main' into quickperf
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite authored Oct 11, 2024
2 parents e22857c + f8dbc91 commit cfa8c15
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
shell: bash
run: .kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.35.0
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.1
with:
bom-path: pom.xml
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.35.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.35.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1"
}

env_vars: {
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [2.22.1](https://github.com/googleapis/java-spanner-jdbc/compare/v2.22.0...v2.22.1) (2024-10-03)


### Bug Fixes

* Remove connection-id from metrics ([#1763](https://github.com/googleapis/java-spanner-jdbc/issues/1763)) ([0e54363](https://github.com/googleapis/java-spanner-jdbc/commit/0e543635d2deb1ddb133e57604adc9f88bae4dbf))


### Dependencies

* Update dependency com.fasterxml.jackson.core:jackson-databind to v2.18.0 ([#1762](https://github.com/googleapis/java-spanner-jdbc/issues/1762)) ([c1fa2c3](https://github.com/googleapis/java-spanner-jdbc/commit/c1fa2c34fbc6b12ca8d602a48bb02eea4fa62b2a))
* Update dependency com.google.api.grpc:proto-google-cloud-trace-v1 to v2.51.0 ([#1765](https://github.com/googleapis/java-spanner-jdbc/issues/1765)) ([30f22dd](https://github.com/googleapis/java-spanner-jdbc/commit/30f22ddb75c531098a04171048e38647a1a49aec))
* Update dependency com.google.cloud:google-cloud-spanner-bom to v6.75.0 ([#1757](https://github.com/googleapis/java-spanner-jdbc/issues/1757)) ([02dac46](https://github.com/googleapis/java-spanner-jdbc/commit/02dac46299b566c30d8399585c2d22b0ac2a4d59))
* Update dependency com.google.cloud:google-cloud-spanner-bom to v6.76.0 ([#1764](https://github.com/googleapis/java-spanner-jdbc/issues/1764)) ([3fc8344](https://github.com/googleapis/java-spanner-jdbc/commit/3fc83449f93f7a0a4604751fe9d6326242b107d9))
* Update dependency com.google.cloud:google-cloud-spanner-bom to v6.77.0 ([#1771](https://github.com/googleapis/java-spanner-jdbc/issues/1771)) ([4050b9c](https://github.com/googleapis/java-spanner-jdbc/commit/4050b9c2dedd2a40dac628ad82a414d9e68ae1ba))
* Update dependency com.google.cloud:google-cloud-trace to v2.51.0 ([#1766](https://github.com/googleapis/java-spanner-jdbc/issues/1766)) ([9b04219](https://github.com/googleapis/java-spanner-jdbc/commit/9b042197c20be094930c087f7ff674f28a8d5980))
* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.0 ([#1759](https://github.com/googleapis/java-spanner-jdbc/issues/1759)) ([7276ea5](https://github.com/googleapis/java-spanner-jdbc/commit/7276ea5e8358170304ad55d28cee5cd5167fb56d))
* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.1 ([#1761](https://github.com/googleapis/java-spanner-jdbc/issues/1761)) ([add2a22](https://github.com/googleapis/java-spanner-jdbc/commit/add2a2239705e6447b729008aca09fb71e2609f6))
* Update dependency com.google.cloud.opentelemetry:exporter-trace to v0.32.0 ([#1760](https://github.com/googleapis/java-spanner-jdbc/issues/1760)) ([7768a6b](https://github.com/googleapis/java-spanner-jdbc/commit/7768a6b2c0c744ae6a36d222e798dfc8faaf634d))
* Update dependency net.datafaker:datafaker to v2.4.0 ([#1767](https://github.com/googleapis/java-spanner-jdbc/issues/1767)) ([7b2d639](https://github.com/googleapis/java-spanner-jdbc/commit/7b2d639b8e0834b7bec359d8f0fe234b228323dd))
* Update dependency org.springframework.boot:spring-boot to v3.3.4 ([#1754](https://github.com/googleapis/java-spanner-jdbc/issues/1754)) ([a3f10d7](https://github.com/googleapis/java-spanner-jdbc/commit/a3f10d7faa313d9ec924fe03575c7a114d2d9d35))
* Update dependency org.springframework.boot:spring-boot-starter-data-jdbc to v3.3.4 ([#1755](https://github.com/googleapis/java-spanner-jdbc/issues/1755)) ([ccf5c3c](https://github.com/googleapis/java-spanner-jdbc/commit/ccf5c3c3b31358029392a11d9f58dffec62212fd))
* Update dependency org.springframework.boot:spring-boot-starter-parent to v3.3.4 ([#1756](https://github.com/googleapis/java-spanner-jdbc/issues/1756)) ([6515992](https://github.com/googleapis/java-spanner-jdbc/commit/65159923685836bfd0416b16eae01a0b9bbd0b55))
* Update dependency org.testcontainers:testcontainers to v1.20.2 ([#1768](https://github.com/googleapis/java-spanner-jdbc/issues/1768)) ([bb65d4f](https://github.com/googleapis/java-spanner-jdbc/commit/bb65d4f7b57918edb28013c41a35efbdb8513b56))
* Update dependency org.testcontainers:testcontainers-bom to v1.20.2 ([#1769](https://github.com/googleapis/java-spanner-jdbc/issues/1769)) ([7d32ed7](https://github.com/googleapis/java-spanner-jdbc/commit/7d32ed7dadb01c53f2962b90ffa62b904c78db7c))

## [2.22.0](https://github.com/googleapis/java-spanner-jdbc/compare/v2.21.0...v2.22.0) (2024-09-16)


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-jdbc</artifactId>
<version>2.22.0</version>
<version>2.22.1</version>
</dependency>
```
<!--- {x-version-update-end} -->
Expand All @@ -30,15 +30,15 @@ If you are using Gradle without BOM, add this to your dependencies

<!--- {x-version-update-start:google-cloud-spanner-jdbc:released} -->
```Groovy
implementation 'com.google.cloud:google-cloud-spanner-jdbc:2.22.0'
implementation 'com.google.cloud:google-cloud-spanner-jdbc:2.22.1'
```
<!--- {x-version-update-end} -->

If you are using SBT, add this to your dependencies

<!--- {x-version-update-start:google-cloud-spanner-jdbc:released} -->
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-spanner-jdbc" % "2.22.0"
libraryDependencies += "com.google.cloud" % "google-cloud-spanner-jdbc" % "2.22.1"
```
<!--- {x-version-update-end} -->

Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-spanner-jdbc</artifactId>
<version>2.22.0</version><!-- {x-version-update:google-cloud-spanner-jdbc:current} -->
<version>2.22.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner-jdbc:current} -->
<packaging>jar</packaging>
<name>Google Cloud Spanner JDBC</name>
<url>https://github.com/googleapis/java-spanner-jdbc</url>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.35.0</version>
<version>3.36.1</version>
</parent>
<developers>
<developer>
Expand Down Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>6.74.1</version>
<version>6.77.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -166,7 +166,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.1</version>
<version>1.20.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -226,19 +226,19 @@
<dependency>
<groupId>com.google.cloud.opentelemetry</groupId>
<artifactId>exporter-trace</artifactId>
<version>0.31.0</version>
<version>0.32.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-trace</artifactId>
<version>2.49.0</version>
<version>2.51.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-trace-v1</artifactId>
<version>2.49.0</version>
<version>2.51.0</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.2.0</version>
<version>1.2.2</version>
</parent>

<properties>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-jdbc</artifactId>
<version>2.21.0</version>
<version>2.22.1</version>
</dependency>
<!-- [END spanner-jdbc_install_without_bom] -->

Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.2.0</version>
<version>1.2.2</version>
<relativePath />
</parent>

Expand Down
10 changes: 5 additions & 5 deletions samples/quickperf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.35.0</version>
<version>3.36.1</version>
<relativePath/>
</parent>

Expand All @@ -27,7 +27,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.45.0</version>
<version>26.48.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -67,19 +67,19 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.2</version>
<version>2.18.0</version>
</dependency>
<!-- Required for unit tests -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.1</version>
<version>1.20.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>3.3.3</version>
<version>3.3.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions samples/snapshot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.2.0</version>
<version>1.2.2</version>
</parent>

<properties>
Expand All @@ -28,7 +28,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-jdbc</artifactId>
<version>2.22.0</version>
<version>2.22.2-SNAPSHOT</version>
</dependency>
<!-- {x-version-update-end} -->

Expand Down
6 changes: 3 additions & 3 deletions samples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.35.0</version>
<version>3.36.1</version>
<relativePath/>
</parent>

Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.45.0</version>
<version>26.48.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.1</version>
<version>1.20.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions samples/spring-data-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>6.74.1</version>
<version>6.77.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.45.0</version>
<version>26.48.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -55,7 +55,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
<version>3.3.3</version>
<version>3.3.4</version>
</dependency>

<!-- Add both the Cloud Spanner and the PostgreSQL JDBC driver. -->
Expand Down Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>com.google.cloud.opentelemetry</groupId>
<artifactId>exporter-trace</artifactId>
<version>0.31.0</version>
<version>0.32.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -114,7 +114,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.1</version>
<version>1.20.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions samples/spring-data-mybatis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.3</version>
<version>3.3.4</version>
<relativePath/>
</parent>
<properties>
Expand All @@ -35,14 +35,14 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.45.0</version>
<version>26.48.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.20.1</version>
<version>1.20.2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ class JdbcConnection extends AbstractJdbcConnection {

private final Metrics metrics;

private final Attributes openTelemetryAttributes;
private final Attributes openTelemetryMetricsAttributes;

JdbcConnection(String connectionUrl, ConnectionOptions options) throws SQLException {
super(connectionUrl, options);
this.useLegacyIsValidCheck = useLegacyValidCheck();
OpenTelemetry openTelemetry = getSpanner().getOptions().getOpenTelemetry();
this.openTelemetryAttributes =
createOpenTelemetryAttributes(getConnectionOptions().getDatabaseId());
this.openTelemetryMetricsAttributes =
createOpenTelemetryAttributes(getConnectionOptions().getDatabaseId(), false);
this.metrics = new Metrics(openTelemetry);
}

Expand All @@ -114,17 +114,21 @@ static boolean useLegacyValidCheck() {
}

@VisibleForTesting
static Attributes createOpenTelemetryAttributes(DatabaseId databaseId) {
static Attributes createOpenTelemetryAttributes(
DatabaseId databaseId, boolean includeConnectionId) {
AttributesBuilder attributesBuilder = Attributes.builder();
attributesBuilder.put("connection_id", UUID.randomUUID().toString());
// A unique connection ID should only be included for tracing and not for metrics.
if (includeConnectionId) {
attributesBuilder.put("connection_id", UUID.randomUUID().toString());
}
attributesBuilder.put("database", databaseId.getDatabase());
attributesBuilder.put("instance_id", databaseId.getInstanceId().getInstance());
attributesBuilder.put("project_id", databaseId.getInstanceId().getProject());
return attributesBuilder.build();
}

public void recordClientLibLatencyMetric(long value) {
metrics.recordClientLibLatency(value, openTelemetryAttributes);
metrics.recordClientLibLatency(value, openTelemetryMetricsAttributes);
}

@Override
Expand Down
Loading

0 comments on commit cfa8c15

Please sign in to comment.