Skip to content

Commit ea98d80

Browse files
committed
Merge branch 'main' of https://github.com/open-telemetry/opentelemetry-java into declarative-config-0.4
2 parents 7ab9b34 + 526137f commit ea98d80

File tree

53 files changed

+833
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+833
-153
lines changed

animal-sniffer-signature/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ configurations.add(signatureJarClasspath)
2727
configurations.add(generatedSignature)
2828

2929
dependencies {
30-
signature("com.toasttab.android:gummy-bears-api-23:0.10.0@signature")
30+
signature("com.toasttab.android:gummy-bears-api-23:0.12.0@signature")
3131
signatureJar("com.android.tools:desugar_jdk_libs")
3232
}
3333

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
// When updating, update above in plugins too
5656
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
5757
// Needed for japicmp but not automatically brought in for some reason.
58-
implementation("com.google.guava:guava:33.4.0-jre")
58+
implementation("com.google.guava:guava:33.4.6-jre")
5959
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:3.19.2")
6060
implementation("com.squareup:javapoet:1.13.0")
6161
implementation("com.squareup.wire:wire-compiler")
@@ -66,7 +66,7 @@ dependencies {
6666
implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.3")
6767
implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.1.0")
6868
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
69-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
69+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
7070
implementation("org.owasp:dependency-check-gradle:12.1.0")
7171
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.0")
7272
}

dependencyManagement/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val DEPENDENCY_BOMS = listOf(
1414
// by FOSSA for containing EPL-licensed)
1515

1616
"com.fasterxml.jackson:jackson-bom:2.18.3",
17-
"com.google.guava:guava-bom:33.4.0-jre",
17+
"com.google.guava:guava-bom:33.4.5-jre",
1818
"com.google.protobuf:protobuf-bom:4.29.3",
1919
"com.squareup.okhttp3:okhttp-bom:4.12.0",
2020
"com.squareup.okio:okio-bom:3.10.2", // applies to transitive dependencies of okhttp
@@ -36,8 +36,8 @@ val slf4jVersion = "2.0.17"
3636
val opencensusVersion = "0.31.1"
3737
val prometheusClientVersion = "0.16.0"
3838
val prometheusServerVersion = "1.3.6"
39-
val armeriaVersion = "1.32.0"
40-
val junitVersion = "5.12.0"
39+
val armeriaVersion = "1.32.3"
40+
val junitVersion = "5.12.1"
4141

4242
val DEPENDENCIES = listOf(
4343
"org.junit.jupiter:junit-jupiter-api:${junitVersion}",
@@ -73,7 +73,7 @@ val DEPENDENCIES = listOf(
7373
"io.prometheus:simpleclient_httpserver:${prometheusClientVersion}",
7474
"javax.annotation:javax.annotation-api:1.3.2",
7575
"com.github.stefanbirkner:system-rules:1.19.0",
76-
"com.google.api.grpc:proto-google-common-protos:2.53.0",
76+
"com.google.api.grpc:proto-google-common-protos:2.54.1",
7777
"com.google.code.findbugs:jsr305:3.0.2",
7878
"com.google.guava:guava-beta-checker:1.0",
7979
"com.sun.net.httpserver:http:20070405",
@@ -89,7 +89,7 @@ val DEPENDENCIES = listOf(
8989
"io.opentracing:opentracing-api:0.33.0",
9090
"io.opentracing:opentracing-noop:0.33.0",
9191
"junit:junit:4.13.2",
92-
"nl.jqno.equalsverifier:equalsverifier:3.19.1",
92+
"nl.jqno.equalsverifier:equalsverifier:3.19.2",
9393
"org.awaitility:awaitility:4.3.0",
9494
"org.bouncycastle:bcpkix-jdk15on:1.70",
9595
"org.codehaus.mojo:animal-sniffer-annotations:1.24",
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
Comparing source compatibility of opentelemetry-exporter-otlp-1.49.0-SNAPSHOT.jar against opentelemetry-exporter-otlp-1.48.0.jar
2-
No changes.
2+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporterBuilder (not serializable)
3+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
4+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)
5+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder (not serializable)
6+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
7+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)
8+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder (not serializable)
9+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
10+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)
11+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporterBuilder (not serializable)
12+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
13+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)
14+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporterBuilder (not serializable)
15+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
16+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)
17+
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder (not serializable)
18+
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
19+
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder setExecutorService(java.util.concurrent.ExecutorService)

exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcExporterBuilder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Optional;
2626
import java.util.ServiceLoader;
2727
import java.util.StringJoiner;
28+
import java.util.concurrent.ExecutorService;
2829
import java.util.concurrent.TimeUnit;
2930
import java.util.function.BiFunction;
3031
import java.util.function.Supplier;
@@ -63,6 +64,7 @@ public class GrpcExporterBuilder<T extends Marshaler> {
6364
@Nullable private RetryPolicy retryPolicy = RetryPolicy.getDefault();
6465
private Supplier<MeterProvider> meterProviderSupplier = GlobalOpenTelemetry::getMeterProvider;
6566
private ClassLoader serviceClassLoader = GrpcExporterBuilder.class.getClassLoader();
67+
@Nullable private ExecutorService executorService;
6668

6769
// Use Object type since gRPC may not be on the classpath.
6870
@Nullable private Object grpcChannel;
@@ -153,6 +155,11 @@ public GrpcExporterBuilder<T> setServiceClassLoader(ClassLoader servieClassLoade
153155
return this;
154156
}
155157

158+
public GrpcExporterBuilder<T> setExecutorService(ExecutorService executorService) {
159+
this.executorService = executorService;
160+
return this;
161+
}
162+
156163
@SuppressWarnings("BuilderReturnThis")
157164
public GrpcExporterBuilder<T> copy() {
158165
GrpcExporterBuilder<T> copy =
@@ -216,7 +223,8 @@ public GrpcExporter<T> build() {
216223
grpcStubFactory,
217224
retryPolicy,
218225
isPlainHttp ? null : tlsConfigHelper.getSslContext(),
219-
isPlainHttp ? null : tlsConfigHelper.getTrustManager()));
226+
isPlainHttp ? null : tlsConfigHelper.getTrustManager(),
227+
executorService));
220228
LOGGER.log(Level.FINE, "Using GrpcSender: " + grpcSender.getClass().getName());
221229

222230
return new GrpcExporter<>(exporterName, type, grpcSender, meterProviderSupplier);
@@ -250,6 +258,9 @@ public String toString(boolean includePrefixAndSuffix) {
250258
joiner.add("grpcChannel=" + grpcChannel);
251259
}
252260
joiner.add("serviceClassLoader=" + serviceClassLoader);
261+
if (executorService != null) {
262+
joiner.add("executorService=" + executorService);
263+
}
253264
// Note: omit tlsConfigHelper because we can't log the configuration in any readable way
254265
// Note: omit meterProviderSupplier because we can't log the configuration in any readable way
255266
return joiner.toString();

exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcSenderConfig.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.net.URI;
1414
import java.util.List;
1515
import java.util.Map;
16+
import java.util.concurrent.ExecutorService;
1617
import java.util.function.BiFunction;
1718
import java.util.function.Supplier;
1819
import javax.annotation.Nullable;
@@ -40,7 +41,8 @@ public static <T extends Marshaler> GrpcSenderConfig<T> create(
4041
Supplier<BiFunction<Channel, String, MarshalerServiceStub<T, ?, ?>>> stubFactory,
4142
@Nullable RetryPolicy retryPolicy,
4243
@Nullable SSLContext sslContext,
43-
@Nullable X509TrustManager trustManager) {
44+
@Nullable X509TrustManager trustManager,
45+
@Nullable ExecutorService executorService) {
4446
return new AutoValue_GrpcSenderConfig<>(
4547
endpoint,
4648
endpointPath,
@@ -52,7 +54,8 @@ public static <T extends Marshaler> GrpcSenderConfig<T> create(
5254
stubFactory,
5355
retryPolicy,
5456
sslContext,
55-
trustManager);
57+
trustManager,
58+
executorService);
5659
}
5760

5861
public abstract URI getEndpoint();
@@ -82,4 +85,7 @@ public static <T extends Marshaler> GrpcSenderConfig<T> create(
8285

8386
@Nullable
8487
public abstract X509TrustManager getTrustManager();
88+
89+
@Nullable
90+
public abstract ExecutorService getExecutorService();
8591
}

exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpExporterBuilder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Optional;
2424
import java.util.ServiceLoader;
2525
import java.util.StringJoiner;
26+
import java.util.concurrent.ExecutorService;
2627
import java.util.concurrent.TimeUnit;
2728
import java.util.function.Supplier;
2829
import java.util.logging.Level;
@@ -61,6 +62,7 @@ public final class HttpExporterBuilder<T extends Marshaler> {
6162
@Nullable private RetryPolicy retryPolicy = RetryPolicy.getDefault();
6263
private Supplier<MeterProvider> meterProviderSupplier = GlobalOpenTelemetry::getMeterProvider;
6364
private ClassLoader serviceClassLoader = HttpExporterBuilder.class.getClassLoader();
65+
@Nullable private ExecutorService executorService;
6466

6567
public HttpExporterBuilder(String exporterName, String type, String defaultEndpoint) {
6668
this.exporterName = exporterName;
@@ -137,6 +139,11 @@ public HttpExporterBuilder<T> setServiceClassLoader(ClassLoader servieClassLoade
137139
return this;
138140
}
139141

142+
public HttpExporterBuilder<T> setExecutorService(ExecutorService executorService) {
143+
this.executorService = executorService;
144+
return this;
145+
}
146+
140147
public HttpExporterBuilder<T> exportAsJson() {
141148
this.exportAsJson = true;
142149
return this;
@@ -198,7 +205,8 @@ public HttpExporter<T> build() {
198205
proxyOptions,
199206
retryPolicy,
200207
isPlainHttp ? null : tlsConfigHelper.getSslContext(),
201-
isPlainHttp ? null : tlsConfigHelper.getTrustManager()));
208+
isPlainHttp ? null : tlsConfigHelper.getTrustManager(),
209+
executorService));
202210
LOGGER.log(Level.FINE, "Using HttpSender: " + httpSender.getClass().getName());
203211

