From 0b05c5d75a3456072a052ec43e7354512b2cc04f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:33:36 -0400 Subject: [PATCH] [PF-2983]: Bump the minor-patch-dependencies group across 1 directory with 9 updates (#198) * [PF-2983]: Bump the minor-patch-dependencies group across 1 directory with 9 updates Bumps the minor-patch-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [com.google.cloud:libraries-bom](https://github.com/googleapis/java-cloud-bom) | `26.44.0` | `26.45.0` | | bio.terra:stairway-gcp | `1.1.10-SNAPSHOT` | `1.1.12-SNAPSHOT` | | bio.terra:stairway-azure | `1.1.10-SNAPSHOT` | `1.1.12-SNAPSHOT` | | [io.opentelemetry:opentelemetry-bom-alpha](https://github.com/open-telemetry/opentelemetry-java) | `1.37.0-alpha` | `1.41.0-alpha` | | [io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom](https://github.com/open-telemetry/opentelemetry-java-instrumentation) | `2.3.0` | `2.7.0` | | com.jfrog.artifactory | `5.2.3` | `5.2.5` | | [io.spring.dependency-management](https://github.com/spring-gradle-plugins/dependency-management-plugin) | `1.1.5` | `1.1.6` | | [org.springframework.boot](https://github.com/spring-projects/spring-boot) | `3.3.1` | `3.3.3` | Updates `com.google.cloud:libraries-bom` from 26.44.0 to 26.45.0 - [Release notes](https://github.com/googleapis/java-cloud-bom/releases) - [Changelog](https://github.com/googleapis/java-cloud-bom/blob/main/release-please-config.json) - [Commits](https://github.com/googleapis/java-cloud-bom/compare/v26.44.0...v26.45.0) Updates `bio.terra:stairway-gcp` from 1.1.10-SNAPSHOT to 1.1.12-SNAPSHOT Updates `bio.terra:stairway-azure` from 1.1.10-SNAPSHOT to 1.1.12-SNAPSHOT Updates `bio.terra:stairway-azure` from 1.1.10-SNAPSHOT to 1.1.12-SNAPSHOT Updates `io.opentelemetry:opentelemetry-bom-alpha` from 1.37.0-alpha to 1.41.0-alpha - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/commits) Updates `io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom` from 2.3.0 to 2.7.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java-instrumentation/compare/v2.3.0...v2.7.0) Updates `io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha` from 2.3.0-alpha to 2.7.0-alpha - [Release notes](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java-instrumentation/commits) Updates `com.jfrog.artifactory` from 5.2.3 to 5.2.5 Updates `io.spring.dependency-management` from 1.1.5 to 1.1.6 - [Release notes](https://github.com/spring-gradle-plugins/dependency-management-plugin/releases) - [Commits](https://github.com/spring-gradle-plugins/dependency-management-plugin/compare/v1.1.5...v1.1.6) Updates `org.springframework.boot` from 3.3.1 to 3.3.3 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.1...v3.3.3) --- updated-dependencies: - dependency-name: com.google.cloud:libraries-bom dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-patch-dependencies - dependency-name: bio.terra:stairway-gcp dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies - dependency-name: bio.terra:stairway-azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies - dependency-name: bio.terra:stairway-azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies - dependency-name: io.opentelemetry:opentelemetry-bom-alpha dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-patch-dependencies - dependency-name: io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-patch-dependencies - dependency-name: io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-patch-dependencies - dependency-name: com.jfrog.artifactory dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies - dependency-name: io.spring.dependency-management dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch-dependencies ... Signed-off-by: dependabot[bot] * Update build.gradle update ext version to match current otel version * Remove deprecated otel annotation; fix other otel deprecation warnings * fix spring boot dependency --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Phil Shapiro --- build.gradle | 20 ++++++------- .../opentelemetry/HttpMetricsAdvice.java | 29 ++++++++++--------- .../opentelemetry/OpenTelemetryConfig.java | 2 -- .../common/tracing/ExcludingUrlSampler.java | 6 ++-- .../logging/HumanReadableLoggingTest.java | 8 ++--- .../tracing/ExcludingUrlSamplerTest.java | 18 ++++++------ 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/build.gradle b/build.gradle index aeb78b3a..d831df12 100644 --- a/build.gradle +++ b/build.gradle @@ -6,10 +6,10 @@ plugins { id 'com.diffplug.spotless' version '6.25.0' id 'com.github.ben-manes.versions' version '0.51.0' - id 'com.jfrog.artifactory' version '5.2.3' + id 'com.jfrog.artifactory' version '5.2.5' id 'org.sonarqube' version '5.1.0.4882' - id 'io.spring.dependency-management' version '1.1.5' - id 'org.springframework.boot' version '3.3.1' + id 'io.spring.dependency-management' version '1.1.6' + id 'org.springframework.boot' version '3.3.3' id 'ru.vyarus.quality' version '5.0.0' id 'com.srcclr.gradle' version '3.1.12' } @@ -22,7 +22,7 @@ project.ext { // Spring Boot 3.2.3 pulls in opentelemetry-bom 1.31.0. // We need >= 1.32.0 so that our HttpServerMetrics can use Meter.setExplicitBucketBoundariesAdvice: -ext['opentelemetry.version'] = '1.37.0' +ext['opentelemetry.version'] = '1.41.0' // If true, search local repository (~/.m2/repository/) first for dependencies. def useMavenLocal = false @@ -67,7 +67,7 @@ dependencies { // Google dependencies // use common bom - implementation platform('com.google.cloud:libraries-bom:26.44.0') + implementation platform('com.google.cloud:libraries-bom:26.45.0') implementation group: 'com.google.cloud', name: 'google-cloud-core' implementation group: 'com.google.cloud', name: 'google-cloud-pubsub' api group: 'com.google.guava', name: 'guava' @@ -78,7 +78,7 @@ dependencies { // Terra libraries implementation group: 'org.broadinstitute.dsde.workbench', name: 'sam-client_2.13', version: '0.1-0c4b377' - var stairwayVersion= '1.1.10-SNAPSHOT' + var stairwayVersion= '1.1.12-SNAPSHOT' api "bio.terra:stairway-gcp:${stairwayVersion}" implementation "bio.terra:stairway-azure:${stairwayVersion}" @@ -88,9 +88,9 @@ dependencies { implementation group: 'ch.qos.logback.contrib', name: 'logback-jackson', version: '0.1.5' // OpenTelemetry BOMs (opentelemetry-bom versioned by Spring dependency manager) - implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.37.0-alpha') - implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.3.0') - implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.3.0-alpha') + implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.41.0-alpha') + implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.7.0') + implementation platform('io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.7.0-alpha') // OpenTelemetry dependencies versioned by BOMs api 'io.opentelemetry:opentelemetry-api' implementation 'io.opentelemetry:opentelemetry-sdk' @@ -99,7 +99,7 @@ dependencies { implementation 'io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0' implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-api' implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations' - implementation 'io.opentelemetry.instrumentation:opentelemetry-spring-boot' + implementation 'io.opentelemetry.instrumentation:opentelemetry-spring-boot-autoconfigure' implementation 'io.opentelemetry:opentelemetry-exporter-prometheus' implementation 'io.opentelemetry:opentelemetry-api-incubator' implementation 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure' diff --git a/src/main/java/bio/terra/common/opentelemetry/HttpMetricsAdvice.java b/src/main/java/bio/terra/common/opentelemetry/HttpMetricsAdvice.java index 58b5a0f7..d76366bf 100644 --- a/src/main/java/bio/terra/common/opentelemetry/HttpMetricsAdvice.java +++ b/src/main/java/bio/terra/common/opentelemetry/HttpMetricsAdvice.java @@ -10,7 +10,10 @@ import io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder; import io.opentelemetry.api.metrics.DoubleHistogramBuilder; -import io.opentelemetry.semconv.SemanticAttributes; +import io.opentelemetry.semconv.HttpAttributes; +import io.opentelemetry.semconv.NetworkAttributes; +import io.opentelemetry.semconv.ServerAttributes; +import io.opentelemetry.semconv.UrlAttributes; import java.util.List; import java.util.stream.DoubleStream; @@ -52,13 +55,13 @@ static void applyClientDurationAdvice(DoubleHistogramBuilder builder) { ((ExtendedDoubleHistogramBuilder) builder) .setAttributesAdvice( asList( - SemanticAttributes.HTTP_REQUEST_METHOD, - SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, + HttpAttributes.HTTP_REQUEST_METHOD, + HttpAttributes.HTTP_RESPONSE_STATUS_CODE, ERROR_TYPE, - SemanticAttributes.NETWORK_PROTOCOL_NAME, - SemanticAttributes.NETWORK_PROTOCOL_VERSION, - SemanticAttributes.SERVER_ADDRESS, - SemanticAttributes.SERVER_PORT)); + NetworkAttributes.NETWORK_PROTOCOL_NAME, + NetworkAttributes.NETWORK_PROTOCOL_VERSION, + ServerAttributes.SERVER_ADDRESS, + ServerAttributes.SERVER_PORT)); } static void applyServerDurationAdvice(DoubleHistogramBuilder builder) { @@ -68,13 +71,13 @@ static void applyServerDurationAdvice(DoubleHistogramBuilder builder) { ((ExtendedDoubleHistogramBuilder) builder) .setAttributesAdvice( asList( - SemanticAttributes.HTTP_ROUTE, - SemanticAttributes.HTTP_REQUEST_METHOD, - SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, + HttpAttributes.HTTP_ROUTE, + HttpAttributes.HTTP_REQUEST_METHOD, + HttpAttributes.HTTP_RESPONSE_STATUS_CODE, ERROR_TYPE, - SemanticAttributes.NETWORK_PROTOCOL_NAME, - SemanticAttributes.NETWORK_PROTOCOL_VERSION, - SemanticAttributes.URL_SCHEME)); + NetworkAttributes.NETWORK_PROTOCOL_NAME, + NetworkAttributes.NETWORK_PROTOCOL_VERSION, + UrlAttributes.URL_SCHEME)); } private HttpMetricsAdvice() {} diff --git a/src/main/java/bio/terra/common/opentelemetry/OpenTelemetryConfig.java b/src/main/java/bio/terra/common/opentelemetry/OpenTelemetryConfig.java index bda3325f..b890699f 100644 --- a/src/main/java/bio/terra/common/opentelemetry/OpenTelemetryConfig.java +++ b/src/main/java/bio/terra/common/opentelemetry/OpenTelemetryConfig.java @@ -1,7 +1,6 @@ package bio.terra.common.opentelemetry; import bio.terra.common.tracing.ExcludingUrlSampler; -import io.opentelemetry.instrumentation.spring.autoconfigure.EnableOpenTelemetry; import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider; import io.opentelemetry.sdk.metrics.InstrumentSelector; import io.opentelemetry.sdk.metrics.View; @@ -18,7 +17,6 @@ import org.springframework.data.util.Pair; @Configuration -@EnableOpenTelemetry @EnableConfigurationProperties(value = {TracingProperties.class}) public class OpenTelemetryConfig { diff --git a/src/main/java/bio/terra/common/tracing/ExcludingUrlSampler.java b/src/main/java/bio/terra/common/tracing/ExcludingUrlSampler.java index 516d8e76..9a9d40c2 100644 --- a/src/main/java/bio/terra/common/tracing/ExcludingUrlSampler.java +++ b/src/main/java/bio/terra/common/tracing/ExcludingUrlSampler.java @@ -6,7 +6,7 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingResult; -import io.opentelemetry.semconv.SemanticAttributes; +import io.opentelemetry.semconv.UrlAttributes; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -38,8 +38,8 @@ public SamplingResult shouldSample( // HTTP_TARGET seems to have the right information but that is deprecated // check URL_PATH to be forward compatible. JUST CHECK THEM ALL var urlCandidates = new HashSet(); - urlCandidates.add(attributes.get(SemanticAttributes.URL_PATH)); - urlCandidates.add(attributes.get(SemanticAttributes.HTTP_TARGET)); + urlCandidates.add(attributes.get(UrlAttributes.URL_PATH)); + urlCandidates.add(attributes.get(UrlAttributes.URL_QUERY)); urlCandidates.add(name); // removeAll below does not like nulls so remove any if they exist urlCandidates.remove(null); diff --git a/src/test/java/bio/terra/common/logging/HumanReadableLoggingTest.java b/src/test/java/bio/terra/common/logging/HumanReadableLoggingTest.java index 6d0e4c1d..29550bc0 100644 --- a/src/test/java/bio/terra/common/logging/HumanReadableLoggingTest.java +++ b/src/test/java/bio/terra/common/logging/HumanReadableLoggingTest.java @@ -28,20 +28,20 @@ @ActiveProfiles("human-readable-logging") @Tag("unit") @ExtendWith(OutputCaptureExtension.class) -public class HumanReadableLoggingTest { +class HumanReadableLoggingTest { @Autowired private TestRestTemplate testRestTemplate; // Spy bean to allow us to mock out the RequestIdFilter ID generator. @SpyBean private RequestIdFilter requestIdFilter; @BeforeEach - public void setUp() { + void setUp() { // Ensure the request ID is always set to a known value. when(requestIdFilter.generateRequestId()).thenReturn("12345"); } @Test - public void testRequestLogging(CapturedOutput capturedOutput) { + void testRequestLogging(CapturedOutput capturedOutput) { ResponseEntity response = testRestTemplate.getForEntity("/testRequestLogging", String.class); assertThat(response.getStatusCode().value()).isEqualTo(200); @@ -55,6 +55,6 @@ public void testRequestLogging(CapturedOutput capturedOutput) { // in the main logback.xml assertThat(allOutput).contains("12345"); // Poor-man's check for lack of JSON - assertThat(allOutput).doesNotContain("{"); + assertThat(allOutput).doesNotContain("{\"timestampSeconds\":"); } } diff --git a/src/test/java/bio/terra/common/tracing/ExcludingUrlSamplerTest.java b/src/test/java/bio/terra/common/tracing/ExcludingUrlSamplerTest.java index f49a61d7..b6f5d6fe 100644 --- a/src/test/java/bio/terra/common/tracing/ExcludingUrlSamplerTest.java +++ b/src/test/java/bio/terra/common/tracing/ExcludingUrlSamplerTest.java @@ -7,7 +7,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingDecision; -import io.opentelemetry.semconv.SemanticAttributes; +import io.opentelemetry.semconv.UrlAttributes; import java.util.List; import java.util.Set; import org.hamcrest.Matchers; @@ -15,9 +15,9 @@ import org.junit.jupiter.api.Test; @Tag("unit") -public class ExcludingUrlSamplerTest { +class ExcludingUrlSamplerTest { @Test - public void testShouldSample() { + void testShouldSample() { var sampler = new ExcludingUrlSampler(Set.of("/foo", "/bar"), Sampler.alwaysOn()); assertThat( sampler @@ -28,7 +28,7 @@ public void testShouldSample() { } @Test - public void testShouldNotSampleBecauseDelegateSaidDrop() { + void testShouldNotSampleBecauseDelegateSaidDrop() { var sampler = new ExcludingUrlSampler(Set.of("/foo", "/bar"), Sampler.alwaysOff()); assertThat( sampler @@ -39,7 +39,7 @@ public void testShouldNotSampleBecauseDelegateSaidDrop() { } @Test - public void testShouldNotSampleByName() { + void testShouldNotSampleByName() { var sampler = new ExcludingUrlSampler(Set.of("/foo", "/bar"), Sampler.alwaysOn()); assertThat( sampler @@ -50,7 +50,7 @@ public void testShouldNotSampleByName() { } @Test - public void testShouldNotSampleByUrlPath() { + void testShouldNotSampleByUrlPath() { // note that the internal implementation of ExcludingUrlSampler has slightly different behavior // when the size of the excludedUrls is smaller than the size of the urlCandidates. So this test // has only one excludedUrl to make sure the scenario works. The different behavior comes from @@ -63,14 +63,14 @@ public void testShouldNotSampleByUrlPath() { "", "/baz", SpanKind.INTERNAL, - Attributes.of(SemanticAttributes.URL_PATH, "/bar"), + Attributes.of(UrlAttributes.URL_PATH, "/bar"), List.of()) .getDecision(), Matchers.is(SamplingDecision.DROP)); } @Test - public void testShouldNotSampleByHttpTarget() { + void testShouldNotSampleByUrlQuery() { var sampler = new ExcludingUrlSampler(Set.of("/foo", "/bar"), Sampler.alwaysOn()); assertThat( sampler @@ -79,7 +79,7 @@ public void testShouldNotSampleByHttpTarget() { "", "/baz", SpanKind.INTERNAL, - Attributes.of(SemanticAttributes.HTTP_TARGET, "/bar"), + Attributes.of(UrlAttributes.URL_QUERY, "/bar"), List.of()) .getDecision(), Matchers.is(SamplingDecision.DROP));