Skip to content

Commit

Permalink
Merge branch 'main' into generate-libraries-main
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Nov 18, 2024
2 parents bf6408d + 2718cfa commit e27156f
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- uses: googleapis/sdk-platform-java/.github/scripts@v2.49.0
- uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
# repository
.kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.39.0
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
with:
bom-path: google-cloud-storage-bom/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.39.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"
}

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.39.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0"
}

env_vars: {
Expand Down
4 changes: 2 additions & 2 deletions gapic-google-cloud-storage-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>gapic-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
<name>gapic-google-cloud-storage-v2</name>
<description>GRPC library for gapic-google-cloud-storage-v2</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
18 changes: 9 additions & 9 deletions google-cloud-storage-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-bom</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.39.0</version>
<version>3.40.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -69,37 +69,37 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>gapic-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-control</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage-control:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-storage-control/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-control</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage-control:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
<name>google-cloud-storage-control</name>
<description>GRPC library for google-cloud-storage-control</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>

<dependencies>
Expand Down
12 changes: 6 additions & 6 deletions google-cloud-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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-storage</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<packaging>jar</packaging>
<name>Google Cloud Storage</name>
<url>https://github.com/googleapis/java-storage</url>
Expand All @@ -12,11 +12,11 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-storage</site.installationModule>
<pubsub-proto.version>1.116.0</pubsub-proto.version>
<pubsub-proto.version>1.116.1</pubsub-proto.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -224,14 +224,14 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-kms-v1</artifactId>
<version>0.146.0</version>
<version>0.147.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-kms</artifactId>
<version>2.55.0</version>
<version>2.56.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -316,7 +316,7 @@
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.177</version>
<version>4.8.179</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import io.grpc.opentelemetry.GrpcOpenTelemetry;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.api.internal.StringUtils;
import io.opentelemetry.contrib.gcp.resource.GCPResourceProvider;
import io.opentelemetry.sdk.OpenTelemetrySdk;
Expand Down Expand Up @@ -196,24 +197,36 @@ static SdkMeterProvider createMeterProvider(
shouldSuppressExceptions
? new PermissionDeniedSingleReportMetricsExporter(cloudMonitoringExporter)
: cloudMonitoringExporter;
AttributesBuilder attributesBuilder =
Attributes.builder()
.put("gcp.resource_type", "storage.googleapis.com/Client")
.put("project_id", projectIdToUse)
.put("instance_id", UUID.randomUUID().toString())
.put("api", "grpc");
String detectedLocation = detectedAttributes.get(AttributeKey.stringKey("cloud.region"));
if (detectedLocation != null) {
attributesBuilder.put("location", detectedLocation);
} else {
attributesBuilder.put("location", "global");
}
String detectedCloudPlatform = detectedAttributes.get(AttributeKey.stringKey("cloud.platform"));
if (detectedCloudPlatform != null) {
attributesBuilder.put("cloud_platform", detectedCloudPlatform);
} else {
attributesBuilder.put("cloud_platform", "unknown");
}
String detectedHostId = detectedAttributes.get(AttributeKey.stringKey("host.id"));
if (detectedHostId != null) {
attributesBuilder.put("host_id", detectedHostId);
} else {
attributesBuilder.put("host_id", "unknown");
}
providerBuilder
.registerMetricReader(
PeriodicMetricReader.builder(exporter)
.setInterval(java.time.Duration.ofSeconds(60))
.build())
.setResource(
Resource.create(
Attributes.builder()
.put("gcp.resource_type", "storage.googleapis.com/Client")
.put("location", detectedAttributes.get(AttributeKey.stringKey("cloud.region")))
.put("project_id", projectIdToUse)
.put(
"cloud_platform",
detectedAttributes.get(AttributeKey.stringKey("cloud.platform")))
.put("host_id", detectedAttributes.get(AttributeKey.stringKey("host.id")))
.put("instance_id", UUID.randomUUID().toString())
.put("api", "grpc")
.build()));
.setResource(Resource.create(attributesBuilder.build()));

addHistogramView(
providerBuilder, latencyHistogramBoundaries(), "grpc/client/attempt/duration", "s");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ public void testGrpcMetrics() {

// What the project ID will be will depend on the environment, so we just make sure it's present
// and not null/empty
assertThat(result.contains("project_id"));
assertThat(result).doesNotContain("project_id=\"\"");
assertThat(result).doesNotContain("project_id=null");
assertThat(result).contains("project_id");
assertThat(result).contains("host_id");
assertThat(result).contains("cloud_platform");
assertThat(result).contains("location");
assertThat(result).contains("instance_id");
assertThat(result).contains("gcp.resource_type");
assertThat(result).contains("api");

// This is the check for the Seconds histogram boundary. We can't practically check for every
// boundary,
Expand Down
4 changes: 2 additions & 2 deletions grpc-google-cloud-storage-control-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
<name>grpc-google-cloud-storage-control-v2</name>
<description>GRPC library for google-cloud-storage</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions grpc-google-cloud-storage-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
<name>grpc-google-cloud-storage-v2</name>
<description>GRPC library for grpc-google-cloud-storage-v2</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<packaging>pom</packaging>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<name>Storage Parent</name>
<url>https://github.com/googleapis/java-storage</url>
<description>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.39.0</version>
<version>3.40.0</version>
</parent>

<developers>
Expand Down Expand Up @@ -134,7 +134,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
Expand All @@ -144,7 +144,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.134.0</version>
<version>1.134.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -156,32 +156,32 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>gapic-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-control</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage-control:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
Expand Down
4 changes: 2 additions & 2 deletions proto-google-cloud-storage-control-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-control-v2</artifactId>
<version>2.44.1</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
<name>proto-google-cloud-storage-control-v2</name>
<description>Proto library for proto-google-cloud-storage-control-v2</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions proto-google-cloud-storage-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-storage-v2</artifactId>
<version>2.44.1-beta</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
<version>2.44.2-beta-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
<name>proto-google-cloud-storage-v2</name>
<description>PROTO library for proto-google-cloud-storage-v2</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.44.1</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.44.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.134.0</version>
<version>1.134.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit e27156f

Please sign in to comment.