Commit graph

356 commits

Author SHA1 Message Date
Simon Cruanes
4a2c5927a1 opentelemetry.trace: collector needn't arguments 2026-03-03 09:13:48 -05:00
Simon Cruanes
3f37dceb40 opentelemetry.trace: make sure to setup the ambient span provider
otherwise `Trace.with_span` will not update the current ambient span, or
use the previous one as parent
2026-03-03 09:13:48 -05:00
Simon Cruanes
378a2ebbf8 compat on 4.08 2026-03-03 09:13:48 -05:00
Simon Cruanes
edc3932059 grrr cohttp and its signature breakages 2026-03-03 09:13:48 -05:00
Simon Cruanes
4edac68be5 fix: move to ezcurl 0.3 2026-03-03 09:13:48 -05:00
Simon Cruanes
cc9fdfad73 opentelemetry.trace: add ambient-span-provider using ambient-context 2026-03-03 09:13:48 -05:00
Simon Cruanes
c9093043e4 opentelemetry: add a hmap in Scope.t 2026-03-03 09:13:48 -05:00
Simon Cruanes
e6412b02e1 use Extensions module in opentelemetry.trace 2026-03-03 09:13:48 -05:00
Simon Cruanes
e4346b14fd refactor 2026-03-03 09:13:48 -05:00
Simon Cruanes
5e5a0d5116 fix warnings 2026-03-03 09:13:48 -05:00
Simon Cruanes
2fa7c05ebd wip: migrate to trace 0.11 and ambient-context 0.2 2026-03-03 09:13:48 -05:00
Simon Cruanes
8eda0730e9
remove dead code 2025-09-08 12:24:49 -04:00
Simon Cruanes
b778ffdac3
reduce allocations in push 2025-09-08 08:09:05 -04:00
Simon Cruanes
026465f770
reduce size of critical section
better to reverse the list without holding the lock,
as it allocates and might have to yield to another thread
or domain, pause, etc.
2025-09-08 08:08:29 -04:00
Simon Cruanes
76efa381c3
comments 2025-09-08 08:08:18 -04:00
Shon Feder
8a8299020a
Make Batch actually be thread safe 2025-09-07 23:26:20 -04:00
Shon Feder
474d43bdad
Use domain ID instead of thread ID in Eio collector
Eio programs are not generally expected to use threads for concurrency,
but they may well use different domains which we'd want to track during
debugging.
2025-09-07 23:25:25 -04: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
Simon Cruanes
d9dd7ce32c
Merge pull request #103 from shonfeder/eio-fixes
Fix Eio collector to work accross domains
2025-09-02 09:26:18 -04:00
Shon Feder
ddbdc80d57
make Eio collector thread safe
The backend cannot take a switch, because switches cannot be shared
across domains, but the backend is accessed across domains from a global
variable.
2025-08-01 13:56:50 -04:00
Shon Feder
7cdadfaeeb
Fix exception message 2025-08-01 13:56:50 -04:00
ajbt200128
fbb280974a feat: add Logs integration
This PR upstreams the logs integration I wrote for Semgrep, and that
we've been using succesfully for months!
2025-07-31 14:25:52 -07: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
Shon Feder
69d15df4f1
Fix deps 2025-07-14 12:34:39 -04:00
Shon Feder
94772c7fe4
Fix GitHub actions for Ocaml5 specific tests
Co-authored-by: Puneeth Chaganti <punchagan@muse-amuse.in>
2025-07-12 00:30:31 -04:00
Shon Feder
7746c871c2
Add Eio collector 2025-07-12 00:30:31 -04:00
Shon Feder
a71fc32091
Fix docs 2025-07-11 17:57:49 -04:00
Shon Feder
87cfd5e31e
Add test harness for instrumented applications 2025-07-08 21:30:03 -04:00
Shon Feder
a44e0cd3b5
Add common type for signals 2025-07-08 21:28:55 -04:00
Shon Feder
00840e0b88
Add pretty printer utils
These combinators seem tiny, but they simpflify code where they are used
quite a lot.
2025-07-08 21:28:55 -04:00
Shon Feder
33104f231e
Add Signal.Decode module
For testing
2025-07-08 21:28:55 -04:00
Shon Feder
916b962c43
Expose default_url in config
No reason to keep this value hidden, and we want to reuse it for tests.
2025-07-08 21:28:55 -04:00
Shon Feder
39920ed109
Fix Signal encoder name choice
Don't know why I didn't opt for this clearer name originally.
2025-07-08 21:28:55 -04:00
Shon Feder
d3235a1864
Remove unneeded encoder reset
We reset the encoder if we are reusing one, and we generate a fresh new
one otherwise.
2025-07-08 21:28:55 -04:00
Shon Feder
8b48843459
Correct size and optimize representation
Since we need to traverse the elements added to count up the new size,
we can use that pass to add the elements onto our FIFO queue, and then
drain the queue in one last pass to reverse. IIUC, this should give us
liner complexity of the batch retrieval.
2025-06-30 22:52:49 -04:00
Shon Feder
31a712dd30
Allowing configuring start time 2025-06-30 22:28:30 -04:00
Shon Feder
18f58c3ac5
Allow configuring high_watermark 2025-06-30 22:01:13 -04:00
Shon Feder
ca31707395
Factor batching logic out of the cohttp-lwt client
This will allow resuing the batching logic in the Eio client.
As a followup, we should refactor the ocurl client to use the same
batcher.
2025-06-27 21:48:55 -04:00
Simon Cruanes
4ee29d8504 feat: add Globals.service_version 2025-06-23 09:32:59 -04:00
Simon Cruanes
f8d4ac7c3c
fix: make sure we clear out the encoder when reusing it 2025-06-23 09:32:33 -04:00
Shon Feder
8f7d74f591
Allow optional reuse of encoder state
This allows clien implementors to micromanage the state of the protobuf
`encoder` if they want, or to just let the library handle allocation and
garbage collection of encoder states when that level of resource
managment is not required.
2025-06-20 16:19:55 -04:00
Shon Feder
740a142581
Use application operator 2025-06-18 18:36:16 -04:00
Shon Feder
cad4835449
Fix type aliases 2025-06-18 18:35:37 -04:00
Shon Feder
a5617571f4
Add comment about scope 2025-06-18 18:33:46 -04:00
Shon Feder
b303fb5b1c
Use dummies 2025-06-18 18:31:39 -04:00
Shon Feder
52377b0a03
Factor out signal encoding logic 2025-06-16 23:34:45 -04:00
Shon Feder
0045a97e34
Move Self_trace module into Opentelemetry_client 2025-06-15 22:22:44 -04:00
Shon Feder
5c0691439e
Remove unneeded indirection
The `tick_common` function is only used once.
Removing the indirection also lets us see that we were calling
`sample_gc_metrics_if_needed` twice in a row on each tick.
2025-06-15 19:31:02 -04:00