Commit graph

79 commits

Author SHA1 Message Date
Simon Cruanes
6436f0e36d
utils in Any_signal_l 2026-01-20 00:15:20 -05:00
Simon Cruanes
18b653a896
add Any_signal_l; modify Exporter to use Aswitch 2026-01-20 00:15:19 -05:00
Simon Cruanes
61f17fa6ce
better exporter/emitter combinators; better cleanup (now shutdown) 2026-01-20 00:15:19 -05:00
Simon Cruanes
4f218b31ef
mor efixes 2026-01-20 00:15:14 -05:00
Simon Cruanes
d02d609cf9
feat lib: easily access the main tracer, logger, etc 2026-01-20 00:15:14 -05:00
Simon Cruanes
9453506d7b
migrate a few more things to lib/ from core/ 2026-01-20 00:15:14 -05:00
Simon Cruanes
35f8bbc67d
feat exporter: split tick/on_tick again 2026-01-20 00:15:14 -05:00
Simon Cruanes
fe0aa297a6
perf: optimize {Trace,Span}_id.is_zero 2026-01-20 00:15:14 -05:00
Simon Cruanes
98cf8fbdbc
fix warning 2026-01-20 00:15:13 -05:00
Simon Cruanes
1ee298a1a3
feat core: add Any_signal.t; make Exporter a record of emitters 2026-01-20 00:15:13 -05:00
Simon Cruanes
5aec2c99b8
fix rand_bytes: init at least the local domain's Rand state 2026-01-20 00:15:12 -05:00
Simon Cruanes
b8228dfe25
split core library into opentelemetry.core and opentelemetry 2026-01-20 00:15:12 -05:00
Simon Cruanes
959cf724fd
refactor core 2026-01-20 00:15:11 -05:00
Simon Cruanes
6ccf554645
feat span: ambient span 2026-01-20 00:15:11 -05:00
Simon Cruanes
bd335ecadd
refator core OTEL: remove Scope, directly use Span as builder
now that fields are mutable, it's cheaper and easier
2026-01-20 00:15:11 -05:00
Simon Cruanes
6b6fb34342
feat OTEL: move some stuff to client or util; rate limit GC metrics 2026-01-20 00:15:10 -05:00
Simon Cruanes
841d58ab67
large refactor: split core library into many modules; change API design
follow more closely the official OTEL recommendations, and also try
to reduce global state.

- use a class type for `Exporter.t` (instead of 1st class module `backend`)
- have tracer, logger, metrics_emitter as explicit objects
- keep a `Main_exporter` to make migration easier, but discouraged
- add stdout_exporter and debug_exporter to opentelemetry.client
2026-01-20 00:15:09 -05:00
Simon Cruanes
d4b44244d7
update generated code again, repeated fields are optional again 2025-12-01 20:32:05 -05:00
Simon Cruanes
41d8b0c1a4
fix 2025-12-01 20:32:04 -05:00
Simon Cruanes
a35ea4c646
fixes 2025-12-01 20:32:03 -05:00
Simon Cruanes
e31f5f6aba
refactor: move the Mutex.protect backport into Util_mutex 2025-11-19 12:20:13 -05:00
ajbt200128
3fbac32822 fix: mutex usage and inline bugs 2025-11-12 14:27:36 -08:00
Corentin Leruth
950d5922a1 add correct release version in comment 2025-11-08 12:49:52 +01:00
Simon Cruanes
fa610ed535
Update src/core/opentelemetry.ml 2025-09-02 15:08:22 -04:00
Shon Feder
54b62af1a2
Check for on_click registration exactly once 2025-09-02 15:00:11 -04:00
Shon Feder
93803581b7
fix: make metric callbacks atomic
The use of a non-threadsafe mutable reference for the metrics callbacks
was resulting in a race condition that would sometimes produce
non-deterministic results in the integration tests.

This has not affected the lwt-based collector, because of the single
threaded concurrency Lwt enforces, but it began to show up in the WIP
Eio rewrite, for which I am testing on cross-domain programs.

