Commit graph

90 commits

Author SHA1 Message Date
Simon Cruanes
d86b883c70
clients: setup self-debug as well 2026-03-03 17:16:04 -05:00
Simon Cruanes
e3da59dd97
per signal provider, update to trace 0.12 2026-02-27 14:56:21 -05:00
Simon Cruanes
71bb7d1996 various fixes 2026-02-17 20:59:58 -05:00
Simon Cruanes
a44c50581b
Support http/json protocol, carry protocol to HTTP emitter
- Regenerate proto bindings with yojson support
- Add JSON encoding path in Resource_signal.Encode
- Pass protocol from config to generic_http_consumer
- Set Content-Type/Accept headers based on protocol
- Remove hardcoded protobuf headers from all HTTP client implementations
- Add yojson dependency
2026-02-15 15:35:15 -05:00
Simon Cruanes
5114b6a8e7
client ocurl: handle config.sdk_disabled 2026-02-12 21:27:20 -05:00
Simon Cruanes
69d1d512e3
add missing OTEL env variables
- Rename http_config to exporter_config with deprecated alias
- add OTEL_SDK_DISABLED support (sdk_disabled field)
- add OTEL_EXPORTER_OTLP_PROTOCOL support (Http_protobuf | Http_json)
- add OTEL_LOG_LEVEL support (log_level field replacing debug bool)
- add OTEL_EXPORTER_OTLP_TIMEOUT and per-signal timeout variants
- add per-signal headers
(OTEL_EXPORTER_OTLP_{TRACES,METRICS,LOGS}_HEADERS)
- add OTEL_SERVICE_NAME support

also remove some globals and put most config in `exporter_config.ml`,
which is no longer a private record.
2026-02-12 21:04:28 -05:00
Simon Cruanes
21e799ae61 Fix ezcurl 0.3 compatibility issue
The ezcurl library changed its client type from Curl.t to Ezcurl_core.t
(an unboxed record type) in version 0.3. Updated both sync and lwt
implementations to use the correct type and module functions.
2026-02-08 07:03:43 +00:00
Simon Cruanes
f31062a602
rename batching modules 2026-01-20 00:15:30 -05:00
Simon Cruanes
c9f5a27b22
test binaries: updates 2026-01-20 00:15:26 -05:00
Simon Cruanes
dc99897e87
improvements in clients
after all the refactoring
2026-01-20 00:15:26 -05:00
Simon Cruanes
bef4bd88b2
use Clock.ptime_clock where it makes sense 2026-01-20 00:15:25 -05:00
Simon Cruanes
092b9a5d2e
have a clock in exporter, pass a mtime in tick 2026-01-20 00:15:25 -05:00
Simon Cruanes
57a915e880
chore: update dune files after implicit_trans_deps=false 2026-01-20 00:15:25 -05:00
Simon Cruanes
09e4620603
rename Client_config to Http_config
more accurate, really.
2026-01-20 00:15:24 -05:00
Simon Cruanes
bfde7700e8
ocurl: add an ?after_shutdown callback 2026-01-20 00:15:21 -05:00
Simon Cruanes
b044203b79
update HTTP clients 2026-01-20 00:15:20 -05:00
Simon Cruanes
87ccde2783
stray debug msg 2026-01-20 00:15:20 -05:00
Simon Cruanes
0bf561b586
update client libraries, remove stop:bool atomic in favor of switches 2026-01-20 00:15:20 -05:00
Simon Cruanes
61f17fa6ce
better exporter/emitter combinators; better cleanup (now shutdown) 2026-01-20 00:15:19 -05:00
Simon Cruanes
9f5506c1ee
refactor 2026-01-20 00:15:18 -05:00
Simon Cruanes
f1ee6141a5
refactor ocurl, ocurl_lwt, cohttp_lwt clients to use generic consumer 2026-01-20 00:15:17 -05:00
Simon Cruanes
1a0ba5fc9e
use backoff in ocurl clients 2026-01-20 00:15:17 -05:00
Simon Cruanes
f519f2f49f
detail 2026-01-20 00:15:17 -05:00
Simon Cruanes
db423c1b79
feat client-ocurl: port to just being a consumer
the rest is reusable components from opentelemetry-client
2026-01-20 00:15:16 -05:00
Simon Cruanes
4f218b31ef
mor efixes 2026-01-20 00:15:14 -05:00
Simon Cruanes
723b523af5
feat: use a pbrt encoder pool in client-ocurl 2026-01-20 00:15:11 -05:00
Simon Cruanes
6f96d5271a
feat client-ocurl: use common batch and queue; remove layer of queueing
now we modify batches on the fly when we send signals; but there
still is a thread pool to send signals via HTTP.
2026-01-20 00:15:10 -05:00
Simon Cruanes
f000c11406
update the emit test so it records how many bytes were emitted 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
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
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
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
8511f547d7
Fix name of library
Matches the convention in /src/trace/dune and prevents dependency on
the library from polluting the global namespace of a component with the
generic `Client` module.
2025-06-10 18:11:30 -04:00
Shon Feder
90fa0ba3b7
Add pp implemtation for Client_ocurl.Config 2025-06-10 18:00:04 -04:00
Shon Feder
ec0efec681
Rename Env sig to ENV 2025-06-10 17:47:56 -04:00
Shon Feder
d62f680fc3
Refactor client configuration
Enabling sharing all common configuration logic
2025-06-10 00:40:13 -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
Antonin Décimo
b2e62d527e fix: opentelemetry-client-ocurl: don't block signals on Windows
As of OCaml 5.3, the OCaml runtime doesn't support signals on
Windows. Trying to block them with Thread.sigmask will raise:

    Thread 5 killed on uncaught exception Invalid_argument("Thread.sigmask not implemented")
    Raised by primitive operation at Opentelemetry_client_ocurl.start_bg_thread.run in file "src/client-ocurl/opentelemetry_client_ocurl.ml", line 106, characters 12-49
2025-03-27 09:28:48 -04:00
Simon Cruanes
3d3cf8c02c
fix otel-client-ocurl: use ptime timestamps for self metrics 2025-03-14 10:00:54 -04:00
Simon Cruanes
e789ecf3da cleanup 2024-10-17 13:45:28 -04:00
Simon Cruanes
308e0304e3 simplify 2024-10-17 13:45:28 -04:00
Simon Cruanes
424a82c8a5 in backends, call tick() before cleaning up
this helps flushing signals that are being batched.

close #69
2024-10-17 13:45:28 -04: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
Simon Cruanes
7629e419c8
format 2024-09-20 09:22:13 -04:00