Commit graph

54 commits

Author SHA1 Message Date
Simon Cruanes
e31f5f6aba
refactor: move the Mutex.protect backport into Util_mutex 2025-11-19 12:20:13 -05: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
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
Corentin Leruth
41f1f43470 add Scope.make 2024-10-07 16:37:01 +02:00
Corentin Leruth
b3747cfc8e add links to scope 2024-10-07 15:07:05 +02:00
Corentin Leruth
00d46841e4 add record_exception 2024-09-24 09:35:26 +02:00
Simon Cruanes
faa0808034
wip 2024-09-06 07:48:54 -04:00
Corentin Leruth
ea092ae0f9 add host attributes 2024-08-08 10:56:35 +02:00
Simon Cruanes
715578c374
doc 2024-03-08 12:22:17 -05:00
Simon Cruanes
267ac195ef
prepare for 0.8 2024-03-08 11:50:01 -05:00
Simon Cruanes
682c4fd7ce
add semantic conventions for code 2024-03-06 12:33:31 -05:00
Simon Cruanes
1686f3825b
some HTTP semantic conventions 2024-03-06 12:22:39 -05:00
Simon Cruanes
1cb53c3406
feat: add dep on hmap, add standard keys 2024-02-26 10:17:45 -05:00
Simon Cruanes
5a78805add
prepare for 0.7 2024-02-14 13:15:14 -05:00
Simon Cruanes
efc9d74a07
add Span_link.of_span_ctx 2024-02-12 14:17:23 -05:00
Simon Cruanes
e001d62fd5
add Scope.to_span_ctx 2024-02-12 14:00:51 -05:00
Simon Cruanes
1b9ba95faf
more tests, better error message 2024-02-12 13:57:20 -05:00
Simon Cruanes
84ba8c7473
add dummy values for span/trace id, and for span_ctx 2024-02-12 13:44:02 -05:00
Simon Cruanes
fbba875d95
perf: rewrite parsing+printing for span ctx as w3c trace ctx 2024-02-12 11:16:51 -05:00
Simon Cruanes
a47699f6f8
feat: add Span_context, as required by OTEL API guidelines 2024-02-12 11:16:34 -05:00
Simon Cruanes
7d40554025
fix 2024-02-09 15:52:00 -05:00
Simon Cruanes
479f1f39c8
feat: record backtraces in error spans 2024-02-09 15:34:21 -05:00
Simon Cruanes
abafac8361
use dune-generated version number in instrumentation name 2024-02-09 14:58:55 -05:00
Simon Cruanes
9c2b885f95
detail 2023-12-20 15:58:33 -05:00
Simon Cruanes
bd8b483e81
feat: use AList for tick callbacks; emit GC events on tick
it's cleaner to emit GC events on ticks rather than on GC,
because it avoids both spamming if the GC is very active, and
emitting nothing when there are few allocations.
2023-12-20 15:46:39 -05:00