From 4b39dcac5ce54b57e9fb8e56e400ac5b243b0dc0 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 10 Jan 2024 16:54:44 +0800 Subject: [PATCH 1/4] Updates to Zipkin 3, Spring Boot 3 and JRE 17 This updates server modules to Zipkin 3, Spring Boot 3 and JRE 17. It leaves the client side modules at Java 8. In order to compile the server module, we can no longer compile with JDK 11. See https://github.com/openzipkin/zipkin/pull/3684 Signed-off-by: Adrian Cole --- .github/workflows/create_release.yml | 6 +-- .github/workflows/deploy.yml | 6 +-- .github/workflows/test.yml | 10 ++-- README.md | 4 +- benchmarks/pom.xml | 4 ++ collector-pubsub/pom.xml | 5 ++ module/README.md | 18 +++---- module/pom.xml | 12 ++++- .../ITZipkinStackdriverStorage.java | 6 +-- .../stackdriver/StackdriverMockServer.java | 4 +- pom.xml | 52 ++++++++++++++----- .../stackdriver/ITStackdriverSender.java | 8 +-- storage-stackdriver/pom.xml | 5 ++ 13 files changed, 96 insertions(+), 44 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 3bb12b1..6048b91 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -24,13 +24,13 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'zulu' # zulu as it supports a wide version range - java-version: '11' # earliest LTS and last that can compile the 1.6 release profile. + java-version: '17' # earliest LTS and last that can compile the 1.6 release profile. - name: Cache local Maven repository uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-maven- + key: ${{ runner.os }}-jdk-11-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-jdk-11-maven- - name: Create Release env: # GH_USER= diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d7ba5f..c556768 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,13 +27,13 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'zulu' # zulu as it supports a wide version range - java-version: '11' # earliest LTS and last that can compile the 1.6 release profile. + java-version: '17' # earliest LTS supported by Spring Boot 3 - name: Cache local Maven repository uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-maven- + key: ${{ runner.os }}-jdk-17-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-jdk-17-maven- # Don't attempt to cache Docker. Sensitive information can be stolen # via forks, and login session ends up in ~/.docker. This is ok because # we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 472dad6..f34aa28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,13 +28,13 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'zulu' # zulu as it supports a wide version range - java-version: '11' # earliest LTS and last that can compile the 1.6 release profile. + java-version: '17' # earliest LTS supported by Spring Boot 3 - name: Cache local Maven repository uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-jdk-11-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-jdk-11-maven- + key: ${{ runner.os }}-jdk-17-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-jdk-17-maven- - name: Build JavaDoc run: ./mvnw clean javadoc:aggregate -Prelease @@ -46,7 +46,7 @@ jobs: fail-fast: false # don't fail fast as sometimes failures are operating system specific matrix: # use latest available versions and be consistent on all workflows! include: - - java_version: 11 # Last that can compile zipkin core to 1.6 for zipkin-reporter + - java_version: 17 # earliest LTS supported by Spring Boot 3 maven_args: -Prelease -Dgpg.skip -Dmaven.javadoc.skip=true - java_version: 21 # Most recent LTS steps: @@ -69,4 +69,4 @@ jobs: # via forks, and login session ends up in ~/.docker. This is ok because # we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner. - name: Test - run: build-bin/configure_test && build-bin/test + run: build-bin/configure_test && build-bin/test ${{ matrix.maven_args }} diff --git a/README.md b/README.md index c4111b5..f97a524 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/io.zipkin.gcp/zipkin-module-gcp.svg)](https://search.maven.org/search?q=g:io.zipkin.gcp%20AND%20a:zipkin-module-gcp) # zipkin-gcp -Shared libraries that provide Zipkin integration with the Google Cloud Platform. Requires JRE 11 or later. +Shared libraries that provide Zipkin integration with the Google Cloud Platform. Requires JRE 17 or later. # Usage These components integrate traced applications and servers through Google Cloud services @@ -71,7 +71,7 @@ $ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \ -Dloader.path='gcp.jar,gcp.jar!/lib' \ -Dspring.profiles.active=gcp \ -cp zipkin.jar \ - org.springframework.boot.loader.PropertiesLauncher + org.springframework.boot.loader.launch.PropertiesLauncher ``` ## Example integrating Stackdriver Storage diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index bdccec6..6e87228 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -30,6 +30,10 @@ ${project.basedir}/.. 1.27 + + 17 + 17 + 17 diff --git a/collector-pubsub/pom.xml b/collector-pubsub/pom.xml index 96d4f24..a943518 100644 --- a/collector-pubsub/pom.xml +++ b/collector-pubsub/pom.xml @@ -26,6 +26,11 @@ ${project.basedir}/.. + + + 17 + 17 + 17 diff --git a/module/README.md b/module/README.md index bdefa02..ae6a98a 100644 --- a/module/README.md +++ b/module/README.md @@ -16,7 +16,7 @@ and exposes configuration options through environment variables. ## Quick start -JRE 11+ is required to run Zipkin server. +JRE 17+ is required to run Zipkin server. Fetch the latest released [executable jar for Zipkin server](https://search.maven.org/remote_content?g=io.zipkin&a=zipkin-server&v=LATEST&c=exec) @@ -34,7 +34,7 @@ $ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \ -Dloader.path='gcp.jar,gcp.jar!/lib' \ -Dspring.profiles.active=gcp \ -cp zipkin.jar \ - org.springframework.boot.loader.PropertiesLauncher + org.springframework.boot.loader.launch.PropertiesLauncher ``` After executing these steps, applications can send spans @@ -52,12 +52,12 @@ for users that prefer a file based approach. #### Environment Variables -|Environment Variable | Value | -|-------------------------------|------------------| -|GOOGLE_APPLICATION_CREDENTIALS | Optional. [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). Not managed by spring boot. | -|STACKDRIVER_PROJECT_ID | GCP projectId. Optional on GCE. Required on all other platforms. If not provided on GCE, it will default to the projectId associated with the GCE resource. | -|STACKDRIVER_API_HOST | host:port combination of the gRPC endpoint. Default: cloudtrace.googleapis.com:443 | -|STACKDRIVER_HTTP_LOGGING | When set, controls the volume of HTTP logging of the Stackdriver Trace Api. Options are BASIC and HEADERS | +| Environment Variable | Value | +|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| GOOGLE_APPLICATION_CREDENTIALS | Optional. [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). Not managed by spring boot. | +| STACKDRIVER_PROJECT_ID | GCP projectId. Optional on GCE. Required on all other platforms. If not provided on GCE, it will default to the projectId associated with the GCE resource. | +| STACKDRIVER_API_HOST | host:port combination of the gRPC endpoint. Default: cloudtrace.googleapis.com:443 | +| STACKDRIVER_HTTP_LOGGING | When set, controls the volume of HTTP logging of the Stackdriver Trace Api. Options are BASIC and HEADERS | ### Running @@ -67,7 +67,7 @@ $ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo STACKDRIVER_HTTP_L -Dloader.path='gcp.jar,gcp.jar!/lib' \ -Dspring.profiles.active=gcp \ -cp zipkin.jar \ - org.springframework.boot.loader.PropertiesLauncher + org.springframework.boot.loader.launch.PropertiesLauncher ``` ### Testing diff --git a/module/pom.xml b/module/pom.xml index 51232aa..2bf5eda 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -27,6 +27,11 @@ ${project.basedir}/.. + + + 17 + 17 + 17 @@ -69,6 +74,11 @@ grpc-context ${grpc.version} + + org.apache.logging.log4j + log4j-core + ${log4j.version} + ${zipkin.groupId} @@ -159,7 +169,7 @@ module - ${zipkin.groupId},org.springframework.boot,org.springframework,com.fasterxml.jackson.core,com.google.auto.value,org.reactivestreams,com.google.code.findbugs,javax.annotation,org.slf4j,io.netty,io.micrometer,org.hdrhistogram,org.latencyutils,${armeria.groupId},javax.inject,com.fasterxml.jackson.datatype + ${zipkin.groupId},org.springframework.boot,org.springframework,com.fasterxml.jackson.core,com.google.auto.value,org.reactivestreams,com.google.code.findbugs,javax.annotation,org.slf4j,io.netty,io.micrometer,org.hdrhistogram,org.latencyutils,${armeria.groupId},javax.inject,com.fasterxml.jackson.datatype,com.aayushatharva.brotli4j,commons-logging diff --git a/module/src/test/java/zipkin2/storage/stackdriver/ITZipkinStackdriverStorage.java b/module/src/test/java/zipkin2/storage/stackdriver/ITZipkinStackdriverStorage.java index 59b34bc..789200e 100644 --- a/module/src/test/java/zipkin2/storage/stackdriver/ITZipkinStackdriverStorage.java +++ b/module/src/test/java/zipkin2/storage/stackdriver/ITZipkinStackdriverStorage.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenZipkin Authors + * Copyright 2016-2024 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -121,8 +121,8 @@ public void close() { .atMost(10, TimeUnit.SECONDS) .pollInterval(1, TimeUnit.SECONDS) .ignoreExceptionsMatching(e -> - e instanceof StatusRuntimeException && - ((StatusRuntimeException) e).getStatus().getCode() == Status.Code.NOT_FOUND + e instanceof StatusRuntimeException sre && + sre.getStatus().getCode() == Status.Code.NOT_FOUND ) .until(() -> traceServiceGrpcV1.getTrace(GetTraceRequest.newBuilder() .setProjectId(projectId) diff --git a/module/src/test/java/zipkin2/storage/stackdriver/StackdriverMockServer.java b/module/src/test/java/zipkin2/storage/stackdriver/StackdriverMockServer.java index 5af8cd1..545e369 100644 --- a/module/src/test/java/zipkin2/storage/stackdriver/StackdriverMockServer.java +++ b/module/src/test/java/zipkin2/storage/stackdriver/StackdriverMockServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenZipkin Authors + * Copyright 2016-2024 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -66,7 +66,7 @@ public void setSpanCountdown(CountDownLatch spanCountdown) { } public String grpcURI() { - return String.format("%s:%s", "localhost", getPort()); + return "%s:%s".formatted("localhost", getPort()); } public Set spanIds() { diff --git a/pom.xml b/pom.xml index 66d9706..6bf981c 100644 --- a/pom.xml +++ b/pom.xml @@ -66,20 +66,21 @@ 8 - 11 - 11 - 11 + 17 + 17 + 17 io.zipkin.zipkin2 - 2.27.1 - 3.1.0 - 2.7.18 + 3.0.0-SNAPSHOT + 3.1.1 + 3.2.1 com.linecorp.armeria 1.26.4 + 2.21.1 @@ -175,6 +176,21 @@ + + + + sonatype.snapshots + Sonatype Snapshot Repository + https://oss.sonatype.org/content/repositories/snapshots/ + + false + + + true + + + + @@ -205,9 +221,21 @@ - ch.qos.logback - logback-classic - 1.2.13 + org.apache.logging.log4j + log4j-core + ${log4j.version} + test + + + org.apache.logging.log4j + log4j-jul + ${log4j.version} + test + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} test @@ -377,7 +405,7 @@ - [11,12),[17,18),[21,22) + [17,18),[21,22) @@ -490,10 +518,10 @@ - error-prone-11+ + error-prone-17+ - [11,12),[17,18),[21,22) + [17,18),[21,22) diff --git a/sender-stackdriver/src/test/java/zipkin2/reporter/stackdriver/ITStackdriverSender.java b/sender-stackdriver/src/test/java/zipkin2/reporter/stackdriver/ITStackdriverSender.java index b7bba6d..287c8f7 100644 --- a/sender-stackdriver/src/test/java/zipkin2/reporter/stackdriver/ITStackdriverSender.java +++ b/sender-stackdriver/src/test/java/zipkin2/reporter/stackdriver/ITStackdriverSender.java @@ -129,8 +129,8 @@ public void tearDown() { .atMost(10, TimeUnit.SECONDS) .pollInterval(1, TimeUnit.SECONDS) .ignoreExceptionsMatching(e -> - e instanceof StatusRuntimeException && - ((StatusRuntimeException) e).getStatus().getCode() == Status.Code.NOT_FOUND + e instanceof StatusRuntimeException sre && + sre.getStatus().getCode() == Status.Code.NOT_FOUND ) .until(() -> traceServiceGrpcV1.getTrace(GetTraceRequest.newBuilder() .setProjectId(projectId) @@ -165,8 +165,8 @@ public void tearDown() { .atMost(10, TimeUnit.SECONDS) .pollInterval(1, TimeUnit.SECONDS) .ignoreExceptionsMatching(e -> - e instanceof StatusRuntimeException && - ((StatusRuntimeException) e).getStatus().getCode() == Status.Code.NOT_FOUND + e instanceof StatusRuntimeException sre && + sre.getStatus().getCode() == Status.Code.NOT_FOUND ) .until(() -> traceServiceGrpcV1.getTrace(GetTraceRequest.newBuilder() .setProjectId(projectId) diff --git a/storage-stackdriver/pom.xml b/storage-stackdriver/pom.xml index d364167..2ee96b1 100644 --- a/storage-stackdriver/pom.xml +++ b/storage-stackdriver/pom.xml @@ -27,6 +27,11 @@ ${project.basedir}/.. + + + 17 + 17 + 17 From 2eed19f5b4874772978ed461b8a1e9c6c3df06cd Mon Sep 17 00:00:00 2001 From: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com> Date: Thu, 11 Jan 2024 06:33:58 +0800 Subject: [PATCH 2/4] Update .github/workflows/create_release.yml Co-authored-by: Andriy Redko --- .github/workflows/create_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 6048b91..34ec719 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-jdk-11-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ runner.os }}-jdk-17-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-jdk-11-maven- - name: Create Release env: From 4b2c289d6f0c206eebc14ba80f0f6457d2402c78 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 11 Jan 2024 07:29:03 +0800 Subject: [PATCH 3/4] final Signed-off-by: Adrian Cole --- docker/Dockerfile | 2 +- pom.xml | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index eca5fad..106fba5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,7 +13,7 @@ # # zipkin version should match zipkin.version in /pom.xml -ARG zipkin_version=2.27.0 +ARG zipkin_version=3.0.0 # java_version is used during the installation process to build or download the module jar. # diff --git a/pom.xml b/pom.xml index 6bf981c..093f1ba 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ io.zipkin.zipkin2 - 3.0.0-SNAPSHOT + 3.0.0 3.1.1 3.2.1 @@ -176,21 +176,6 @@ - - - - sonatype.snapshots - Sonatype Snapshot Repository - https://oss.sonatype.org/content/repositories/snapshots/ - - false - - - true - - - - From e2ba7efe8d42b0e0736b2c5a01a97567a2a0ae59 Mon Sep 17 00:00:00 2001 From: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com> Date: Thu, 11 Jan 2024 07:38:16 +0800 Subject: [PATCH 4/4] Update .github/workflows/create_release.yml Co-authored-by: Andriy Redko --- .github/workflows/create_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 34ec719..8c14fab 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -30,7 +30,7 @@ jobs: with: path: ~/.m2/repository key: ${{ runner.os }}-jdk-17-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-jdk-11-maven- + restore-keys: ${{ runner.os }}-jdk-17-maven- - name: Create Release env: # GH_USER=