Simon Cruanes
5b83834af5
subscriber: restore trace_id
...
we need it for async backends, clearly
2026-01-14 22:29:46 -05:00
Simon Cruanes
c89a031e43
core: enter_span takes an optional flavor
...
it's a core extension, it should be easy to use
2026-01-14 22:29:32 -05:00
Simon Cruanes
2cfb3c67fa
port fuchsia to new subscriber
2026-01-14 22:09:33 -05:00
Simon Cruanes
7389ca5b45
fix warning
2026-01-14 22:09:25 -05:00
Simon Cruanes
322e1d0f44
subscriber: make ~new_span_id mandatory
...
too easy to forget otherwise
2026-01-14 22:09:05 -05:00
Simon Cruanes
7a392e54d1
trace-tef: use new subscriber, no more global state
2026-01-14 21:56:09 -05:00
Simon Cruanes
a1837e402e
trace.subscriber: define custom span, simplify subscriber callbacks
...
- custom span carries around all the required data, including mutable
args
- no more manual enter/exit callbacks
- use record for callbacks
- no more big Span_tbl
2026-01-14 21:56:09 -05:00
Simon Cruanes
40b44349e7
core: add on_init callback to collector
2026-01-14 21:56:09 -05:00
Simon Cruanes
8e2bb5bc83
remove event for now
2026-01-14 21:27:33 -05:00
Simon Cruanes
5018a9ead7
refactor core library
...
much cleaner now, and simpler.
- `span` is an open sum type, so it can carry as much info as we want
from enter to exit. This means most collectors shouldn't even need a
global table for spans!
- merge manual spans and spans. It's just spans now. Keep old
Trace_core.xxx_manual_xxx functions but deprecate them
- add `extension_parameter` to carry additional info to collector (eg
OTEL span kind, TEF sync/async, maybe span links, etc)
- make the collector into a record of callbacks + a state, for
efficiency (but also to make it easier to extend in the future with
callbacks that have a default implementation
)
2026-01-14 20:29:33 -05:00
Vincent Bernardoff
1c9a869148
ppx: call Stdlib.Printexc
...
This is because some libraries, i.e. Janestreet Core, override the
Printexc module.
2026-01-10 08:20:55 -05:00
Simon Cruanes
0947d2d523
better error message
2025-12-09 12:24:52 -05:00
Simon Cruanes
b3da5bc41e
deal with Pexp_function
2025-12-09 12:24:48 -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
acae4ff88d
doc
2025-11-01 22:18:16 -04:00
Simon Cruanes
0c275b3aab
use at_exit in trace_tef/tldrs
2025-09-15 09:11:09 -04:00
Simon Cruanes
a81785f8c0
fix fuchsia: bound check
2025-07-26 01:20:40 -04:00
Simon Cruanes
d9cd7621f5
prepare for 0.10
2025-05-27 09:58:19 -04:00
Simon Cruanes
cd5785d938
format
2025-05-27 09:54:58 -04:00
Simon Cruanes
6853fa50f3
docs
2025-05-27 09:54:43 -04:00
Simon Cruanes
d1759fea89
fix for 4.08
2025-05-07 22:32:29 -04:00
Simon Cruanes
d7f0aff406
cleaner tracing errors
2025-05-07 17:19:47 -04:00
Simon Cruanes
7acc1b930f
detail
2025-05-07 15:35:11 -04:00
Simon Cruanes
190f70d7c9
feat fuchsia: full revamp of the library, modularized
...
- separate exporter, writer, subscriber
- use the subscriber span tbl to keep track of context
- use a `Buf_chain.t` to keep multiple buffers in use,
and keep a set of ready buffers
- batch write the ready buffers and then recycle them
2025-05-07 15:33:34 -04:00
Simon Cruanes
a4779227fa
add .mli for rpool
2025-05-07 13:15:37 -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
4454975a61
feat util: remove b_queue, add Rpool
...
to be used in various buffer pools.
2025-05-07 13:06:55 -04:00
Simon Cruanes
005626a2cd
feat: add trace.event, useful for background threads
...
send these events into a queue and process them somewhere else.
2025-05-07 11:10:15 -04:00
Simon Cruanes
76703461ea
feat(trace.subscriber): add Span_tbl, and a depopt on picos_aux
2025-05-07 11:09:42 -04:00
Simon Cruanes
7405e3ae1b
wip: port fuchsia to subscriber infra
2025-05-05 15:08:57 -04:00
Simon Cruanes
ef50b578f1
refactor(subscriber): timestamps are int64ns now
2025-05-05 15:08:57 -04:00
Simon Cruanes
384dca93e2
fix: better retrocompat for enter_manual_{toplevel,sub}_span
2025-05-02 09:19:35 -04:00
Simon Cruanes
3c1360677a
subscriber: tee a whole array at once
2025-05-02 08:55:45 -04:00
Simon Cruanes
44fdc9557d
restore enter_manual_{sub,toplevel}_span, but deprecated
...
this will ease migration
2025-05-01 22:48:18 -04:00
Simon Cruanes
8f195adff9
feat tef-tldrs: use EMIT_TEF_AT_EXIT
2025-04-15 15:51:48 -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
a4ee0d1408
comment
2025-04-09 14:53:39 -04:00
Simon Cruanes
d3bfb7776b
fix compat
2025-04-09 10:48:18 -04:00
Simon Cruanes
cdab1c0956
compat OCaml 4.12
2025-04-09 10:35:11 -04:00
Simon Cruanes
cd6f6f6025
fix
2025-04-09 09:42:24 -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
6ded0ed5c0
feat(trace.subscriber): depopt on unix for timestamps
2025-04-09 09:24:27 -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
064e6e26bb
prepare for 0.9
2025-01-13 10:17:57 -05: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