Skip to content

Connectum API Reference / @connectum/otel / getBatchSpanProcessorOptions

Function: getBatchSpanProcessorOptions() ​

getBatchSpanProcessorOptions(): BatchSpanProcessorOptions

Defined in: config.ts:311

Gets batch span processor options from environment variables

Environment variables:

  • OTEL_BSP_MAX_EXPORT_BATCH_SIZE: Max number of spans to export in a single batch (default: 100)
  • OTEL_BSP_MAX_QUEUE_SIZE: Max queue size - if reached, new spans are dropped (default: 1000)
  • OTEL_BSP_SCHEDULE_DELAY: Time to wait before automatically exporting spans in ms (default: 1000)
  • OTEL_BSP_EXPORT_TIMEOUT: Max time allowed for a single export operation in ms (default: 10000)

A value that is not an integer, or is negative, is ignored with a process warning and the default is used, as the OpenTelemetry specification asks for invalid numeric variables. OTEL_BSP_MAX_EXPORT_BATCH_SIZE and OTEL_BSP_MAX_QUEUE_SIZE must also be at least 1: a queue of size 0 drops every span without a trace, and a batch of size 0 makes the span processor allocate until the process runs out of memory (both measured with @opentelemetry/sdk-trace-node), so 0 is treated as invalid for them. The two durations accept 0. The provider is created lazily on the first traced call, so throwing here would fail that user call.

Returns ​

BatchSpanProcessorOptions

Batch span processor options