mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 12:23:32 -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 (
|
if add_own_metrics then (
|
||||||
Atomic.set last_sent_metrics now;
|
Atomic.set last_sent_metrics now;
|
||||||
let open OT.Metrics in
|
let open OT.Metrics in
|
||||||
|
let now_unix = OT.Timestamp_ns.now_unix_ns () in
|
||||||
[
|
[
|
||||||
make_resource_metrics
|
make_resource_metrics
|
||||||
[
|
[
|
||||||
sum ~name:"otel.export.dropped" ~is_monotonic:true
|
sum ~name:"otel.export.dropped" ~is_monotonic:true
|
||||||
[
|
[
|
||||||
int
|
int ~start_time_unix_nano:now_unix ~now:now_unix
|
||||||
~start_time_unix_nano:(Mtime.to_uint64_ns last_emit)
|
(Atomic.get n_dropped);
|
||||||
~now:(Mtime.to_uint64_ns now) (Atomic.get n_dropped);
|
|
||||||
];
|
];
|
||||||
sum ~name:"otel.export.errors" ~is_monotonic:true
|
sum ~name:"otel.export.errors" ~is_monotonic:true
|
||||||
[
|
[
|
||||||
int
|
int ~start_time_unix_nano:now_unix ~now:now_unix
|
||||||
~start_time_unix_nano:(Mtime.to_uint64_ns last_emit)
|
(Atomic.get n_errors);
|
||||||
~now:(Mtime.to_uint64_ns now) (Atomic.get n_errors);
|
|
||||||
];
|
];
|
||||||
];
|
];
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue