Skip to content

Commit d3e3bdf

Browse files
authored
Start prometheus httpserver with daemon thread (#6472)
1 parent b6c30bc commit d3e3bdf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import io.opentelemetry.sdk.common.CompletableResultCode;
1414
import io.opentelemetry.sdk.common.export.MemoryMode;
15+
import io.opentelemetry.sdk.internal.DaemonThreadFactory;
1516
import io.opentelemetry.sdk.metrics.InstrumentType;
1617
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
1718
import io.opentelemetry.sdk.metrics.export.CollectionRegistration;
@@ -75,7 +76,8 @@ public static PrometheusHttpServerBuilder builder() {
7576
// we configure prometheus with a single thread executor such that requests are handled
7677
// sequentially.
7778
if (memoryMode == MemoryMode.REUSABLE_DATA) {
78-
executor = Executors.newSingleThreadExecutor();
79+
executor =
80+
Executors.newSingleThreadExecutor(new DaemonThreadFactory("prometheus-http-server"));
7981
}
8082
try {
8183
this.httpServer =

0 commit comments

Comments
 (0)