Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
module OpenTelemetry.Context.
ThreadLocal Thread-local contexts may be attached as implicit state at a per-Haskell-thread level. This module uses a fair amount of GHC internals to enable performing lookups of context for any threads that are alive. Caution should be taken for consumers of this module to not retain ThreadId references indefinitely, as that could delay cleanup of thread-local state. Thread-local contexts have the following semantics:
- A value attached to a ThreadId will remain alive at least as long as the ThreadId.
- A value may be detached from a ThreadId via detach by the library consumer without detriment.
- No guarantees are made about when a value will be garbage-collected once all references to ThreadId have been dropped. However, this simply means in practice that any unused contexts will cleaned up upon the next garbage collection and may not be actively freed when the program exits.
adjustContextOnThread :: MonadIO m => ThreadId -> (Context -> Context) -> m ()hs-opentelemetry-api OpenTelemetry.Context.ThreadLocal Alter the context If there is not a context associated with the provided thread, the function will be applied to an empty context and the result will be stored
attachContextOnThread :: MonadIO m => ThreadId -> Context -> m (Maybe Context)hs-opentelemetry-api OpenTelemetry.Context.ThreadLocal Store a given Context for the provided ThreadId, returning any context previously stored.
detachContextFromThread :: MonadIO m => ThreadId -> m (Maybe Context)hs-opentelemetry-api OpenTelemetry.Context.ThreadLocal Remove a stored Context for the provided ThreadId, returning any context previously stored. The detach functions don't generally need to be called manually, because finalizers will automatically clean up contexts when a thread has completed and been garbage collected. If you are replacing a context on a long-lived thread by detaching and attaching, use `adjustContext (const newContext)` instead to avoid registering additional finalizer functions to be called on thread exit.
lookupContextOnThread :: MonadIO m => ThreadId -> m (Maybe Context)hs-opentelemetry-api OpenTelemetry.Context.ThreadLocal Retrieve a stored Context for the provided ThreadId, if it exists.
threadContextMap :: ThreadContextMaphs-opentelemetry-api OpenTelemetry.Context.ThreadLocal This is a global variable that is used to store the thread-local context map. It is not intended to be used directly for production purposes, but is exposed for debugging purposes.
class IsReadableLogRecord r =>
IsReadWriteLogRecord rhs-opentelemetry-api OpenTelemetry.Internal.Logs.Types This is a typeclass representing LogRecords that can be read from or written to. All ReadWriteLogRecords are ReadableLogRecords. A function receiving this as an argument MUST additionally be able to modify the following information added to the LogRecord:
- Timestamp
- ObservedTimestamp
- SeverityText
- SeverityNumber
- Body
- Attributes (addition, modification, removal)
- TraceId
- SpanId
- TraceFlags
-
hs-opentelemetry-api OpenTelemetry.Internal.Logs.Types This is a typeclass representing LogRecords that can be read from. A function receiving this as an argument MUST be able to access all the information added to the LogRecord. It MUST also be able to access the Instrumentation Scope and Resource information (implicitly) associated with the LogRecord. The trace context fields MUST be populated from the resolved Context (either the explicitly passed Context or the current Context) when emitted. Counts for attributes due to collection limits MUST be available for exporters to report as described in the transformation to non-OTLP formats specification.
mkReadWriteLogRecord :: Logger -> ImmutableLogRecord -> IO ReadWriteLogRecordhs-opentelemetry-api OpenTelemetry.Internal.Logs.Types No documentation available.
mkReadableLogRecord :: ReadWriteLogRecord -> ReadableLogRecordhs-opentelemetry-api OpenTelemetry.Internal.Logs.Types No documentation available.