| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Telemetry.ExportFailure.Internal
Contents
Description
The throttle and the sink behind Ecluse.Runtime.Telemetry.ExportFailure, which documents
the routing and re-exports the curated surface. Importing this module opts out of that stability
promise, the convention text and bytestring use, so production code imports the public one.
Synopsis
- data ThrottleState = ThrottleState {}
- data ThrottleEmit
- initialThrottle :: ThrottleState
- throttleStep :: NominalDiffTime -> UTCTime -> ThrottleState -> (ThrottleState, ThrottleEmit)
- data ExportFailureSink
- newExportFailureSink :: IO UTCTime -> (Severity -> Text -> IO ()) -> IO ExportFailureSink
- exportFailureSink :: LogEnv -> IO ExportFailureSink
- observeExportResult :: ExportFailureSink -> Text -> ExportResult -> IO ()
- installExportErrorHandler :: ExportFailureSink -> IO ()
The throttle (pure core)
data ThrottleState Source #
The throttle state for SDK export-error routing. Exposed so a test asserts the throttle decision without wall-clock timing.
Constructors
| ThrottleState | |
Fields
| |
Instances
| Show ThrottleState Source # | |
Defined in Ecluse.Runtime.Telemetry.ExportFailure.Internal Methods showsPrec :: Int -> ThrottleState -> ShowS # show :: ThrottleState -> String # showList :: [ThrottleState] -> ShowS # | |
| Eq ThrottleState Source # | |
Defined in Ecluse.Runtime.Telemetry.ExportFailure.Internal Methods (==) :: ThrottleState -> ThrottleState -> Bool # (/=) :: ThrottleState -> ThrottleState -> Bool # | |
data ThrottleEmit Source #
What throttleStep decided to do with an export error.
Constructors
| EmitFirst | The first error: surface it plainly. |
| EmitHeartbeat Int | The throttle window elapsed: surface a heartbeat carrying the count of errors since the last surfaced one (this one included). |
| EmitSuppress | Within the window: suppress and count. |
Instances
| Show ThrottleEmit Source # | |
Defined in Ecluse.Runtime.Telemetry.ExportFailure.Internal Methods showsPrec :: Int -> ThrottleEmit -> ShowS # show :: ThrottleEmit -> String # showList :: [ThrottleEmit] -> ShowS # | |
| Eq ThrottleEmit Source # | |
initialThrottle :: ThrottleState Source #
The initial throttle state: nothing logged, nothing suppressed.
throttleStep :: NominalDiffTime -> UTCTime -> ThrottleState -> (ThrottleState, ThrottleEmit) Source #
Advance the throttle for one export error at now: the first surfaces, a heartbeat once
interval has elapsed since the last surfaced error, and anything between is suppressed and counted.
Routing
data ExportFailureSink Source #
One throttle and one katip target shared by every export-failure feed. The clock and the
surfacing action are injected, so a test asserts the throttle decision without wall-clock timing.
newExportFailureSink :: IO UTCTime -> (Severity -> Text -> IO ()) -> IO ExportFailureSink Source #
Build an export-failure sink over an injected clock and surfacing action.
exportFailureSink :: LogEnv -> IO ExportFailureSink Source #
The production sink: the wall clock and the composition-root LogEnv as the katip target.
observeExportResult :: ExportFailureSink -> Text -> ExportResult -> IO () Source #
Observe one exporter's ExportResult, routing a Failure through the sink. signal names the
exporter (span / metric). hs-opentelemetry 1.0.0.0 drops a failed OTLP export, so only this feed reports one.
installExportErrorHandler :: ExportFailureSink -> IO () Source #
Install a process-global handler for the SDK's own diagnostic stream, forwarded verbatim. Ecluse
reads none of OTEL_EXPORTER_OTLP_HEADERS, DD_API_KEY, DD_SITE, so the SDK's own text is the only leak channel.