ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Telemetry.Tracing

Description

The request-lifecycle tracing layer over the OpenTelemetry substrate (Ecluse.Runtime.Telemetry): the WAI server span, the data plane's http-client child spans, and the hand-added domain spans. Every entry point takes the Telemetry handle and is inert when telemetry is off, so the middleware is id, an exchange opens untraced, and a domain-span bracket runs its body against no span. The data-plane client span records no request or response header and the WAI instrumentation never records Authorization, so a forwarded client token never reaches a span, while the high-cardinality package, version, and denial message deliberately do.

Synopsis

WAI server span

telemetryWaiMiddleware :: Telemetry -> IO Middleware Source #

The WAI server-span middleware, or id without telemetry. It belongs outermost, so the span covers the request.

The data plane's client spans

dataPlaneTrace :: Telemetry -> IO TraceExchange Source #

Open each upstream exchange under one client span that carries W3C trace-context headers, when telemetry is enabled. The span comes from the global tracer provider, which the library reads.

Domain spans

The core tracing ports

tracingPortOf :: Telemetry -> TracingPort Source #

Project this module's serve-path spans onto the core TracingPort the pipeline brackets with.

workerTracingPortOf :: Telemetry -> WorkerTracingPort Source #

Project withMirrorJobSpan onto the core WorkerTracingPort that Ecluse.Core.Worker uses.

advisorySyncTracingPortOf :: Telemetry -> AdvisorySyncTracingPort Source #

Project withAdvisorySyncSpan onto the AdvisorySyncTracingPort Ecluse.Runtime.Cve.Sync brackets through. Inert when telemetry is disabled.