Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
76 changes: 41 additions & 35 deletions .github/config/latest-dep-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"com.github.etaty:rediscala_2.11#+": "1.9.0",
"com.github.etaty:rediscala_2.12#+": "1.9.0",
"com.github.etaty:rediscala_2.13#+": "1.9.0",
"com.github.oshi:oshi-core#+": "7.2.0",
"com.github.oshi:oshi-core#+": "7.2.1",
"com.google.guava:guava#+": "33.6.0-jre",
"com.google.gwt:gwt-servlet#+": "2.10.0",
"com.google.http-client:google-http-client#+": "2.1.0",
Expand Down Expand Up @@ -119,7 +119,7 @@
"com.typesafe.play:play_2.11#2.7.+": "2.7.9",
"com.typesafe.play:play_2.12#+": "2.8.22",
"com.typesafe.play:play_2.13#+": "2.9.11",
"com.vaadin:flow-server#+": "25.1.6",
"com.vaadin:flow-server#+": "25.1.7",
"com.vaadin:vaadin-spring-boot-starter#14.11.+": "14.11.14",
"com.xuxueli:xxl-job-core#+": "3.4.0",
"com.xuxueli:xxl-job-core#2.2.+": "2.2.0",
Expand All @@ -140,7 +140,7 @@
"io.avaje:avaje-jex#+": "3.5",
"io.awspring.cloud:spring-cloud-aws-sqs#+": "4.0.2",
"io.awspring.cloud:spring-cloud-aws-starter-sqs#+": "4.0.2",
"io.dropwizard.metrics:metrics-core#+": "4.2.38",
"io.dropwizard.metrics:metrics-core#+": "4.2.39",
"io.dropwizard:dropwizard-client#+": "5.0.1",
"io.dropwizard:dropwizard-views#+": "5.0.1",
"io.github.rediscala:rediscala_2.13#+": "1.17.0",
Expand Down Expand Up @@ -206,36 +206,40 @@
"io.reactivex:rxjava#+": "1.3.8",
"io.undertow:undertow-core#+": "2.4.1.Final",
"io.undertow:undertow-servlet-jakarta#+": "2.2.20.Final",
"io.vertx:vertx-circuit-breaker#+": "5.0.12",
"io.vertx:vertx-circuit-breaker#+": "5.1.0",
"io.vertx:vertx-circuit-breaker#3.+": "3.9.16",
"io.vertx:vertx-circuit-breaker#4.+": "4.5.27",
"io.vertx:vertx-codegen#+": "5.0.12",
"io.vertx:vertx-codegen#+": "5.1.0",
"io.vertx:vertx-codegen#3.+": "3.9.16",
"io.vertx:vertx-codegen#4.+": "4.5.27",
"io.vertx:vertx-core#+": "5.0.12",
"io.vertx:vertx-codegen#5.0.+": "5.0.12",
"io.vertx:vertx-core#+": "5.1.0",
"io.vertx:vertx-core#3.+": "3.9.16",
"io.vertx:vertx-core#4.+": "4.5.27",
"io.vertx:vertx-docgen#+": "3.5.1",
"io.vertx:vertx-docgen#3.+": "3.5.1",
"io.vertx:vertx-jdbc-client#+": "5.0.12",
"io.vertx:vertx-jdbc-client#+": "5.1.0",
"io.vertx:vertx-jdbc-client#3.+": "3.9.16",
"io.vertx:vertx-jdbc-client#4.+": "4.5.27",
"io.vertx:vertx-kafka-client#+": "5.0.12",
"io.vertx:vertx-jdbc-client#5.0.+": "5.0.12",
"io.vertx:vertx-kafka-client#+": "5.1.0",
"io.vertx:vertx-kafka-client#3.+": "3.9.16",
"io.vertx:vertx-kafka-client#4.+": "4.5.27",
"io.vertx:vertx-lang-kotlin-coroutines#+": "5.0.12",
"io.vertx:vertx-pg-client#+": "5.0.12",
"io.vertx:vertx-lang-kotlin-coroutines#+": "5.1.0",
"io.vertx:vertx-pg-client#+": "5.1.0",
"io.vertx:vertx-pg-client#4.+": "4.5.27",
"io.vertx:vertx-redis-client#+": "5.0.12",
"io.vertx:vertx-rx-java2#+": "5.0.12",
"io.vertx:vertx-pg-client#5.0.+": "5.0.12",
"io.vertx:vertx-redis-client#+": "5.1.0",
"io.vertx:vertx-rx-java2#+": "5.1.0",
"io.vertx:vertx-rx-java2#3.+": "3.9.16",
"io.vertx:vertx-rx-java2#4.+": "4.5.27",
"io.vertx:vertx-sql-client#+": "5.0.12",
"io.vertx:vertx-sql-client#+": "5.1.0",
"io.vertx:vertx-sql-client#4.+": "4.5.27",
"io.vertx:vertx-web#+": "5.0.12",
"io.vertx:vertx-sql-client#5.0.+": "5.0.12",
"io.vertx:vertx-web#+": "5.1.0",
"io.vertx:vertx-web#3.+": "3.9.16",
"io.vertx:vertx-web#4.+": "4.5.27",
"io.vertx:vertx-web-client#+": "5.0.12",
"io.vertx:vertx-web-client#+": "5.1.0",
"io.vertx:vertx-web-client#3.+": "3.9.16",
"io.vertx:vertx-web-client#4.+": "4.5.27",
"jakarta.el:jakarta.el-api#4.+": "4.0.0",
Expand All @@ -258,11 +262,11 @@
"log4j:log4j#+": "1.2.17",
"net.logstash.logback:logstash-logback-encoder#+": "9.0",
"net.spy:spymemcached#+": "2.12.3",
"org.apache.axis2:axis2-jaxws#+": "2.0.0",
"org.apache.axis2:axis2-jaxws#+": "2.0.1",
"org.apache.axis2:axis2-jaxws#1.+": "1.8.2",
"org.apache.axis2:axis2-transport-http#+": "2.0.0",
"org.apache.axis2:axis2-transport-http#+": "2.0.1",
"org.apache.axis2:axis2-transport-http#1.+": "1.8.2",
"org.apache.axis2:axis2-transport-local#+": "2.0.0",
"org.apache.axis2:axis2-transport-local#+": "2.0.1",
"org.apache.axis2:axis2-transport-local#1.+": "1.8.2",
"org.apache.camel:camel-aws#2.+": "2.25.4",
"org.apache.camel:camel-cassandraql#2.+": "2.25.4",
Expand Down Expand Up @@ -393,11 +397,13 @@
"org.gwtproject:gwt-dev#+": "2.13.0",
"org.gwtproject:gwt-servlet#+": "2.13.0",
"org.gwtproject:gwt-user#+": "2.13.0",
"org.hibernate.orm:hibernate-core#+": "7.3.6.Final",
"org.hibernate.orm:hibernate-core#+": "7.4.0.Final",
"org.hibernate.orm:hibernate-core#6.+": "6.6.51.Final",
"org.hibernate.orm:hibernate-core#7.+": "7.4.0.Final",
"org.hibernate.reactive:hibernate-reactive-core#+": "4.3.5.Final",
"org.hibernate.reactive:hibernate-reactive-core#1.+": "1.1.9.Final",
"org.hibernate.reactive:hibernate-reactive-core#3.+": "3.3.7.Final",
"org.hibernate:hibernate-core#+": "7.3.6.Final",
"org.hibernate:hibernate-core#+": "7.4.0.Final",
"org.hibernate:hibernate-core#3.+": "3.6.10.Final",
"org.hibernate:hibernate-core#5.+": "5.6.15.Final",
"org.hibernate:hibernate-core#6.+": "6.6.51.Final",
Expand Down Expand Up @@ -544,21 +550,21 @@
"redis.clients:jedis#+": "7.5.0",
"redis.clients:jedis#2.+": "2.10.2",
"redis.clients:jedis#3.+": "3.10.0",
"software.amazon.awssdk.crt:aws-crt#+": "0.46.0",
"software.amazon.awssdk:aws-core#+": "2.44.12",
"software.amazon.awssdk:aws-json-protocol#+": "2.44.12",
"software.amazon.awssdk:bedrockruntime#+": "2.44.12",
"software.amazon.awssdk:dynamodb#+": "2.44.12",
"software.amazon.awssdk:ec2#+": "2.44.12",
"software.amazon.awssdk:kinesis#+": "2.44.12",
"software.amazon.awssdk:lambda#+": "2.44.12",
"software.amazon.awssdk:rds#+": "2.44.12",
"software.amazon.awssdk:s3#+": "2.44.12",
"software.amazon.awssdk:secretsmanager#+": "2.44.12",
"software.amazon.awssdk:ses#+": "2.44.12",
"software.amazon.awssdk:sfn#+": "2.44.12",
"software.amazon.awssdk:sns#+": "2.44.12",
"software.amazon.awssdk:sqs#+": "2.44.12",
"software.amazon.awssdk.crt:aws-crt#+": "0.46.1",
"software.amazon.awssdk:aws-core#+": "2.44.13",
"software.amazon.awssdk:aws-json-protocol#+": "2.44.13",
"software.amazon.awssdk:bedrockruntime#+": "2.44.13",
"software.amazon.awssdk:dynamodb#+": "2.44.13",
"software.amazon.awssdk:ec2#+": "2.44.13",
"software.amazon.awssdk:kinesis#+": "2.44.13",
"software.amazon.awssdk:lambda#+": "2.44.13",
"software.amazon.awssdk:rds#+": "2.44.13",
"software.amazon.awssdk:s3#+": "2.44.13",
"software.amazon.awssdk:secretsmanager#+": "2.44.13",
"software.amazon.awssdk:ses#+": "2.44.13",
"software.amazon.awssdk:sfn#+": "2.44.13",
"software.amazon.awssdk:sns#+": "2.44.13",
"software.amazon.awssdk:sqs#+": "2.44.13",
"tech.powerjob:powerjob-official-processors#+": "5.1.2",
"tech.powerjob:powerjob-worker#+": "5.1.2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ plugins {

