Skip to content

Commit

Permalink
[PF-2983]: Bump the minor-patch-dependencies group across 1 directory…
Browse files Browse the repository at this point in the history
… 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](googleapis/java-cloud-bom@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](open-telemetry/opentelemetry-java-instrumentation@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](spring-gradle-plugins/dependency-management-plugin@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](spring-projects/spring-boot@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] <[email protected]>

* 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Phil Shapiro <[email protected]>
  • Loading branch information
dependabot[bot] and pshapiro4broad authored Sep 6, 2024
1 parent 4e8c748 commit 0b05c5d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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}"

Expand All @@ -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'
Expand All @@ -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'
Expand Down
29 changes: 16 additions & 13 deletions src/main/java/bio/terra/common/opentelemetry/HttpMetricsAdvice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,7 +17,6 @@
import org.springframework.data.util.Pair;

@Configuration
@EnableOpenTelemetry
@EnableConfigurationProperties(value = {TracingProperties.class})
public class OpenTelemetryConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String>();
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> response =
testRestTemplate.getForEntity("/testRequestLogging", String.class);
assertThat(response.getStatusCode().value()).isEqualTo(200);
Expand All @@ -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\":");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
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;
import org.junit.jupiter.api.Tag;
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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));
Expand Down

0 comments on commit 0b05c5d

Please sign in to comment.