| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data TracingPort = TracingPort {
- spanRuleEval :: forall a. PackageName -> Version -> IO (a, ServeDecision) -> IO a
- spanMirrorEnqueue :: forall a. PackageName -> Version -> Text -> (a -> Maybe Text) -> (Maybe RemoteSpanContext -> IO a) -> IO a
- spanPackumentGate :: forall a. PackageName -> IO a -> IO a
- spanMetadataFetch :: forall a. PackageName -> IO a -> IO a
- spanMetadataDecode :: forall a. PackageName -> IO a -> IO a
- spanDirectoryFetch :: forall a. IO a -> IO a
- spanDirectoryDecode :: forall a. IO a -> IO a
- newtype WorkerTracingPort = WorkerTracingPort {
- wtpMirrorJobSpan :: forall a. PackageName -> Version -> Maybe RemoteSpanContext -> (a -> JobSpanOutcome) -> IO a -> IO a
- data JobSpanOutcome = JobSpanOutcome {}
- newtype AdvisorySyncTracingPort = AdvisorySyncTracingPort {
- astpSyncAttemptSpan :: forall a. Ecosystem -> (a -> (AdvisorySyncResult, Maybe OsvDbFetchFault)) -> IO a -> IO a
- ecluseScope :: IsString s => s
- withOptionalSpan :: MonadUnliftIO m => Maybe TracerProvider -> SpanKind -> Text -> (Maybe Span -> m a) -> m a
- openOptionalSpan :: MonadIO m => Maybe TracerProvider -> SpanKind -> Text -> m (Maybe Span)
- closeOptionalSpan :: MonadIO m => Maybe Span -> m ()
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
| |
Instances
| Show JobSpanOutcome Source # | |
Defined in Ecluse.Core.Telemetry.Span Methods showsPrec :: Int -> JobSpanOutcome -> ShowS # show :: JobSpanOutcome -> String # showList :: [JobSpanOutcome] -> ShowS # | |
| Eq JobSpanOutcome Source # | |
Defined in Ecluse.Core.Telemetry.Span Methods (==) :: JobSpanOutcome -> JobSpanOutcome -> Bool # (/=) :: JobSpanOutcome -> JobSpanOutcome -> Bool # | |
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.