muzzle {
pass {
group.set("org.hibernate")
group.set("org.hibernate.orm")
module.set("hibernate-core")
versions.set("[6.0.0.Final,)")
assertInverse.set(true)
}
}

dependencies {
library("org.hibernate:hibernate-core:6.0.0.Final")
library("org.hibernate.orm:hibernate-core:6.0.0.Final")

implementation(project(":instrumentation:hibernate:hibernate-common-3.3:javaagent"))

Expand Down Expand Up @@ -49,7 +49,7 @@ testing {
implementation("com.h2database:h2:1.4.197")
implementation("org.hsqldb:hsqldb:2.0.0")
implementation(project(":instrumentation:hibernate:testing"))
implementation("org.hibernate:hibernate-core:${baseVersion("6.0.0.Final").orLatest("6.+")}")
implementation("org.hibernate.orm:hibernate-core:${baseVersion("6.0.0.Final").orLatest("6.+")}")
}
}

Expand All @@ -64,7 +64,7 @@ testing {
implementation("com.h2database:h2:1.4.197")
implementation("org.hsqldb:hsqldb:2.0.0")
implementation(project(":instrumentation:hibernate:testing"))
implementation("org.hibernate:hibernate-core:${baseVersion("7.0.0.Final").orLatest("7.+")}")
implementation("org.hibernate.orm:hibernate-core:${baseVersion("7.0.0.Final").orLatest("7.+")}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
val springAgent by configurations.creating

dependencies {
library("org.hibernate:hibernate-core:6.0.0.Final")
library("org.hibernate.orm:hibernate-core:6.0.0.Final")

testInstrumentation(project(":instrumentation:hibernate:hibernate-6.0:javaagent"))
testInstrumentation(project(":instrumentation:jdbc:javaagent"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// removed in 4.0
return not(hasClassesNamed("io.vertx.core.Starter"))
// added in 5.0
.and(not(hasClassesNamed("io.vertx.core.http.impl.HttpClientConnectionInternal")));
.and(not(hasClassesNamed("io.vertx.core.http.HttpClientConnection")));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.returns;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
Expand All @@ -16,23 +17,24 @@
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

/** Propagate context to connection established callback. */
class ResourceManagerInstrumentation implements TypeInstrumentation {
class HttpClientImplInstrumentation implements TypeInstrumentation {

@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("io.vertx.core.internal.resource.ResourceManager");
return named("io.vertx.core.http.impl.HttpClientImpl");
}

@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
named("withResourceAsync").and(returns(named("io.vertx.core.Future"))),
getClass().getName() + "$WithResourceAsyncAdvice");
named("request")
.and(takesArgument(0, named("io.vertx.core.http.RequestOptions")))
.and(returns(named("io.vertx.core.Future"))),
getClass().getName() + "$WrapFutureAdvice");
}

@SuppressWarnings("unused")
public static class WithResourceAsyncAdvice {
public static class WrapFutureAdvice {
@AssignReturned.ToReturned
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static Future<?> wrapFuture(@Advice.Return Future<?> future) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.vertx.httpclient.v5_0;

import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;

import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpConnection;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.asm.Advice.AssignReturned;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

class HttpClientResponseImplInstrumentation implements TypeInstrumentation {

@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("io.vertx.core.http.impl.HttpClientResponseImpl");
}

@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(isConstructor(), getClass().getName() + "$ConstructorAdvice");
}

@SuppressWarnings("unused")
public static class ConstructorAdvice {
@AssignReturned.ToReturned
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static void setConnection(
@Advice.This HttpClientResponse response,
@Advice.FieldValue("conn") HttpConnection connection) {
VertxClientSingletons.setConnection(response, connection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.opentelemetry.javaagent.instrumentation.vertx.httpclient.common.v3_0.AbstractVertxHttpAttributesGetter;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpConnection;
import io.vertx.core.http.HttpVersion;
import io.vertx.core.net.HostAndPort;
import io.vertx.core.net.SocketAddress;
Expand Down Expand Up @@ -79,7 +80,11 @@ public String getNetworkPeerAddress(
if (response == null) {
return null;
}
SocketAddress socketAddress = response.netSocket().remoteAddress();
HttpConnection connection = VertxClientSingletons.getConnection(response);
if (connection == null) {
return null;
}
SocketAddress socketAddress = connection.remoteAddress();
return socketAddress == null ? null : socketAddress.hostAddress();
}

Expand All @@ -90,7 +95,11 @@ public Integer getNetworkPeerPort(
if (response == null) {
return null;
}
SocketAddress socketAddress = response.netSocket().remoteAddress();
HttpConnection connection = VertxClientSingletons.getConnection(response);
if (connection == null) {
return null;
}
SocketAddress socketAddress = connection.remoteAddress();
return socketAddress == null ? null : socketAddress.port();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ public VertxClientInstrumentationModule() {
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// added in 5.0
return hasClassesNamed("io.vertx.core.http.impl.HttpClientConnectionInternal");
return hasClassesNamed("io.vertx.core.http.HttpClientConnection");
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(
new HttpRequestInstrumentation(),
new HttpClientRequestBaseInstrumentation(),
new ResourceManagerInstrumentation(),
new HttpClientResponseImplInstrumentation(),
new HttpClientImplInstrumentation(),
new TaskQueueInstrumentation());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.vertx.core.Future;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.http.HttpConnection;
import io.vertx.core.net.HostAndPort;
import java.util.concurrent.CompletableFuture;
import javax.annotation.Nullable;
Expand All @@ -30,6 +31,9 @@ public class VertxClientSingletons {
public static final VirtualField<HttpClientRequest, Contexts> CONTEXTS =
VirtualField.find(HttpClientRequest.class, Contexts.class);

private static final VirtualField<HttpClientResponse, HttpConnection> CONNECTION_FIELD =
VirtualField.find(HttpClientResponse.class, HttpConnection.class);

public static Instrumenter<HttpClientRequest, HttpClientResponse> instrumenter() {
return instrumenter;
}
Expand All @@ -43,6 +47,16 @@ public static HostAndPort getAuthority(HttpClientRequest request) {
return AUTHORITY_FIELD.get(request);
}

public static void setConnection(
HttpClientResponse response, @Nullable HttpConnection connection) {
CONNECTION_FIELD.set(response, connection);
}

@Nullable
public static HttpConnection getConnection(HttpClientResponse response) {
return CONNECTION_FIELD.get(response);
}

public static <T> Future<T> wrapFuture(Future<T> future) {
Context context = Context.current();
CompletableFuture<T> result = new CompletableFuture<>();
Expand Down
Loading
Loading