Module Opentelemetry_lwt.TraceSource

include module type of struct include Opentelemetry.Trace end
Sourceval make_resource_spans : ?service_name:??? -> ?attrs:??? -> Opentelemetry.Proto.Trace.span list -> Opentelemetry.Proto.Trace.resource_spans
Sourceval emit : ?service_name:??? -> ?attrs:??? -> span list -> unit

Sync emitter

Sourcetype scope = Opentelemetry.Trace.scope = {
  1. trace_id : Opentelemetry.Trace_id.t;
  2. span_id : Opentelemetry.Span_id.t;
  3. mutable events : Opentelemetry.Event.t list;
  4. mutable attrs : Opentelemetry.Span.key_value list;
}

Scope to be used with with_.

Sourceval add_event : scope -> (unit -> Opentelemetry.Event.t) -> unit

Add an event to the scope. It will be aggregated into the span.

Note that this takes a function that produces an event, and will only call it if there is an instrumentation backend.

Sourceval add_attrs : scope -> (unit -> Opentelemetry.Span.key_value list) -> unit

Add an attr to the scope. It will be aggregated into the span.

Note that this takes a function that produces attributes, and will only call it if there is an instrumentation backend.

Sourceval with_ : ?trace_state:??? -> ?service_name:??? -> ?attrs:??? -> ?kind:??? -> ?trace_id:??? -> ?parent:??? -> ?scope:??? -> ?links:??? -> string -> (Opentelemetry.Trace.scope -> 'a Lwt.t) -> 'a Lwt.t

Sync span guard