What
SimpleSpanProcessor exposes both a create(SpanExporter) static factory and a builder(SpanExporter), but BatchSpanProcessor exposes only builder(SpanExporter) — there is no BatchSpanProcessor.create(SpanExporter). (Verified against opentelemetry-sdk-trace 1.61.0.)
| Processor |
create(exporter) |
builder(exporter) |
SimpleSpanProcessor |
✅ |
✅ |
BatchSpanProcessor |
❌ |
✅ |
Why it matters
The asymmetry is an easy trap: since SimpleSpanProcessor.create(exporter) compiles, it's natural to assume BatchSpanProcessor.create(exporter) does too — but it fails with cannot find symbol: method create(SpanExporter). We've hit this repeatedly (notably from LLM-assisted code, which over-generalizes the create() shortcut across the two processors). The correct form is BatchSpanProcessor.builder(exporter).build(), but the inconsistency costs a compile cycle each time.
Proposal
Add a BatchSpanProcessor.create(SpanExporter) convenience factory returning a default-configured processor (equivalent to builder(exporter).build()), mirroring SimpleSpanProcessor. Purely additive and backward-compatible; the builder stays for configuration.
Happy to open a PR if the team is open to it.
What
SimpleSpanProcessorexposes both acreate(SpanExporter)static factory and abuilder(SpanExporter), butBatchSpanProcessorexposes onlybuilder(SpanExporter)— there is noBatchSpanProcessor.create(SpanExporter). (Verified againstopentelemetry-sdk-trace1.61.0.)create(exporter)builder(exporter)SimpleSpanProcessorBatchSpanProcessorWhy it matters
The asymmetry is an easy trap: since
SimpleSpanProcessor.create(exporter)compiles, it's natural to assumeBatchSpanProcessor.create(exporter)does too — but it fails withcannot find symbol: method create(SpanExporter). We've hit this repeatedly (notably from LLM-assisted code, which over-generalizes thecreate()shortcut across the two processors). The correct form isBatchSpanProcessor.builder(exporter).build(), but the inconsistency costs a compile cycle each time.Proposal
Add a
BatchSpanProcessor.create(SpanExporter)convenience factory returning a default-configured processor (equivalent tobuilder(exporter).build()), mirroringSimpleSpanProcessor. Purely additive and backward-compatible; the builder stays for configuration.Happy to open a PR if the team is open to it.