diff --git a/dev/opentelemetry-client-ocurl/Opentelemetry_client_ocurl/index.html b/dev/opentelemetry-client-ocurl/Opentelemetry_client_ocurl/index.html index a95083f6..3b5b9b89 100644 --- a/dev/opentelemetry-client-ocurl/Opentelemetry_client_ocurl/index.html +++ b/dev/opentelemetry-client-ocurl/Opentelemetry_client_ocurl/index.html @@ -1,5 +1,9 @@ -Opentelemetry_client_ocurl (opentelemetry-client-ocurl.Opentelemetry_client_ocurl)

Module Opentelemetry_client_ocurl

val get_url : unit -> string
val set_url : string -> unit

Url of the endpoint. Default is "http://localhost:4318", or "OTEL_EXPORTER_OTLP_ENDPOINT" if set.

val get_headers : unit -> (string * string) list
val set_headers : (string * string) list -> unit

Set http headers that are sent on every http query to the collector.

module Config : sig ... end

Configuration for the ocurl backend

val setup : +Opentelemetry_client_ocurl (opentelemetry-client-ocurl.Opentelemetry_client_ocurl)

Module Opentelemetry_client_ocurl

val get_url : unit -> string
val set_url : string -> unit

Url of the endpoint. Default is "http://localhost:4318", or "OTEL_EXPORTER_OTLP_ENDPOINT" if set.

val get_headers : unit -> (string * string) list
val set_headers : (string * string) list -> unit

Set http headers that are sent on every http query to the collector.

module Config : sig ... end

Configuration for the ocurl backend

val create_backend : + ?stop:bool Atomic.t -> + ?config:Config.t -> + unit -> + (module Opentelemetry.Collector.BACKEND)
val setup : ?stop:bool Atomic.t -> ?config:Config.t -> ?enable:bool -> diff --git a/dev/opentelemetry-lwt/Opentelemetry_lwt/Logs/index.html b/dev/opentelemetry-lwt/Opentelemetry_lwt/Logs/index.html index e2ba503b..9583c66d 100644 --- a/dev/opentelemetry-lwt/Opentelemetry_lwt/Logs/index.html +++ b/dev/opentelemetry-lwt/Opentelemetry_lwt/Logs/index.html @@ -99,7 +99,12 @@ 'a

Make a log entry with format

val emit : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> unit

Emit logs.

This instructs the collector to send the logs to some backend at a later date. NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

\ No newline at end of file diff --git a/dev/opentelemetry-lwt/Opentelemetry_lwt/Metrics/index.html b/dev/opentelemetry-lwt/Opentelemetry_lwt/Metrics/index.html index e8023cae..d0155e1b 100644 --- a/dev/opentelemetry-lwt/Opentelemetry_lwt/Metrics/index.html +++ b/dev/opentelemetry-lwt/Opentelemetry_lwt/Metrics/index.html @@ -3,14 +3,24 @@ ?start_time_unix_nano:Opentelemetry.Timestamp_ns.t -> ?now:Opentelemetry.Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> float -> Opentelemetry__.Metrics_types.number_data_point

Number data point, as a float

val int : ?start_time_unix_nano:Opentelemetry.Timestamp_ns.t -> ?now:Opentelemetry.Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> int -> Opentelemetry__.Metrics_types.number_data_point

Number data point, as an int

val gauge : @@ -29,7 +39,12 @@ ?start_time_unix_nano:Opentelemetry.Timestamp_ns.t -> ?now:Opentelemetry.Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> ?exemplars:Opentelemetry__.Metrics_types.exemplar list -> ?explicit_bounds:float list -> @@ -47,12 +62,22 @@ t
val make_resource_metrics : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> Opentelemetry__.Metrics_types.resource_metrics

Aggregate metrics into a Proto.Metrics.resource_metrics

val emit : ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> unit

Emit some metrics to the collector (sync). This blocks until the backend has pushed the metrics into some internal queue, or discarded them.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

\ No newline at end of file diff --git a/dev/opentelemetry-lwt/Opentelemetry_lwt/Trace/index.html b/dev/opentelemetry-lwt/Opentelemetry_lwt/Trace/index.html index e67c5301..0138b5db 100644 --- a/dev/opentelemetry-lwt/Opentelemetry_lwt/Trace/index.html +++ b/dev/opentelemetry-lwt/Opentelemetry_lwt/Trace/index.html @@ -2,13 +2,23 @@ Trace (opentelemetry-lwt.Opentelemetry_lwt.Trace)

