Opentelemetry.MetricsMetrics.
See the spec
type t = Proto.Metrics.metricA single metric, measuring some time-varying quantity or statistical distribution. It is composed of one or more data points that have precise values and time stamps. Each distinct metric should have a distinct name.
val float :
?start_time_unix_nano:Timestamp_ns.t ->
?now:Timestamp_ns.t ->
?attrs:
(string
* [< `Bool of bool
| `Float of float
| `Int of int
| `None
| `String of string ])
list ->
float ->
Proto.Metrics.number_data_pointNumber data point, as a float
val int :
?start_time_unix_nano:Timestamp_ns.t ->
?now:Timestamp_ns.t ->
?attrs:
(string
* [< `Bool of bool
| `Float of float
| `Int of int
| `None
| `String of string ])
list ->
int ->
Proto.Metrics.number_data_pointNumber data point, as an int
val gauge :
name:string ->
?description:string ->
?unit_:string ->
Proto.Metrics.number_data_point list ->
tAggregation of a scalar metric, always with the current value
type aggregation_temporality = Proto.Metrics.aggregation_temporality = val sum :
name:string ->
?description:string ->
?unit_:string ->
?aggregation_temporality:aggregation_temporality ->
?is_monotonic:bool ->
Proto.Metrics.number_data_point list ->
tSum of all reported measurements over a time interval
val histogram_data_point :
?start_time_unix_nano:Timestamp_ns.t ->
?now:Timestamp_ns.t ->
?attrs:
(string
* [< `Bool of bool
| `Float of float
| `Int of int
| `None
| `String of string ])
list ->
?exemplars:Proto.Metrics.exemplar list ->
?explicit_bounds:float list ->
?sum:float option ->
bucket_counts:int64 list ->
count:int64 ->
unit ->
Proto.Metrics.histogram_data_pointHistogram data
val histogram :
name:string ->
?description:string ->
?unit_:string ->
?aggregation_temporality:Proto.Metrics.aggregation_temporality ->
Proto.Metrics.histogram_data_point list ->
tval make_resource_metrics :
?service_name:string ->
?attrs:
(string
* [< `Bool of bool
| `Float of float
| `Int of int
| `None
| `String of string ])
list ->
t list ->
Proto.Metrics.resource_metricsAggregate metrics into a Proto.Metrics.resource_metrics
val emit :
?attrs:
(string
* [< `Bool of bool
| `Float of float
| `Int of int
| `None
| `String of string ])
list ->
t list ->
unitEmit 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.