Simon Cruanes
7389ca5b45
fix warning
2026-01-14 22:09:25 -05:00
Simon Cruanes
7a392e54d1
trace-tef: use new subscriber, no more global state
2026-01-14 21:56:09 -05:00
Simon Cruanes
89eecf7ba3
breaking: use poly variants for user_data/span_flavor in subscriber
...
no need to do redundant conversions.
2025-12-04 12:39:03 -05:00
Simon Cruanes
aeb2aff3b7
breaking: require subscribers to provide mk_span/mk_trace_id
...
we want control over this!
2025-12-04 12:31:14 -05:00
Simon Cruanes
0c275b3aab
use at_exit in trace_tef/tldrs
2025-09-15 09:11:09 -04:00
Simon Cruanes
d7f0aff406
cleaner tracing errors
2025-05-07 17:19:47 -04:00
Simon Cruanes
81096e0d3c
refactor TEF: split into exporter,writer,subscriber
...
code is a lot cleaner now.
2025-05-07 13:08:22 -04:00
Simon Cruanes
ef50b578f1
refactor(subscriber): timestamps are int64ns now
2025-05-05 15:08:57 -04:00
Simon Cruanes
46242cd817
format
2025-04-11 12:25:47 -04:00
Simon Cruanes
477cc21bf1
format using 0.27
2025-04-11 12:25:21 -04:00
Simon Cruanes
d737022e11
fix: beware of dummy trace id
2025-04-11 12:25:10 -04:00
Simon Cruanes
cdab1c0956
compat OCaml 4.12
2025-04-09 10:35:11 -04:00
Simon Cruanes
151d80d0f1
breaking: feat(trace): pass a string trace_id in manual spans
...
- in entering manual spans, we now pass an explicit span_ctx that
contains a trace_id (bytes) and the parent span id (int64).
- this makes compat with OTEL easier as we want this sort
of span_ctx to be passed around.
2025-04-09 09:28:09 -04:00
Simon Cruanes
86d4fc25ac
feat trace-tef: print names of non-closed spans upon exit
2025-03-13 20:39:31 -04:00
Simon Cruanes
c5e813170d
fix: block signals in background threads
2025-03-13 15:55:09 -04:00
Simon Cruanes
4dfa319003
feat: add an extensible sum type for extending the library
...
libraries and collectors can now define their own "events" that
collectors will handle (or not), without having to contribute them to
ocaml-trace at all.
2024-10-29 09:21:09 -04:00
Simon Cruanes
9a7b4710a3
prepare for 0.8
2024-09-17 11:29:48 -04:00
Simon Cruanes
6920c3341a
refactor: use trace.subscriber instead of a separate library
2024-09-17 10:36:49 -04:00
Simon Cruanes
5b1ad7275b
feat subscriber: avoid polyvariants entirely
2024-09-09 15:59:46 -04:00
Simon Cruanes
59db458fec
tef: expose subscriber_jsonl
2024-09-09 14:44:13 -04:00
Simon Cruanes
bebd037803
wip: trace-subscriber package
2024-09-09 14:14:25 -04:00
Simon Cruanes
62837c5193
feat tef: accept a out_channel directly in the collector
2024-08-23 15:17:55 -04:00
Simon Cruanes
0b6dc27556
break tef: use mtime.now, not a counter, for multiproc
...
this allows us to correlate timestamps among processes on the same
machine.
2024-08-23 15:17:55 -04:00
Simon Cruanes
f8c1d2d972
refactor tef: move event in a side file
2024-08-16 15:45:24 -04:00
Simon Cruanes
d0e159785e
fix in trace-tef now that meta-map can raise Invalid_arg
2024-03-01 15:18:04 -05:00
Simon Cruanes
3c2f804716
add hmap as a depopt ( #28 )
...
if present, we use `Hmap.t` as the meta map for manual spans
2024-02-24 11:33:48 -05:00
Simon Cruanes
2e4971d23d
chore: we don't actually depend on atomic
2023-12-26 21:27:31 -05:00
Simon Cruanes
7f9370e842
refactor: split some parts of trace-tef into trace.private.util
2023-12-25 16:51:52 -05:00
Simon Cruanes
b387729081
share code for implicit spans
2023-12-22 20:15:25 -05:00
Simon Cruanes
ef15941936
functions to enter/exit implicit spans
2023-12-22 20:10:58 -05:00
Simon Cruanes
756ea1d22c
refactor: avoid some deadlocks in trace-tef
2023-12-07 16:16:07 -05:00
Simon Cruanes
079949d139
tef: emit last message when worker exits
2023-12-07 16:16:07 -05:00
Simon Cruanes
317509681e
trace-tef: simplify code
2023-12-06 20:51:35 -05:00
Simon Cruanes
c16666d214
perf: reduce overhead in trace-tef
...
we call onto the channel functions less, because they
involve locking. Instead we do all writes into a (reused) buffer
and write it all at once at the end.
2023-12-05 14:52:40 -05:00
Simon Cruanes
0e198c8059
compat < 5.0
2023-11-28 14:31:16 -05:00
Simon Cruanes
67bc11b4d3
fix for 4.08
2023-11-28 14:31:16 -05:00
Simon Cruanes
c82fb362e8
trace-tef: add Mpsc_queue, adapted from picos; use it in trace_tef
2023-11-28 14:31:16 -05:00
Simon Cruanes
0135a613a9
add ?data to counter_int and counter_float
...
this makes sense to add metadata in, say, opentelemetry
2023-09-16 21:29:01 -04:00
Simon Cruanes
ba9d3d3d20
small refactor
2023-09-15 10:01:20 -04:00
Simon Cruanes
431811c995
rename add_data_to_current_span; give it span explicitly
2023-09-13 14:43:16 -04:00
Simon Cruanes
e0fe99f500
rename add_data to add_data_to_current_span
2023-09-06 09:50:54 -04:00
Simon Cruanes
4fc81d4ca2
tef: carry additional data for manual spans in the explicit_span's map
...
the span opening has been emitted already, so we'll emit the metadata at
exit time. We don't need side storage since we already have a hmap.
2023-08-30 20:24:17 -04:00
Simon Cruanes
8a4309b95e
adapt trace-tef to handle adding data after creating span
2023-08-30 20:23:52 -04:00
Simon Cruanes
c683f6331b
add add_data_to_span and add_data_to_explicit_span
2023-08-30 20:23:51 -04:00
Simon Cruanes
20e2bf2f87
tef: docs and small refactor
2023-08-30 08:31:50 -04:00
Simon Cruanes
b467678040
feat tef: write to trace.json if TRACE is either 1 or true
2023-08-30 08:31:49 -04:00
Corentin Leruth
fc5b243df5
b_queue: use broadcast instead of signal
2023-08-29 22:37:54 -04:00
Corentin Leruth
efafd34a9e
b_queue: signal only if queue was empty
2023-08-23 20:42:16 -04:00
Simon Cruanes
96fb44e6bb
trace-tef: emit function name, if provided, as a metadata key/value pair
...
the key is "function". It is visible when selecting the span, typically.
2023-08-19 17:13:56 -04:00
Simon Cruanes
0eb6a84982
feat: add ?flavor argument to manual spans.
2023-08-09 00:26:21 -04:00