mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 12:23:32 -04:00
expose GC_metrics.get_runtime_attributes
This commit is contained in:
parent
bf4ac37f21
commit
66693280ec
1 changed files with 11 additions and 7 deletions
|
|
@ -711,17 +711,21 @@ module GC_metrics : sig
|
||||||
val basic_setup : unit -> unit
|
val basic_setup : unit -> unit
|
||||||
(** Setup a hook that will emit GC statistics regularly *)
|
(** Setup a hook that will emit GC statistics regularly *)
|
||||||
|
|
||||||
|
val get_runtime_attributes : unit -> Span.key_value list
|
||||||
|
(** Get OCaml name and version runtime attributes *)
|
||||||
|
|
||||||
val get_metrics : unit -> Metrics.t list
|
val get_metrics : unit -> Metrics.t list
|
||||||
(** Get a few metrics from the current state of the GC *)
|
(** Get a few metrics from the current state of the GC *)
|
||||||
end = struct
|
end = struct
|
||||||
(** See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/process.md#process-runtimes *)
|
(** See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/process.md#process-runtimes *)
|
||||||
let runtime_attributes : Proto.Common.key_value list =
|
let runtime_attributes =
|
||||||
Conventions.Attributes.[
|
lazy
|
||||||
(Process.Runtime.name, "ocaml");
|
Conventions.Attributes.[
|
||||||
(Process.Runtime.version, Sys.ocaml_version);
|
(Process.Runtime.name, `String "ocaml");
|
||||||
]
|
(Process.Runtime.version, `String Sys.ocaml_version);
|
||||||
|> List.map (fun (key, value) ->
|
]
|
||||||
Proto.Common.default_key_value ~key ~value:(Some (String_value value)) ())
|
|
||||||
|
let get_runtime_attributes () = Lazy.force runtime_attributes
|
||||||
|
|
||||||
let basic_setup () =
|
let basic_setup () =
|
||||||
let trigger() =
|
let trigger() =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue