Module Opentelemetry.Metrics

Metrics.

See the spec

type t
val float : ?start_time_unix_nano:int64 -> ?now:Timestamp_ns.t -> ?attrs: (string * [< `Bool of bool | `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:int64 -> ?now:Timestamp_ns.t -> ?attrs: (string * [< `Bool of bool | `Int of int | `None | `String of string ]) list -> int -> Opentelemetry__Metrics_types.number_data_point

Number data point, as an int

val gauge : name:string -> ?description:string -> ?unit_:string -> Opentelemetry__Metrics_types.number_data_point list -> t

Aggregation of a scalar metric, always with the current value

type aggregation_temporality =
| Aggregation_temporality_unspecified
| Aggregation_temporality_delta
| Aggregation_temporality_cumulative
val sum : name:string -> ?description:string -> ?unit_:string -> ?aggregation_temporality:aggregation_temporality -> ?is_monotonic:bool -> Opentelemetry__Metrics_types.number_data_point list -> t

Sum of all reported measurements over a time interval

val make_resource_metrics : ?service_name:string -> ?attrs: (string * [< `Bool of bool | `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 ]) 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.