Skip to main content

Signature

Parameters

None.

Example

Behavior

When called, flush():
  1. Takes all spans from the internal queue
  2. Groups them by trace ID
  3. Sends them to the collector immediately
  4. Does not wait for the batch size or flush interval

Use Cases

Debugging: Force traces to appear in your dashboard immediately.
Before exit: Ensure all traces are sent before the process exits.
Manual control: Disable automatic flushing and control timing.

Thread Safety

flush() is thread-safe and can be called from any thread.

See Also