Module Opentelemetry.Globals

Process-wide metadata, environment variables, etc.

val service_name : string ref

Main service name metadata

val service_namespace : string option ref

Namespace for the service

val service_instance_id : string option ref

Unique identifier for the service

val service_version : string option ref

Version for the service

  • since 0.12
val sdk_version : string
  • since 0.90

Global attributes, initially set via OTEL_RESOURCE_ATTRIBUTES and modifiable by the user code. They will be attached to each outgoing metrics/traces.

val add_global_attribute : string -> Opentelemetry_core.Value.t -> unit

Add a global attribute

val default_span_kind : Opentelemetry_core.Span_kind.t ref
val get_runtime_attributes : unit -> (string * [> `String of string ]) list

Attributes about the OCaml runtime. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/process.md#process-runtimes

val mk_attributes : ?service_name:string -> ?attrs: (string * [< `Bool of bool | `Float of float | `Int of int | `None | `String of string ]) list -> unit -> Opentelemetry_core.Common_.Proto.Common.key_value list

Build main global attributes, to be used in resource attributes (shared by all spans/metrics/logs in each outgoing batch)

val tick_cbs_ : (unit -> unit) Opentelemetry_util.Alist.t

Global tick callback registry. Callbacks are run periodically by the SDK ticker. Other modules register here to avoid depending on Sdk.

val add_on_tick_callback : (unit -> unit) -> unit
val run_tick_callbacks : unit -> unit
module Enricher : sig ... end