Skip to content

Commit 0925f6e

Browse files
fix: remove cloud resource providers (AWS/GCP) to prevent trace export failure
The bundled Ec2ResourceProvider makes OkHttp calls to IMDS during SDK init, whose orphaned thread pools interfere with the JDK HttpClient used by the OTLP trace exporter — causing traces to silently fail while metrics continue working. Removed: opentelemetry-aws-resources, opentelemetry-gcp-resources, okhttp, okio, kotlin-stdlib. Agent JAR reduced from 9.4MB to 5.4MB. Cloud attributes should be added by the OTel Collector's resourcedetection processor instead (resourcedetection/ec2). Bumps version to 2.2.2-beta.3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 934d83f commit 0925f6e

File tree

5 files changed

+15
-60
lines changed

5 files changed

+15
-60
lines changed

pom.xml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.last9</groupId>
88
<artifactId>vertx-otel-autoconfigure</artifactId>
9-
<version>2.2.2-beta.2</version>
9+
<version>2.2.2-beta.3</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Vert.x OpenTelemetry Auto-Configure</name>
@@ -60,7 +60,6 @@
6060
<opentelemetry-semconv.version>1.25.0-alpha</opentelemetry-semconv.version>
6161
<!-- OTel contrib resource detectors (AWS, GCP) — version must align with SDK 1.38.0.
6262
Contrib follows SDK versioning minus 2 minor versions: 38-2 = 36. -->
63-
<opentelemetry-contrib.version>1.36.0-alpha</opentelemetry-contrib.version>
6463

6564
<!-- Vert.x -->
6665
<vertx4.version>4.5.10</vertx4.version>
@@ -323,24 +322,9 @@
323322
<include>io.opentelemetry:*</include>
324323
<include>io.opentelemetry.semconv:*</include>
325324
<include>io.opentelemetry.instrumentation:*</include>
326-
<!-- AWS + GCP cloud resource detectors -->
327-
<include>io.opentelemetry.contrib:opentelemetry-aws-resources</include>
328-
<include>io.opentelemetry.contrib:opentelemetry-gcp-resources</include>
329-
<!-- GCP detector support library (transitive of gcp-resources) -->
330-
<include>com.google.cloud.opentelemetry:detector-resources-support</include>
331-
<!-- OkHttp + Okio: required by opentelemetry-aws-resources
332-
(Ec2Resource calls IMDS via OkHttpClient).
333-
We bundle the okhttp library itself but still exclude
334-
opentelemetry-exporter-sender-okhttp so that
335-
OkHttpHttpSenderProvider is NOT registered as an OTLP
336-
HttpSenderProvider — only JdkHttpSenderProvider is. -->
337-
<include>com.squareup.okhttp3:okhttp</include>
338-
<include>com.squareup.okio:okio</include>
339-
<include>com.squareup.okio:okio-jvm</include>
340-
<!-- OkHttp 4.x is written in Kotlin — runtime required -->
341-
<include>org.jetbrains.kotlin:kotlin-stdlib</include>
342-
<include>org.jetbrains.kotlin:kotlin-stdlib-jdk7</include>
343-
<include>org.jetbrains.kotlin:kotlin-stdlib-jdk8</include>
325+
<!-- Cloud resource detectors (AWS, GCP) + OkHttp/Kotlin REMOVED.
326+
Their IMDS calls interfere with JDK HttpClient OTLP export.
327+
Use collector resourcedetection processor instead. -->
344328
<!-- ByteBuddy: bytecode instrumentation for Vert.x 3
345329
zero-code tracing (Router, WebClient interception).
346330
Only used in the v3 fat JAR; shade silently skips

vertx-otel-core/pom.xml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.last9</groupId>
99
<artifactId>vertx-otel-autoconfigure</artifactId>
10-
<version>2.2.2-beta.2</version>
10+
<version>2.2.2-beta.3</version>
1111
</parent>
1212

