mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 20:07:55 -04:00
metrics: do not add a default start_time_unix_nano
This commit is contained in:
parent
3eba3df59d
commit
4a61ab44d9
1 changed files with 8 additions and 10 deletions
|
|
@ -20,19 +20,17 @@ open struct
|
||||||
end
|
end
|
||||||
|
|
||||||
(** Number data point, as a float *)
|
(** Number data point, as a float *)
|
||||||
let float ?(start_time_unix_nano = _program_start)
|
let float ?start_time_unix_nano ?(now = Timestamp_ns.now_unix_ns ())
|
||||||
?(now = Timestamp_ns.now_unix_ns ()) ?(attrs = []) (d : float) :
|
?(attrs = []) (d : float) : number_data_point =
|
||||||
number_data_point =
|
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_number_data_point ~start_time_unix_nano ~time_unix_nano:now ~attributes
|
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
||||||
~value:(As_double d) ()
|
~value:(As_double d) ()
|
||||||
|
|
||||||
(** Number data point, as an int *)
|
(** Number data point, as an int *)
|
||||||
let int ?(start_time_unix_nano = _program_start)
|
let int ?start_time_unix_nano ?(now = Timestamp_ns.now_unix_ns ()) ?(attrs = [])
|
||||||
?(now = Timestamp_ns.now_unix_ns ()) ?(attrs = []) (i : int) :
|
(i : int) : number_data_point =
|
||||||
number_data_point =
|
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_number_data_point ~start_time_unix_nano ~time_unix_nano:now ~attributes
|
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
||||||
~value:(As_int (Int64.of_int i))
|
~value:(As_int (Int64.of_int i))
|
||||||
()
|
()
|
||||||
|
|
||||||
|
|
@ -62,12 +60,12 @@ let sum ~name ?description ?unit_
|
||||||
count value of histogram for each bucket. Sum of the counts must be equal
|
count value of histogram for each bucket. Sum of the counts must be equal
|
||||||
to [count]. length must be [1+length explicit_bounds]
|
to [count]. length must be [1+length explicit_bounds]
|
||||||
@param explicit_bounds strictly increasing list of bounds for the buckets *)
|
@param explicit_bounds strictly increasing list of bounds for the buckets *)
|
||||||
let histogram_data_point ?(start_time_unix_nano = _program_start)
|
let histogram_data_point ?start_time_unix_nano
|
||||||
?(now = Timestamp_ns.now_unix_ns ()) ?(attrs = []) ?(exemplars = [])
|
?(now = Timestamp_ns.now_unix_ns ()) ?(attrs = []) ?(exemplars = [])
|
||||||
?(explicit_bounds = []) ?sum ~bucket_counts ~count () : histogram_data_point
|
?(explicit_bounds = []) ?sum ~bucket_counts ~count () : histogram_data_point
|
||||||
=
|
=
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_histogram_data_point ~start_time_unix_nano ~time_unix_nano:now
|
make_histogram_data_point ?start_time_unix_nano ~time_unix_nano:now
|
||||||
~attributes ~exemplars ~bucket_counts ~explicit_bounds ~count ?sum ()
|
~attributes ~exemplars ~bucket_counts ~explicit_bounds ~count ?sum ()
|
||||||
|
|
||||||
let histogram ~name ?description ?unit_ ?aggregation_temporality
|
let histogram ~name ?description ?unit_ ?aggregation_temporality
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue