Copyright | Copyright 2024 Shea Levy. |
---|---|
License | Apache-2.0 |
Maintainer | shea@shealevy.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data TracerEventBackend selector = TracerEventBackend {
- tracer :: !Tracer
- render :: !(RenderOTel selector)
- type RenderOTel selector = forall field. Selectors selector field -> OTelRendered field
- data OTelRendered field = OTelRendered {}
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 finalize
ing 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
Attribute
s or fall back to a full span if any are specified.
Event Link
s 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 recordException
ed without any custom attributes. In the future, an Exception -> HashMap Text Attribute
argument could be added, or arbitrary exception metadata added to finalizeEvent
.
TracerEventBackend | |
|
Instances
type RenderOTel selector = forall field. Selectors selector field -> OTelRendered field Source #
data OTelRendered field Source #
OTelRendered | |
|