Module Opentelemetry_lwt.Trace

include module type of struct include Opentelemetry.Trace end

Traces.

See the spec

val make_resource_spans : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> Opentelemetry.Proto.Trace.span list -> Opentelemetry.Proto.Trace.resource_spans
val emit : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> span list -> unit

Sync emitter.

This instructs the collector to forward the spans to some backend at a later point.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

type scope = Opentelemetry.Scope.t = {
  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;
}
  • deprecated use Scope.t
val add_event : @@ -17,14 +27,27 @@ unit
  • deprecated use Scope.add_event
val add_attrs : Opentelemetry.Scope.t -> (unit -> Opentelemetry.key_value list) -> - unit
  • deprecated use Scope.add_attrs
val with_ : + unit
  • deprecated use Scope.add_attrs
val with_' : + ?force_new_trace_id:bool -> ?trace_state:string -> ?service_name:string -> - ?attrs:Opentelemetry.Span.key_value list -> - ?kind:Span.kind -> - ?trace_id:Trace_id.t -> - ?parent:Span.id -> - ?scope:scope -> + ?attrs:(string * Opentelemetry.value) list -> + ?kind:Opentelemetry.Span.kind -> + ?trace_id:Opentelemetry.Trace_id.t -> + ?parent:Opentelemetry.Span.id -> + ?scope:Opentelemetry.Scope.t -> + ?links:Opentelemetry.Span_link.t list -> + string -> + (scope -> 'a) -> + (unit -> 'a) * ((unit, string) Stdlib.result -> unit)

Sync span guard.

Notably, this includes implicit scope-tracking: if called without a ~scope argument (or ~parent/~trace_id), it will check in the Ambient_context for a surrounding environment, and use that as the scope. Similarly, it uses Scope.with_ambient_scope to set a new scope in the ambient context, so that any logically-nested calls to with_ will use this span as their parent.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

val with_ : + ?force_new_trace_id:bool -> + ?trace_state:string -> + ?service_name:string -> + ?attrs:(string * Opentelemetry.value) list -> + ?kind:Opentelemetry.Span.kind -> + ?trace_id:Opentelemetry.Trace_id.t -> + ?parent:Opentelemetry.Span.id -> + ?scope:Opentelemetry.Scope.t -> ?links:Opentelemetry.Span_link.t list -> string -> (Opentelemetry.Scope.t -> 'a Lwt.t) -> diff --git a/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/argument-1-B/index.html b/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/argument-1-B/index.html new file mode 100644 index 00000000..b97bb9ea --- /dev/null +++ b/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/argument-1-B/index.html @@ -0,0 +1,2 @@ + +B (opentelemetry.Opentelemetry.Collector.Debug_backend.B)

Parameter Debug_backend.B

val send_trace : Proto.Trace.resource_spans list sender
val send_metrics : Proto.Metrics.resource_metrics list sender
val send_logs : Proto.Logs.resource_logs list sender
val signal_emit_gc_metrics : unit -> unit

Signal the backend that it should emit GC metrics when it has the chance. This should be installed in a GC alarm or another form of regular trigger.

val tick : unit -> unit

Should be called regularly for background processing, timeout checks, etc.

val set_on_tick_callbacks : (unit -> unit) list Stdlib.ref -> unit

Give the collector the list of callbacks to be executed when tick() is called. Each such callback should be short and reentrant. Depending on the collector's implementation, it might be called from a thread that is not the one that called on_tick.

val cleanup : unit -> unit
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/index.html b/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/index.html new file mode 100644 index 00000000..33517044 --- /dev/null +++ b/dev/opentelemetry/Opentelemetry/Collector/Debug_backend/index.html @@ -0,0 +1,2 @@ + +Debug_backend (opentelemetry.Opentelemetry.Collector.Debug_backend)

Module Collector.Debug_backend

Parameters

module B : BACKEND

Signature

val send_trace : Proto.Trace.resource_spans list sender
val send_metrics : Proto.Metrics.resource_metrics list sender
val send_logs : Proto.Logs.resource_logs list sender
val signal_emit_gc_metrics : unit -> unit

Signal the backend that it should emit GC metrics when it has the chance. This should be installed in a GC alarm or another form of regular trigger.

val tick : unit -> unit

Should be called regularly for background processing, timeout checks, etc.

val set_on_tick_callbacks : (unit -> unit) list Stdlib.ref -> unit

Give the collector the list of callbacks to be executed when tick() is called. Each such callback should be short and reentrant. Depending on the collector's implementation, it might be called from a thread that is not the one that called on_tick.

val cleanup : unit -> unit
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Collector/Noop_backend/index.html b/dev/opentelemetry/Opentelemetry/Collector/Noop_backend/index.html new file mode 100644 index 00000000..cf4544ed --- /dev/null +++ b/dev/opentelemetry/Opentelemetry/Collector/Noop_backend/index.html @@ -0,0 +1,2 @@ + +Noop_backend (opentelemetry.Opentelemetry.Collector.Noop_backend)

Module Collector.Noop_backend

val send_trace : Proto.Trace.resource_spans list sender
val send_metrics : Proto.Metrics.resource_metrics list sender
val send_logs : Proto.Logs.resource_logs list sender
val signal_emit_gc_metrics : unit -> unit

Signal the backend that it should emit GC metrics when it has the chance. This should be installed in a GC alarm or another form of regular trigger.

val tick : unit -> unit

Should be called regularly for background processing, timeout checks, etc.

val set_on_tick_callbacks : (unit -> unit) list Stdlib.ref -> unit

Give the collector the list of callbacks to be executed when tick() is called. Each such callback should be short and reentrant. Depending on the collector's implementation, it might be called from a thread that is not the one that called on_tick.

val cleanup : unit -> unit
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Collector/index.html b/dev/opentelemetry/Opentelemetry/Collector/index.html index 9b03892f..08a7ce92 100644 --- a/dev/opentelemetry/Opentelemetry/Collector/index.html +++ b/dev/opentelemetry/Opentelemetry/Collector/index.html @@ -1,5 +1,10 @@ -Collector (opentelemetry.Opentelemetry.Collector)

Module Opentelemetry.Collector

Collector types

These types are used by backend implementations, to send events to collectors such as Jaeger.

Note: most users will not need to touch this module

type 'msg sender = {
  1. send : 'a. 'msg -> ret:(unit -> 'a) -> 'a;
}

Sender interface for a message of type msg. Inspired from Logs' reporter (see its doc) but without over as it doesn't make much sense in presence of batching.

The ret callback is used to return the desired type (unit, or a Lwt promise, or anything else) once the event has been transferred to the backend. It doesn't mean the event has been collected yet, it could sit in a batch queue for a little while.

module type BACKEND = sig ... end

Collector client interface.

type backend = (module BACKEND)
val set_backend : backend -> unit

Set collector backend

val has_backend : unit -> bool

Is there a configured backend?

val get_backend : unit -> backend option

Current backend, if any

val send_trace : Proto.Trace.resource_spans list -> ret:(unit -> 'a) -> 'a
val send_metrics : +Collector (opentelemetry.Opentelemetry.Collector)

Module Opentelemetry.Collector

Collector types

These types are used by backend implementations, to send events to collectors such as Jaeger.

Note: most users will not need to touch this module

type 'msg sender = {
  1. send : 'a. 'msg -> ret:(unit -> 'a) -> 'a;
}

Sender interface for a message of type msg. Inspired from Logs' reporter (see its doc) but without over as it doesn't make much sense in presence of batching.

The ret callback is used to return the desired type (unit, or a Lwt promise, or anything else) once the event has been transferred to the backend. It doesn't mean the event has been collected yet, it could sit in a batch queue for a little while.

module type BACKEND = sig ... end

Collector client interface.

type backend = (module BACKEND)
val debug_backend : backend
val set_backend : backend -> unit

Set collector backend

val has_backend : unit -> bool

Is there a configured backend?

val get_backend : unit -> backend option

Current backend, if any

val send_trace : Proto.Trace.resource_spans list -> ret:(unit -> 'a) -> 'a
val send_metrics : Proto.Metrics.resource_metrics list -> ret:(unit -> 'a) -> - 'a
val send_logs : Proto.Logs.resource_logs list -> ret:(unit -> 'a) -> 'a
val rand_bytes_16 : unit -> bytes
val rand_bytes_8 : unit -> bytes
val on_tick : (unit -> unit) -> unit
val tick : unit -> unit

Do background work. Call this regularly if the collector doesn't already have a ticker thread or internal timer.

\ No newline at end of file + 'a
val send_logs : Proto.Logs.resource_logs list -> ret:(unit -> 'a) -> 'a
val rand_bytes_16 : unit -> bytes
val rand_bytes_8 : unit -> bytes
val on_tick : (unit -> unit) -> unit
val tick : unit -> unit

Do background work. Call this regularly if the collector doesn't already have a ticker thread or internal timer.

val with_setup_debug_backend : + backend -> + ?enable:bool -> + unit -> + (unit -> 'a) -> + 'a
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Globals/index.html b/dev/opentelemetry/Opentelemetry/Globals/index.html index 7230c133..9b77a5c9 100644 --- a/dev/opentelemetry/Opentelemetry/Globals/index.html +++ b/dev/opentelemetry/Opentelemetry/Globals/index.html @@ -4,7 +4,12 @@ Proto.Common.key_value list
val default_span_kind : Proto.Trace.span_span_kind Stdlib.ref

Default span kind in Span.create. 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.

val mk_attributes : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> unit -> Proto.Common.key_value list
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Logs/index.html b/dev/opentelemetry/Opentelemetry/Logs/index.html index 58934d5a..a76c5a5e 100644 --- a/dev/opentelemetry/Opentelemetry/Logs/index.html +++ b/dev/opentelemetry/Opentelemetry/Logs/index.html @@ -35,7 +35,12 @@ 'a

Make a log entry with format

val emit : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> unit

Emit logs.

This instructs the collector to send the logs to some backend at a later date. NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Metrics/index.html b/dev/opentelemetry/Opentelemetry/Metrics/index.html index 75035c9e..7c1bd3e0 100644 --- a/dev/opentelemetry/Opentelemetry/Metrics/index.html +++ b/dev/opentelemetry/Opentelemetry/Metrics/index.html @@ -3,14 +3,24 @@ ?start_time_unix_nano:Timestamp_ns.t -> ?now:Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> float -> Opentelemetry__.Metrics_types.number_data_point

Number data point, as a float

val int : ?start_time_unix_nano:Timestamp_ns.t -> ?now:Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> int -> Opentelemetry__.Metrics_types.number_data_point

Number data point, as an int

val gauge : @@ -29,7 +39,12 @@ ?start_time_unix_nano:Timestamp_ns.t -> ?now:Timestamp_ns.t -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> ?exemplars:Opentelemetry__.Metrics_types.exemplar list -> ?explicit_bounds:float list -> @@ -47,12 +62,22 @@ t
val make_resource_metrics : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> Opentelemetry__.Metrics_types.resource_metrics

Aggregate metrics into a Proto.Metrics.resource_metrics

val emit : ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> t list -> unit

Emit some metrics to the collector (sync). This blocks until the backend has pushed the metrics into some internal queue, or discarded them.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Scope/index.html b/dev/opentelemetry/Opentelemetry/Scope/index.html index d49b3a3c..bd510824 100644 --- a/dev/opentelemetry/Opentelemetry/Scope/index.html +++ b/dev/opentelemetry/Opentelemetry/Scope/index.html @@ -1,2 +1,2 @@ -Scope (opentelemetry.Opentelemetry.Scope)

Module Opentelemetry.Scope

Scopes.

A scope is a trace ID and the span ID of the currently active span.

type t = {
  1. trace_id : Trace_id.t;
  2. span_id : Span_id.t;
  3. mutable events : Event.t list;
  4. mutable attrs : key_value list;
}
val 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.

val add_attrs : t -> (unit -> 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.

val get_surrounding : ?scope:t -> unit -> t option

Obtain current scope from thread-local storage, if available

val with_scope : t -> (unit -> 'a) -> 'a

with_scope sc f calls f() in a context where sc is the (thread)-local scope, then reverts to the previous local scope, if any.

\ No newline at end of file +Scope (opentelemetry.Opentelemetry.Scope)

Module Opentelemetry.Scope

Scopes.

A scope is a trace ID and the span ID of the currently active span.

type t = {
  1. trace_id : Trace_id.t;
  2. span_id : Span_id.t;
  3. mutable events : Event.t list;
  4. mutable attrs : key_value list;
}
val 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.

val add_attrs : t -> (unit -> 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.

val ambient_scope_key : t Ambient_context.key

The opaque key necessary to access/set the ambient scope with Ambient_context.

val get_ambient_scope : ?scope:t -> unit -> t option

Obtain current scope from Ambient_context, if available.

val with_ambient_scope : t -> (unit -> 'a) -> 'a

with_ambient_scope sc thunk calls thunk() in a context where sc is the (thread|continuation)-local scope, then reverts to the previous local scope, if any.

\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Span/index.html b/dev/opentelemetry/Opentelemetry/Span/index.html index 056df5ff..d683fde3 100644 --- a/dev/opentelemetry/Opentelemetry/Span/index.html +++ b/dev/opentelemetry/Opentelemetry/Span/index.html @@ -1,6 +1,11 @@ Span (opentelemetry.Opentelemetry.Span)

Module Opentelemetry.Span

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.

type id = Span_id.t
type nonrec kind = Proto.Trace.span_span_kind =
  1. | Span_kind_unspecified
  2. | Span_kind_internal
  3. | Span_kind_server
  4. | Span_kind_client
  5. | Span_kind_producer
  6. | Span_kind_consumer
type nonrec status_code = Proto.Trace.status_status_code =
  1. | Status_code_unset
  2. | Status_code_ok
  3. | Status_code_error
type nonrec status = Proto.Trace.status = {
  1. message : string;
  2. code : status_code;
}
val id : t -> Span_id.t
type key_value = - string * [ `Int of int | `String of string | `Bool of bool | `None ]
val create : + string + * [ `Int of int + | `String of string + | `Bool of bool + | `Float of float + | `None ]
val create : ?kind:kind -> ?id:id -> ?trace_state:string -> diff --git a/dev/opentelemetry/Opentelemetry/Thread_local/index.html b/dev/opentelemetry/Opentelemetry/Thread_local/index.html deleted file mode 100644 index 420acb70..00000000 --- a/dev/opentelemetry/Opentelemetry/Thread_local/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Thread_local (opentelemetry.Opentelemetry.Thread_local)

Module Opentelemetry.Thread_local

Thread/Domain local storage

This allows the creation of global state that is per-domain or per-thread.

type 'a t
val create : unit -> 'a t

Create new storage

val get : 'a t -> 'a option

Get current value

val get_exn : 'a t -> 'a

Like get but fails with an exception

  • raises Not_found

    if no value was found

val set : 'a t -> 'a -> unit
val remove : _ t -> unit
val get_or_create : create:(unit -> 'a) -> 'a t -> 'a
val with_ : 'a t -> 'a -> ('a option -> 'b) -> 'b

with_ var x f sets var to x for this thread, calls f prev where prev is the value currently in var (if any), and then restores the old value of var for this thread.

\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/Trace/index.html b/dev/opentelemetry/Opentelemetry/Trace/index.html index 5ab40e51..e622b872 100644 --- a/dev/opentelemetry/Opentelemetry/Trace/index.html +++ b/dev/opentelemetry/Opentelemetry/Trace/index.html @@ -2,16 +2,38 @@ Trace (opentelemetry.Opentelemetry.Trace)

Module Opentelemetry.Trace

Traces.

See the spec

type span = Span.t
val make_resource_spans : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> Proto.Trace.span list -> Proto.Trace.resource_spans
val emit : ?service_name:string -> ?attrs: - (string * [< `Bool of bool | `Int of int | `None | `String of string ]) + (string + * [< `Bool of bool + | `Float of float + | `Int of int + | `None + | `String of string ]) list -> span list -> - unit

Sync emitter.

This instructs the collector to forward the spans to some backend at a later point.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

type scope = Scope.t = {
  1. trace_id : Trace_id.t;
  2. span_id : Span_id.t;
  3. mutable events : Event.t list;
  4. mutable attrs : Span.key_value list;
}
  • deprecated use Scope.t
val add_event : Scope.t -> (unit -> Event.t) -> unit
  • deprecated use Scope.add_event
val add_attrs : Scope.t -> (unit -> key_value list) -> unit
  • deprecated use Scope.add_attrs
val with_ : + unit

Sync emitter.

This instructs the collector to forward the spans to some backend at a later point.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

type scope = Scope.t = {
  1. trace_id : Trace_id.t;
  2. span_id : Span_id.t;
  3. mutable events : Event.t list;
  4. mutable attrs : Span.key_value list;
}
  • deprecated use Scope.t
val add_event : Scope.t -> (unit -> Event.t) -> unit
  • deprecated use Scope.add_event
val add_attrs : Scope.t -> (unit -> key_value list) -> unit
  • deprecated use Scope.add_attrs
val with_' : + ?force_new_trace_id:bool -> + ?trace_state:string -> + ?service_name:string -> + ?attrs:(string * value) list -> + ?kind:Span.kind -> + ?trace_id:Trace_id.t -> + ?parent:Span.id -> + ?scope:Scope.t -> + ?links:Span_link.t list -> + string -> + (scope -> 'a) -> + (unit -> 'a) * ((unit, string) Stdlib.result -> unit)

Sync span guard.

Notably, this includes implicit scope-tracking: if called without a ~scope argument (or ~parent/~trace_id), it will check in the Ambient_context for a surrounding environment, and use that as the scope. Similarly, it uses Scope.with_ambient_scope to set a new scope in the ambient context, so that any logically-nested calls to with_ will use this span as their parent.

NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

  • parameter force_new_trace_id

    if true (default false), the span will not use a ambient scope, the ~scope argument, nor ~trace_id, but will instead always create fresh identifiers for this span

val with_ : ?force_new_trace_id:bool -> ?trace_state:string -> ?service_name:string -> @@ -23,4 +45,4 @@ ?links:Span_link.t list -> string -> (Scope.t -> 'a) -> - 'a

Sync span guard.

  • parameter force_new_trace_id

    if true (default false), the span will not use a surrounding context, or scope, or trace_id, but will always create a fresh new trace ID.

    NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

\ No newline at end of file + 'a
\ No newline at end of file diff --git a/dev/opentelemetry/Opentelemetry/index.html b/dev/opentelemetry/Opentelemetry/index.html index 0c50f5c7..2937493b 100644 --- a/dev/opentelemetry/Opentelemetry/index.html +++ b/dev/opentelemetry/Opentelemetry/index.html @@ -1,2 +1,2 @@ -Opentelemetry (opentelemetry.Opentelemetry)

Module Opentelemetry

Opentelemetry types and instrumentation

module Thread_local : sig ... end

Thread/Domain local storage

module Lock : sig ... end

Global lock.

module Rand_bytes : sig ... end

Generation of random identifiers.

Wire format

module Proto : sig ... end

Protobuf types.

Timestamps

module Timestamp_ns : sig ... end

Unix timestamp.

Interface to data collector

module Collector : sig ... end

Collector types

module Util_ : sig ... end

Identifiers

module Trace_id : sig ... end

Trace ID.

module Span_id : sig ... end

Unique ID of a span.

Attributes and conventions

module Conventions : sig ... end
type value = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `None
]
type key_value = string * value

Global settings

module Globals : sig ... end

Process-wide metadata, environment variables, etc.

Traces and Spans

module Event : sig ... end

Events.

Scopes

module Scope : sig ... end

Scopes.

Span Link

module Span : sig ... end

Spans.

module Trace : sig ... end

Traces.

Metrics

module Metrics : sig ... end

Metrics.

module Logs : sig ... end

Logs.

module Metrics_callbacks : sig ... end

A set of callbacks that produce metrics when called. The metrics are automatically called regularly.

Utils

module Trace_context : sig ... end

Implementation of the W3C Trace Context spec

module GC_metrics : sig ... end

Export GC metrics.

\ No newline at end of file +Opentelemetry (opentelemetry.Opentelemetry)

Module Opentelemetry

Opentelemetry types and instrumentation

module Lock : sig ... end

Global lock.

module Rand_bytes : sig ... end

Generation of random identifiers.

Wire format

module Proto : sig ... end

Protobuf types.

Timestamps

module Timestamp_ns : sig ... end

Unix timestamp.

Interface to data collector

module Collector : sig ... end

Collector types

module Util_ : sig ... end

Identifiers

module Trace_id : sig ... end

Trace ID.

module Span_id : sig ... end

Unique ID of a span.

Attributes and conventions

module Conventions : sig ... end
type value = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `Float of float
  5. | `None
]
type key_value = string * value

Global settings

module Globals : sig ... end

Process-wide metadata, environment variables, etc.

Traces and Spans

module Event : sig ... end

Events.

Scopes

module Scope : sig ... end

Scopes.

Span Link

module Span : sig ... end

Spans.

module Trace : sig ... end

Traces.

Metrics

module Metrics : sig ... end

Metrics.

module Logs : sig ... end

Logs.

module Metrics_callbacks : sig ... end

A set of callbacks that produce metrics when called. The metrics are automatically called regularly.

Utils

module Trace_context : sig ... end

Implementation of the W3C Trace Context spec

module GC_metrics : sig ... end

Export GC metrics.

\ No newline at end of file