e11y-otel-0.1.0.0: OpenTelemetry-based rendering for e11y
CopyrightCopyright 2024 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageGHC2021

Observe.Event.Backend.OpenTelemetry

Description

 
Synopsis

Documentation

data TracerEventBackend selector Source #

An EventBackend built on a Tracer.

When no explicit parent is set, the backend will try to find a parent in the OpenTelemetry.Context.ThreadLocal Context. However, it will never update that Context, as the primitive EventBackend API has no way to determine if it's being consumed in a scoped context or one allowing for general interleaving.

When possible, events created with instantEvent will use the span event API. However, this requires a parent event (explicitly specified or found in the thread-local Context), so the backend will fallback to creating and finalizeing a new Span. If a span event is created, the resulting eventReference will be to its parent, as span events cannot be parents/links. Span events do not allow for non-parent links, so any causes are dropped; in the future, we may either add them as custom Attributes or fall back to a full span if any are specified.

Event Links are currently not given any attributes. In the future, arbitrary link metadata could be added to the core EventBackend API, in which case we could add a renderer for the link metadata type.

The underlying Tracer is responsible for timestamping.

Exceptions are recordExceptioned without any custom attributes. In the future, an Exception -> HashMap Text Attribute argument could be added, or arbitrary exception metadata added to finalizeEvent.

Constructors

TracerEventBackend 

Fields

Instances

Instances details
(MonadIO m, ParametricFunctor m) => EventBackendIn m (TracerEventBackend selector) Source # 
Instance details

Defined in Observe.Event.Backend.OpenTelemetry

EventBackend (TracerEventBackend selector) Source # 
Instance details

Defined in Observe.Event.Backend.OpenTelemetry

Associated Types

type BackendEvent (TracerEventBackend selector) :: Type -> Type #

type RootSelector (TracerEventBackend selector) :: Type -> Type #

type BackendEvent (TracerEventBackend selector) Source # 
Instance details

Defined in Observe.Event.Backend.OpenTelemetry

type RootSelector (TracerEventBackend selector) Source # 
Instance details

Defined in Observe.Event.Backend.OpenTelemetry

type RootSelector (TracerEventBackend selector) = selector

type RenderOTel selector = forall field. Selectors selector field -> OTelRendered field Source #

The domain-specific logic for translating Events rooted in a given selector.

data OTelRendered field Source #

The domain-specific logic for translating a specific Event with a given field type.

Constructors

OTelRendered 

Fields