mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
fix: emit GC metrics even in the absence of custom metrics
This commit is contained in:
parent
f9233113b1
commit
592814dab8
3 changed files with 10 additions and 1 deletions
|
|
@ -348,7 +348,9 @@ end = struct
|
||||||
Queue.clear local_q;
|
Queue.clear local_q;
|
||||||
|
|
||||||
if !must_flush_all then (
|
if !must_flush_all then (
|
||||||
if Batch.len batches.metrics > 0 then send_metrics ();
|
if Batch.len batches.metrics > 0 || not (AList.is_empty gc_metrics)
|
||||||
|
then
|
||||||
|
send_metrics ();
|
||||||
if Batch.len batches.logs > 0 then send_logs ();
|
if Batch.len batches.logs > 0 then send_logs ();
|
||||||
if Batch.len batches.traces > 0 then send_traces ()
|
if Batch.len batches.traces > 0 then send_traces ()
|
||||||
) else (
|
) else (
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ type 'a t = 'a list Atomic.t
|
||||||
|
|
||||||
let make () = Atomic.make []
|
let make () = Atomic.make []
|
||||||
|
|
||||||
|
let[@inline] is_empty self : bool =
|
||||||
|
match Atomic.get self with
|
||||||
|
| [] -> true
|
||||||
|
| _ :: _ -> false
|
||||||
|
|
||||||
let get = Atomic.get
|
let get = Atomic.get
|
||||||
|
|
||||||
let add self x =
|
let add self x =
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ type 'a t
|
||||||
val get : 'a t -> 'a list
|
val get : 'a t -> 'a list
|
||||||
(** Snapshot *)
|
(** Snapshot *)
|
||||||
|
|
||||||
|
val is_empty : _ t -> bool
|
||||||
|
|
||||||
val make : unit -> 'a t
|
val make : unit -> 'a t
|
||||||
|
|
||||||
val add : 'a t -> 'a -> unit
|
val add : 'a t -> 'a -> unit
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue