mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
fix otel-client-ocurl: use ptime timestamps for self metrics
This commit is contained in:
parent
d8be02c829
commit
3d3cf8c02c
1 changed files with 5 additions and 6 deletions
|
|
@ -433,20 +433,19 @@ let create_backend ?(stop = Atomic.make false)
|
|||
if add_own_metrics then (
|
||||
Atomic.set last_sent_metrics now;
|
||||
let open OT.Metrics in
|
||||
let now_unix = OT.Timestamp_ns.now_unix_ns () in
|
||||
[
|
||||
make_resource_metrics
|
||||
[
|
||||
sum ~name:"otel.export.dropped" ~is_monotonic:true
|
||||
[
|
||||
int
|
||||
~start_time_unix_nano:(Mtime.to_uint64_ns last_emit)
|
||||
~now:(Mtime.to_uint64_ns now) (Atomic.get n_dropped);
|
||||
int ~start_time_unix_nano:now_unix ~now:now_unix
|
||||
(Atomic.get n_dropped);
|
||||
];
|
||||
sum ~name:"otel.export.errors" ~is_monotonic:true
|
||||
[
|
||||
int
|
||||
~start_time_unix_nano:(Mtime.to_uint64_ns last_emit)
|
||||
~now:(Mtime.to_uint64_ns now) (Atomic.get n_errors);
|
||||
int ~start_time_unix_nano:now_unix ~now:now_unix
|
||||
(Atomic.get n_errors);
|
||||
];
|
||||
];
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue