package opentelemetry

  1. Overview
  2. Docs
Core library for instrumentation and serialization for https://opentelemetry.io

Install

dune-project
 Dependency

Authors

Maintainers

Sources

opentelemetry-0.90.tbz
sha256=c3989bb678f57e5276209d3c60afb29cdca33122288de55e591fbbe2e50a662c
sha512=ba8339256c9b2d8c99c8304991a3047f280a01e492add4cf82bf1d43dfa51e790366c09c6901c0501b8b8e1f810c6e128e33dd33542d785013407f642ade4eea

doc/opentelemetry.core/Opentelemetry_core/Span/index.html

Module Opentelemetry_core.SpanSource

Spans.

A Span is the workhorse of traces, it indicates an operation that took place over a given span of time (indicated by start_time and end_time) as part of a hierarchical trace. All spans in a given trace are bound by the use of the same Trace_id.t.

Sourcetype id = Span_id.t
Sourcetype kind = Span_kind.t =
  1. | Span_kind_unspecified
  2. | Span_kind_internal
  3. | Span_kind_server
  4. | Span_kind_client
  5. | Span_kind_producer
  6. | Span_kind_consumer
Sourcetype key_value = Key_value.t
Sourceval pp : Format.formatter -> t -> unit
Sourceval make : ?kind:kind -> ?trace_state:string -> ?attrs:key_value list -> ?events:Event.t list -> ?status:Opentelemetry_core.Common_.Proto.Trace.status -> trace_id:Trace_id.t -> id:Span_id.t -> ?parent:id -> ?links:Span_link.t list -> start_time:Timestamp_ns.t -> end_time:Timestamp_ns.t -> string -> t

make ~trace_id ~id name creates a new span

  • parameter trace_id

    the trace this belongs to

  • parameter parent

    parent span, if any

  • parameter links

    list of links to other spans, each with their trace state (see w3.org)

Sourceval id : t -> Span_id.t
Sourceval trace_id : t -> Trace_id.t
Sourceval is_not_dummy : t -> bool
Sourceval dummy : t

Dummy span, will not record anything

Sourceval create_new : ?kind:kind -> ?id:Span_id.t -> ?trace_state:string -> ?attrs:key_value list -> ?events:Event.t list -> ?status:Opentelemetry_core.Common_.Proto.Trace.status -> trace_id:Trace_id.t -> ?parent:id -> ?links:Span_link.t list -> start_time:Timestamp_ns.t -> end_time:Timestamp_ns.t -> string -> t
Sourceval attrs : t -> Key_value.t list
Sourceval events : t -> Event.t list
Sourceval status : t -> Span_status.t option
Sourceval kind : t -> Span_kind.t option

Turn the scope into a span link

Sourceval to_span_ctx : t -> Span_ctx.t

Turn the scope into a span context

Sourceval add_event : t -> Event.t -> unit
Sourceval add_event' : t -> (unit -> 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 record_exception : t -> exn -> Printexc.raw_backtrace -> unit

Record an exception occurring inside the span. This creates a span event and also sets the span status to error.

Sourceval add_links' : t -> (unit -> Span_link.t list) -> unit

Add links to the scope. It will be aggregated into the span.

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

Sourceval add_attrs : t -> Key_value.t list -> unit
Sourceval add_attrs' : t -> (unit -> Key_value.t list) -> unit
Sourceval set_status : t -> Span_status.t -> unit

set the span status.

Note that this function will be called only if there is an instrumentation backend.

Sourceval set_kind : t -> Span_kind.t -> unit

Set the span's kind.

  • since 0.11
Sourceval default_kind : Span_kind.t ref

Default span kind in make and create_new.

This will be used in all spans that do not specify ~kind explicitly; it is set to "internal", following directions from the .proto file. It can be convenient to set "client" or "server" uniformly in here.

Sourceval k_ambient : t Context.key

Context key to carry around a Span.t in ambient context.

  • since 0.90