Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### ⚠️ Breaking changes

- Drop R2DBC SPI 0.9 support; R2DBC instrumentation now requires SPI 1.0 or later.
- Rename the Spark Java instrumentation selector from `spark-2.3` to `spark-2.4`.
- Spring Boot Java agent resource providers move from
`io.opentelemetry.instrumentation.spring.resources` to
Expand Down
6 changes: 4 additions & 2 deletions instrumentation/r2dbc-1.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ muzzle {
pass {
group.set("io.r2dbc")
module.set("r2dbc-spi")
versions.set("[0.9.0.RELEASE,)")
versions.set("[1.0.0.RELEASE,)")
assertInverse.set(true)
// SPI 0.9 is unsupported, but its Integer update counts erase to the same signature as 1.0's Long.
skip("0.9.0.RELEASE", "0.9.1.RELEASE")
Comment thread
trask marked this conversation as resolved.
Outdated
extraDependency("io.projectreactor:reactor-core:3.4.12")
}
}
Expand All @@ -25,7 +27,7 @@ sourceSets {
}

dependencies {
library("io.r2dbc:r2dbc-spi:0.9.0.RELEASE")
library("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")
Comment thread
trask marked this conversation as resolved.
compileOnly(project(path = ":instrumentation:r2dbc-1.0:library-instrumentation-shaded", configuration = "shadow"))

testImplementation(project(":instrumentation:r2dbc-1.0:testing"))
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/r2dbc-1.0/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
library("io.r2dbc:r2dbc-spi:0.9.0.RELEASE")
library("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")
implementation("io.r2dbc:r2dbc-proxy")

testImplementation(project(":instrumentation:r2dbc-1.0:testing"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ private FilterAwareResult(

@Override
public Publisher<Long> getRowsUpdated() {
// The Publisher signature is erased; forward SPI 0.9 Integer and SPI 1.0 Long counts
// unchanged.
return delegate.getRowsUpdated();
}

Expand Down
2 changes: 1 addition & 1 deletion instrumentation/r2dbc-1.0/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
api("io.opentelemetry.javaagent:opentelemetry-testing-common")

implementation("io.r2dbc:r2dbc-spi:0.9.0.RELEASE")
implementation("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")

implementation(project(":instrumentation-api-incubator"))
implementation("org.testcontainers:testcontainers")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,45 @@ void filteredResultConsumptionFinishesQuerySpan() {
.hasParent(trace.getSpan(0))));
}

@Test
void filteredUpdateResultConsumptionFinishesQuerySpan() {
Comment thread
trask marked this conversation as resolved.
Outdated
ConnectionFactoryOptions options =
ConnectionFactoryOptions.parse("r2dbc:h2:mem:///filtered_update_" + UUID.randomUUID());
Connection connection =
Mono.from(createProxyConnectionFactory(options).create()).block(Duration.ofSeconds(10));
try {
getTesting()
.runWithSpan(
"parent",
() ->
assertThat(
Flux.from(
connection
.createStatement("CREATE TABLE test (id INT)")
.execute())
.flatMap(
result ->
result
.filter(segment -> segment instanceof Result.UpdateCount)
.getRowsUpdated())
.collectList()
.block(Duration.ofSeconds(10)))
.containsExactly(0L));
} finally {
Mono.from(connection.close()).block(Duration.ofSeconds(10));
}

getTesting()
.waitAndAssertTraces(
trace ->
trace.hasSpansSatisfyingExactly(
span -> span.hasName("parent").hasKind(SpanKind.INTERNAL),
span ->
span.hasName("CREATE TABLE test")
.hasKind(SpanKind.CLIENT)
.hasParent(trace.getSpan(0))));
}

private static Stream<Arguments> provideParameters() {
return systems.values().stream()
.flatMap(
Expand Down
Loading