204212
return new HttpExporter<>(exporterName, type, httpSender, meterProviderSupplier, exportAsJson);
@@ -230,6 +238,9 @@ public String toString(boolean includePrefixAndSuffix) {
230238
joiner.add("retryPolicy=" + retryPolicy);
231239
}
232240
joiner.add("serviceClassLoader=" + serviceClassLoader);
241+
if (executorService != null) {
242+
joiner.add("executorService=" + executorService);
243+
}
233244
// Note: omit tlsConfigHelper because we can't log the configuration in any readable way
234245
// Note: omit meterProviderSupplier because we can't log the configuration in any readable way
235246
return joiner.toString();

exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSenderConfig.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.opentelemetry.sdk.common.export.RetryPolicy;
1212
import java.util.List;
1313
import java.util.Map;
14+
import java.util.concurrent.ExecutorService;
1415
import java.util.function.Supplier;
1516
import javax.annotation.Nullable;
1617
import javax.annotation.concurrent.Immutable;
@@ -37,7 +38,8 @@ public static HttpSenderConfig create(
3738
@Nullable ProxyOptions proxyOptions,
3839
@Nullable RetryPolicy retryPolicy,
3940
@Nullable SSLContext sslContext,
40-
@Nullable X509TrustManager trustManager) {
41+
@Nullable X509TrustManager trustManager,
42+
@Nullable ExecutorService executorService) {
4143
return new AutoValue_HttpSenderConfig(
4244
endpoint,
4345
compressor,
@@ -49,7 +51,8 @@ public static HttpSenderConfig create(
4951
proxyOptions,
5052
retryPolicy,
5153
sslContext,
52-
trustManager);
54+
trustManager,
55+
executorService);
5356
}
5457

5558
public abstract String getEndpoint();
@@ -78,4 +81,7 @@ public static HttpSenderConfig create(
7881

7982
@Nullable
8083
public abstract X509TrustManager getTrustManager();
84+
85+
@Nullable
86+
public abstract ExecutorService getExecutorService();
8187
}

exporters/otlp/all/src/jmh/java/io/opentelemetry/exporter/otlp/trace/OltpExporterBenchmark.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public void setUp() {
8888
MarshalerTraceServiceGrpc.newFutureStub(defaultGrpcChannel, null),
8989
/* shutdownChannel= */ false,
9090
10,
91-
Collections::emptyMap),
91+
Collections::emptyMap,
92+
null),
9293
MeterProvider::noop);
9394

9495
okhttpGrpcSender =
@@ -105,6 +106,7 @@ public void setUp() {
105106
Collections::emptyMap,
106107
null,
107108
null,
109+
null,
108110
null),
109111
MeterProvider::noop);
110112

exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/http/logs/OtlpHttpLogRecordExporterBuilder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.opentelemetry.sdk.common.export.RetryPolicy;
2222
import java.time.Duration;
2323
import java.util.Map;
24+
import java.util.concurrent.ExecutorService;
2425
import java.util.concurrent.TimeUnit;
2526
import java.util.function.Supplier;
2627
import javax.annotation.Nullable;
@@ -236,6 +237,19 @@ public OtlpHttpLogRecordExporterBuilder setServiceClassLoader(ClassLoader servic
236237
return this;
237238
}
238239

240+
/**
241+
* Set the {@link ExecutorService} used to execute requests.
242+
*
243+
* <p>NOTE: By calling this method, you are opting into managing the lifecycle of the {@code
244+
* executorService}. {@link ExecutorService#shutdown()} will NOT be called when this exporter is
245+
* shutdown.
246+
*/
247+
public OtlpHttpLogRecordExporterBuilder setExecutorService(ExecutorService executorService) {
248+
requireNonNull(executorService, "executorService");
249+
delegate.setExecutorService(executorService);
250+
return this;
251+
}
252+
239253
/**
240254
* Constructs a new instance of the exporter based on the builder's values.
241255
*

0 commit comments

Comments
 (0)