Commit graph

34 commits

Author SHA1 Message Date
Simon Cruanes
ef15941936
functions to enter/exit implicit spans 2023-12-22 20:10:58 -05:00
Simon Cruanes
079949d139
tef: emit last message when worker exits 2023-12-07 16:16:07 -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
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
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
Simon Cruanes
1b5e827d65 fix inconsistency 2023-08-09 00:26:21 -04:00
Simon Cruanes
50b4691ab6 rename explicit span API 2023-08-09 00:26:21 -04:00
Simon Cruanes
a09a4fc69a refactor collector API as well.
After long discussions with @ELLIOTTCABLE, the collector should only
provide a `with_`-like function for regular spans. This allows
each concurrency library to use its native mechanism for local storage,
which is almost always based on such a scope function.
2023-08-09 00:26:21 -04:00
Simon Cruanes
b44e2f2923 Add explicit spans, for async tracing.
These spans require the user to pass the surrounding span, if any, when
entering a new span. They use the information inside (which is collector
specific) to track what asynchronous task is currently being executed.

Wrappers around `trace`, specific to an async library (e.g. Eio, lwt,
Async, etc.) can then smooth this over by providing a `with_async_span`
construct that uses some implicit contextual storage to carry the
`surrounding` scope around.
2023-08-09 00:26:21 -04:00
Joseph Price
f8cd53ec89 chore: depend on core in trace-tef
This changes trace-tef to depend on trace-core instead of trace, to
avoid clashing with the toplevel's Trace module when starting utop.
2023-07-30 22:56:49 -04:00
Simon Cruanes
c8f88f44ea
details 2023-06-23 15:00:08 -04:00
Simon Cruanes
345dd4a163
feat trace-tef: add a ticker thread to ensure we flush the file regularly 2023-06-23 14:56:05 -04:00
Simon Cruanes
088f2a5e7f
trace-tef: additional argument to with_setup; env for "stdout"/"stderr" 2023-06-12 13:30:06 -04:00
Simon Cruanes
1886ee737e
perf(trace-tef): improve behavior of collector under contention
writers still do one lock+unlock per event, but the collector can read
multiple events at once using Queue.transfer.
2023-06-10 19:30:24 -04:00
Simon Cruanes
8625a33d6b
use better float printer for counters 2023-06-09 23:08:16 -04:00
Simon Cruanes
341f137ebd
add counter_int and counter_float 2023-06-09 23:05:54 -04:00
Simon Cruanes
7958d7bc3b
tef: remove dead code 2023-06-09 22:48:45 -04:00
Simon Cruanes
1735abeb8b
api change: message does not take location
even tracy doesn't have that. Otoh a message should have an optional
span for OTEL.
2023-06-09 16:53:53 -04:00
Simon Cruanes
b6db37fab0
add thread/process name setting 2023-06-09 16:07:49 -04:00
Simon Cruanes
261874bfa8
add optional metadata to messages and spans 2023-06-09 09:54:19 -04:00
Simon Cruanes
1fed3eba8e
change API 2023-06-09 09:34:31 -04:00
Simon Cruanes
718cbf120f
fix trace-tef: cleanup 2023-06-09 08:10:35 -04:00
Simon Cruanes
c58810f4e8
fix build error; make tests deterministic 2023-06-08 23:47:52 -04:00
Simon Cruanes
07645ffa1a
add trace-tef, a simple backend 2023-06-08 22:31:32 -04:00