Skip to main content

Module exporter

Module exporter 

Source
Expand description

Exporters: where finished spans go.

Span::finish hands the span to every registered Exporter whose Exporter::sample accepts it. None discards spans, Stdout writes JSON lines, Pretty writes colourful multi-line output for a terminal, and Sentry reports errors to Sentry.

PHP: the classes of Utopia\Span\Exporter.

Structs§

HttpTransport
Sends envelopes over HTTP/1.1 (TLS with the WebPKI roots) in the background: on the current runtime, or on a thread of its own outside one. Failures are written to standard error. The whole exchange times out after one second, the connection after half a second.
None
Discards every span: Exporter::sample is always false.
Pretty
Writes each span as a coloured block for local development: a header (action, duration, short trace id), the attributes other than span.* aligned in a column with level first, the error with at most max_trace_frames stack frames, and a separator line width wide. Spans with an error go to standard error, the others to standard output.
Request
An HTTP request to Sentry’s envelope endpoint.
Sentry
Reports spans at warning level or above that carry an error as Sentry issues.
Stdout
Writes each span as one line of JSON (NDJSON): level and action first, then every attribute, then the error (error.type, error.message, error.code, error.file, error.line, error.trace with at most max_trace_frames frames, error.trace_truncated). Spans with an error go to standard error, the others to standard output.

Enums§

SentryField
Where a span attribute goes in a Sentry event.
SentryLevel
The levels of Sentry’s event API.

Traits§

Exporter
Receives finished spans.
Transport
Sends envelopes to Sentry.

Type Aliases§

Sampler
Decides whether an exporter exports a span.