ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Telemetry.Span

Description

The domain-span tracing ports, and the bracket Pilot opens its own spans through.

The serve path, the mirror worker, and the advisory sync task reach their spans through a port: bracket operations naming no OpenTelemetry tracer, so the application supplies the OTel-backed implementations and a test a pass-through double. Pilot's passes hold the TracerProvider themselves and bracket through withOptionalSpan. Both create their tracer under ecluseScope.

Synopsis

The serve-path tracing port

data TracingPort Source #

The serve path's tracing port. The implementation is inert when tracing is off, so a call site brackets unconditionally.

Constructors

TracingPort 

Fields

The worker tracing port

newtype WorkerTracingPort Source #

The mirror worker's tracing port, inert when tracing is off, so the worker brackets unconditionally.

Constructors

WorkerTracingPort 

Fields

data JobSpanOutcome Source #

The outcome a caller projects for the mirror-job span, its own record so the port does not depend on the worker loop.

Constructors

JobSpanOutcome 

Fields

The advisory sync tracing port

newtype AdvisorySyncTracingPort Source #

One span per advisory sync attempt, labelled with the AdvisorySyncResult of the attempt metrics, so a trace and a series join.

Constructors

AdvisorySyncTracingPort 

Fields

Bracketing a span against an optional tracer

ecluseScope :: IsString s => s Source #

The instrumentation scope of the hand-added spans and the WAI meter, so the signals are attributed to Écluse.

withOptionalSpan :: MonadUnliftIO m => Maybe TracerProvider -> SpanKind -> Text -> (Maybe Span -> m a) -> m a Source #

Run body against a span on mTracerProvider, or against Nothing without one. The span roots its own trace.

openOptionalSpan :: MonadIO m => Maybe TracerProvider -> SpanKind -> Text -> m (Maybe Span) Source #

The acquire half of withOptionalSpan, for a conduit pass that brackets through bracketP rather than bracket.

closeOptionalSpan :: MonadIO m => Maybe Span -> m () Source #

The release half of withOptionalSpan. Ending at the current instant, as Nothing asks.