I suspect this may have also bee affecting the ocurl collector, but we
don't have integration test running on that yet.
2025-09-02 14:41:26 -04:00
ajbt200128
46d1289d95 fix: opentelemetry exception attr spec
this brings the exception attributes in line with the spec
https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/.
It seems we were missing the preceding `exception.`.
2025-07-23 09:01:52 -05:00
Simon Cruanes
4ee29d8504 feat: add Globals.service_version 2025-06-23 09:32:59 -04:00
Shon Feder
e66476015b
Move deprecation alerts to valid location
As discussed in https://github.com/ocaml/ocaml/issues/14078,
alerts (with deprecation alerts as a special case) are not currently
supported as item-attributes on let-bindings. This usage produces
`misplaced-attribute` warnings, such as

```
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
File "src/core/opentelemetry.ml", line 1229, characters 37-47:
1229 |   let add_event = Scope.add_event [@@deprecated "use Scope.add_event"]
                                            ^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context

File "src/core/opentelemetry.ml", line 1231, characters 37-47:
1231 |   let add_attrs = Scope.add_attrs [@@deprecated "use Scope.add_attrs"]
                                            ^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
```

Fortunately, we can still add deprecation alerts to these value by
moving the alert to the pattern, as done here.
2025-06-07 10:56:56 -04:00
Simon Cruanes
51af3a4105
format 2025-05-05 14:41:20 -04:00
Simon Cruanes
5788492946
breaking: change Collector.cleanup so it takes a callback
this callback can be used to resolve a Lwt future, for example, to make
sure we indeed wait for the cleanup to be done before exiting.
2025-04-17 16:09:14 -04:00
Simon Cruanes
6a378e49ce
format 2025-04-17 14:59:28 -04:00
Simon Cruanes
9b5f3cd0c3
feat: adapt to trace 0.10 2025-04-17 10:04:16 -04:00
Simon Cruanes
34a4a87fc3
perf: details 2025-04-09 10:00:50 -04:00
Simon Cruanes
21de8b1f4b
forgot to update tags 2025-03-19 09:06:57 -04:00
Corentin Leruth
7ef6677dff add missing sample argument to Traceparent.to_value 2025-03-03 09:32:01 -05:00
Simon Cruanes
92613d8526
fix 2025-01-30 20:44:57 -05:00
Corentin Leruth
4f9247d6d0 support sampled flag 2025-01-30 20:32:48 -05:00
Simon Cruanes
1848b02c0f add optional args to Span_link.of_span_ctx 2025-01-14 09:32:11 -05:00
Simon Cruanes
c71caa93be feat otel: add Span_kind.t, add {kind,set_kind} to Scope 2025-01-14 09:32:11 -05:00
Corentin Leruth
5aa5c5ed0a expose Span_status types 2024-10-24 10:48:10 -04:00
Simon Cruanes
3a22a932f4
Merge pull request #75 from tatchi/add-set-span-status
add Scope.set_span_status
2024-10-21 12:01:01 -04:00
Simon Cruanes
865b446829
Update src/core/opentelemetry.ml 2024-10-21 10:40:46 -04:00
Corentin Leruth
53c1ddba8c re-add code to set span status based on scope 2024-10-18 11:35:16 +02:00
Corentin Leruth
acc9cb3abb move comments to signature 2024-10-18 11:29:11 +02:00
Corentin Leruth
6a1f1eb06b move span status to item_list 2024-10-18 11:22:43 +02:00
Simon Cruanes
a44c5dc33a in remove_backend, call tick() then cleanup() on it 2024-10-17 13:45:28 -04:00
Simon Cruanes
97030757c1 feat: allow to remove backend
close #70
2024-10-17 13:45:28 -04:00
Corentin Leruth
3264b3c2ca add Scope.set_span_status 2024-10-17 18:18:32 +02:00
Corentin Leruth
ac1a27eb89 reduce memory usage of Scope.t 2024-10-10 21:22:16 +02:00