1313
<artifactId>vertx-otel-core</artifactId>
@@ -87,42 +87,13 @@
8787
<version>${opentelemetry-instrumentation.version}-alpha</version>
8888
</dependency>
8989

90-
<!-- AWS resource detectors: EC2, ECS, EKS, Lambda, Elastic Beanstalk.
91-
Registered via SPI — autoconfigure picks them up automatically.
92-
Makes short HTTP calls to IMDS at startup; silently skips if not on AWS. -->
93-
<dependency>
94-
<groupId>io.opentelemetry.contrib</groupId>
95-
<artifactId>opentelemetry-aws-resources</artifactId>
96-
<version>${opentelemetry-contrib.version}</version>
97-
</dependency>
98-
99-
<!-- Kotlin stdlib: okhttp 4.x is written in Kotlin, kotlin-stdlib is required at runtime.
100-
Bundled here so customers don't need to add it separately. -->
101-
<dependency>
102-
<groupId>org.jetbrains.kotlin</groupId>
103-
<artifactId>kotlin-stdlib</artifactId>
104-
<version>1.9.22</version>
105-
</dependency>
106-
107-
<!-- OkHttp: required by opentelemetry-aws-resources (Ec2Resource calls EC2 IMDS via
108-
OkHttpClient). This is bundled into the fat JAR so the AWS detector works on EC2
109-
without requiring customers to add okhttp as a dependency.
110-
NOTE: opentelemetry-exporter-sender-okhttp is excluded from the shade; only the
111-
okhttp library itself (not its OTel sender SPI) is bundled here. -->
112-
<dependency>
113-
<groupId>com.squareup.okhttp3</groupId>
114-
<artifactId>okhttp</artifactId>
115-
<version>4.12.0</version>
116-
</dependency>
117-
118-
<!-- GCP resource detectors: GCE, GKE, Cloud Run, App Engine.
119-
Registered via SPI — autoconfigure picks them up automatically.
120-
Makes short HTTP calls to GCP metadata server at startup; silently skips if not on GCP. -->
121-
<dependency>
122-
<groupId>io.opentelemetry.contrib</groupId>
123-
<artifactId>opentelemetry-gcp-resources</artifactId>
124-
<version>${opentelemetry-contrib.version}</version>
125-
</dependency>
90+
<!-- Cloud resource detectors (AWS EC2/ECS/EKS, GCP GCE/GKE) REMOVED.
91+
Their IMDS/metadata HTTP calls during SDK init use OkHttp, whose orphaned
92+
thread pools interfere with the JDK HttpClient used by the OTLP trace
93+
exporter — causing traces to silently fail while metrics continue working.
94+
Cloud attributes should be added by the OTel Collector's resourcedetection
95+
processor instead (resourcedetection/ec2, resourcedetection/gcp).
96+
See: https://github.com/open-telemetry/opentelemetry-java-contrib/issues/1351 -->
12697

12798
<!-- Logging -->
12899
<dependency>

vertx3-otel-agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.last9</groupId>
99
<artifactId>vertx-otel-autoconfigure</artifactId>
10-
<version>2.2.2-beta.2</version>
10+
<version>2.2.2-beta.3</version>
1111
</parent>
1212

1313
<artifactId>vertx3-otel-agent</artifactId>

vertx3-rxjava2-otel-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.last9</groupId>
99
<artifactId>vertx-otel-autoconfigure</artifactId>
10-
<version>2.2.2-beta.2</version>
10+
<version>2.2.2-beta.3</version>
1111
</parent>
1212

1313
<artifactId>vertx3-rxjava2-otel-autoconfigure</artifactId>

vertx4-rxjava3-otel-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.last9</groupId>
99
<artifactId>vertx-otel-autoconfigure</artifactId>
10-
<version>2.2.2-beta.2</version>
10+
<version>2.2.2-beta.3</version>
1111
</parent>
1212

1313
<artifactId>vertx4-rxjava3-otel-autoconfigure</artifactId>

0 commit comments

Comments
 (0)