BatchSpanProcessor does not trigger export timeout
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- observability-sre
Research direction
Start with BatchSpanProcessor and the otel.bsp.export.timeout setting, then trace how the SpanExporter.export CompletableResultCode is handled. Reproduce the delayed CustomSpanExporter case and compare the observed behavior with the expected 30-second export timeout. Done means the timeout behavior is understood and the reported discrepancy is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Description
Describe the bug
Despite the introduction of a delay that is longer than the timeout on both the exporter (using a wrapper class) and my custom-built collector, the export timeout does not affect the export call.
Steps to reproduce
This was the setup I used to test the timeout on the exporter.
@Bean
public OpenTelemetrySdk autoconfiguredSdk() {
return AutoConfiguredOpenTelemetrySdk.builder()
.addPropertiesSupplier(() -> properties)
.addSpanExporterCustomizer((spanExporter, configProperties) -> new CustomSpanExporter(spanExporter))
.setResultAsGlobal()
.build()
.getOpenTelemetrySdk();
}
@AllArgsConstructor
public class CustomSpanExporter implements SpanExporter {
private final SpanExporter delegate;
@Override
public CompletableResultCode export(Collection<SpanData> spans) {
try {
Thread.sleep(35000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Sleep interrupted", e);
}
return delegate.export(spans);
}
@Override
public CompletableResultCode flush() {
return delegate.flush();
}
@Override
public CompletableResultCode shutdown() {
return delegate.shutdown();
}
@Override
public void close() {
delegate.close();
}
}
The setup for the collector involves creating a collector server (in my case, a gRPC one) with a timeout immediately after receiving the request.
Although otel.exporter.otlp.timeout, by default, is 10 seconds (lower than otel.bsp.export.timeout's default), meaning the HTTP request times out before the exporter does, I have tested with a lower export timeout, in which case the request finalises normally.
What did you expect to see?
I expected to have my export interrupted after the value set for otel.bsp.export.timeout (by default, 30 seconds).
What did you see instead?
Instead, the export progressed as normal.
What version and what artifacts are you using?
io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:jar:2.13.1
io.opentelemetry:opentelemetry-sdk:jar:1.47.0
My pom.xml:
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
</dependency>
Environment
Oracle Linux Server 8.9
openjdk version "17.0.14" 2025-01-21 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.14.0.7-3.0.1) (build 17.0.14+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.14.0.7-3.0.1) (build 17.0.14+7-LTS, mixed mode, sharing)
Additional context
If this is the expected behaviour, any help on how to test this property would be appreciated.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1.1k
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 41
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-java
-
`B3PropagatorExtractorMultipleHeaders` allocates when headers are missingPossibly taken @Eliot5566 claimed this today. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-java#9065 ·
Maintainers usually reply within 3 days
-
[incubator] ComposableProbabilitySampler does not validate ratio rangePossibly taken @eminfikret claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#9046 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
PrometheusComponentProvider promotes all resource attributes when resource_constant_labels is empty ({})Possibly taken @rooks-ns claimed this 19 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-java#9014 · 1 comment ·
Maintainers usually reply within 3 days
-
Fix `otel.sdk.log.created` counting semanticsPossibly taken @anuraaga claimed this 112 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#8688 ·
Maintainers usually reply within 3 days
-
SdkSpanBuilder drops invalid parent TraceState when IdGenerator.generatesRandomTraceIds() is truePossibly taken @Eliot5566 claimed this today. OpenBug SDK
Difficulty 4/5 3-5 days Newbie friendliness 48/100
open-telemetry/opentelemetry-java#9062 · 1 comment ·
Maintainers usually reply within 3 days
All issues in open-telemetry/opentelemetry-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainers usually reply within 1 day
-
Mend: dependency security vulnerability untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
opensearch-project/cross-cluster-replication#1805 ·
Maintainers usually reply within 1 day
-
feature request needs triage
Difficulty 1/5 Under an hour Newbie friendliness 66/100
TeamNewPipe/NewPipe#14083 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
PCL-Community/PCL-CE#3907 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 2 days