Commit graph

850 commits

Author SHA1 Message Date
Simon Cruanes
df643c9af6
add self_debug and provider_config 2026-03-03 17:10:19 -05:00
Simon Cruanes
478fe1da7b
otel.trace: have a single collector that always use current *_provider
just use the current Trace_provider.() (resp Log, Metrics) to emit a
span (resp log, metric). Simpler, and we rely on a global exporter
anyway.
2026-03-03 15:17:27 -05:00
Simon Cruanes
fa14ddf1f8
helpers to emit in *_provider 2026-03-03 15:14:32 -05:00
Simon Cruanes
14e892454c
opam 2026-02-27 16:35:53 -05:00
Simon Cruanes
a514ff8fe2
compat 4.08 2026-02-27 14:57:32 -05:00
Simon Cruanes
e3da59dd97
per signal provider, update to trace 0.12 2026-02-27 14:56:21 -05:00
Simon Cruanes
806545f2ba
format 2026-02-21 22:37:10 -05:00
Simon Cruanes
210b7991c9
rework tracer/meter/logger interfaces
- Meter is new, and makes more sense than
Metrics_callbacks/Metrics_emitter
- Instrument in core, with some basic counters, gauges, and histograms,
+ the possibility to do one's own
2026-02-20 12:31:15 -05:00
Simon Cruanes
d5f6b564db
shortcut in clock 2026-02-20 08:55:50 -05:00
Simon Cruanes
7cc0ee1701
CI: remove gh-pages, add format 2026-02-19 15:54:17 -05:00
Simon Cruanes
cb53b54b00
trace: expose the OTEL span 2026-02-19 15:29:56 -05:00
Simon Cruanes
4387bf8287
fix missing dep 2026-02-19 15:26:31 -05:00
Simon Cruanes
07070e3d4a emitter: add self_metrics, track batch n_dropped, sampler rate 2026-02-17 20:59:58 -05:00
Simon Cruanes
71bb7d1996 various fixes 2026-02-17 20:59:58 -05:00
Simon Cruanes
126e25b5a7
Merge pull request #123 from ocaml-tracing/simon/http-retry
HTTP improvements: retry, json protocol, key renames
2026-02-15 15:53:22 -05:00
Simon Cruanes
33a0ee69ba
refactor: extract should_retry 2026-02-15 15:35:15 -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
a43587f2a6
rename hmap keys with more consistent scheme 2026-02-15 15:35:08 -05:00
Simon Cruanes
e9485c97da
Add retry with exponential backoff to HTTP client
- Add retry_max_attempts, retry_initial_delay_ms, retry_max_delay_ms, retry_backoff_multiplier to config
- Retry on network failures, 5xx errors, 429 (rate limit), 408 (timeout)
- No retry on 4xx client errors or user interrupt (Sysbreak)
- Default: 3 attempts, 100ms initial delay, 5s max delay, 2x multiplier
- Uses existing IO.sleep_s from generic_io
2026-02-15 15:17:27 -05:00
Simon Cruanes
a54593c39c
Merge pull request #122 from ocaml-tracing/simon/missing-env-vars
add missing OTEL env variables
2026-02-15 15:15:16 -05:00
Simon Cruanes
e2aa473cf9
slight refactor 2026-02-15 15:08:30 -05:00
Simon Cruanes
8b9ea57a02
tweaks 2026-02-13 20:38:03 -05:00
Simon Cruanes
649d4b8aa8
handle sdk_disabled in all clients 2026-02-12 21:33:35 -05:00
Simon Cruanes
5114b6a8e7
client ocurl: handle config.sdk_disabled 2026-02-12 21:27:20 -05:00
Simon Cruanes
ccd4c43a93
fix test 2026-02-12 21:27:05 -05:00
Simon Cruanes
103886ec83
remove obsolete test 2026-02-12 21:23:22 -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
9696dfb511
relax bounds on trace, 0.11 is the one we want 2026-02-11 14:18:34 -05:00
Simon Cruanes
6fe90a3cfe
try to fix CI 2026-02-10 22:42:25 -05:00
Simon Cruanes
6f1e1627fe
Merge pull request #117 from ocaml-tracing/simon/refactor-main-otel-api
full overhaul of the library (⚠️), with many changes and improvements to the APIs.
2026-02-10 22:36:09 -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
1ebd474423 fix: critical bugs found in code review
Bug #1: Fix worker count logic in generic_consumer
- Was: min 2 (max 500 n_workers) - always created 2 workers
- Now: max 2 (min 500 n_workers) - properly clamps between 2-500
- Impact: Worker configuration was completely ignored

Bug #2: Handle missing dot in __FUNCTION__ name
- Added exception handling for String.rindex in trace span creation
- Prevents crash when tracing top-level or non-module functions
- Uses option type for module_path when no dot is present
- Scoped try/catch to only parsing logic
2026-02-08 06:16:05 +00:00
Simon Cruanes
c29ac75a82
opentelemetry.trace: expose sum and hist metrics 2026-01-21 22:15:23 -05:00
Simon Cruanes
4183254546
update trace, fix opentelemetry.trace 2026-01-21 22:00:08 -05:00
Simon Cruanes
a3d375ce90
CI 2026-01-20 20:39:20 -05:00
Simon Cruanes
9af7e070b9
CI: trace refactor was merged into main 2026-01-20 20:24:56 -05:00
Simon Cruanes
47ce0b2efd
CI: pin+install ambient-context 2026-01-20 20:02:51 -05:00
Simon Cruanes
95fe450599
CI 2026-01-20 00:38:20 -05:00
Simon Cruanes
0c119c3eff
details 2026-01-20 00:15:31 -05:00
Simon Cruanes
ee144aec22
use an opam pin in CI 2026-01-20 00:15:31 -05:00
Simon Cruanes
26e70ed1af
refactor trace: adapt to newer trace 0.99
no more global state 🥳
2026-01-20 00:15:31 -05:00
Simon Cruanes
96aef5e021
use a separate ambient-context library 2026-01-20 00:15:31 -05:00
Simon Cruanes
0099bc5439
compat 4.08 2026-01-20 00:15:31 -05:00
Simon Cruanes
610244aad4
doc 2026-01-20 00:15:30 -05:00
Simon Cruanes
696a5d4b91
tidy up src/lib 2026-01-20 00:15:30 -05:00
Simon Cruanes
1a77e8d91e
remove matt from codeowners 2026-01-20 00:15:30 -05:00
Simon Cruanes
f31062a602
rename batching modules 2026-01-20 00:15:30 -05:00
Simon Cruanes
31aadebfd6
typo 2026-01-20 00:15:30 -05:00
Simon Cruanes
55a5d1ed88
disable nix CI for now 2026-01-20 00:15:30 -05:00
Simon Cruanes
f208a87eb8
remove Rpool, unused 2026-01-20 00:15:30 -05:00