Section 5 · Capture your first generation

How the SDK queues and batches generations before it exports them, and the order the samples shut down in.

Estimated time: 1 min

Batching and why shutdown is last

The SDK sends generation data to the Agent Observability API in batches from a queue of generations waiting to be exported.

Queued generations inside the Agent Observability SDK (queueSize, default 2000), the batch the SDK flushes to the Agent Observability API (batchSize, default 100), and how often the SDK flushes queued generations (flushInterval, default 1s)

The batching defaults

  • batchSize, default 100: maximum generations per export batch.
  • flushInterval, default 1s: how often the SDK exports queued generations.
  • queueSize, default 2000: maximum number of queued generations before the SDK drops new ones.

Why shutdown is last

client.shutdown() in each sample shuts down the client after the capture. If your application also sets up OpenTelemetry tracing and metrics, shut those down after the client.