Commit graph

45 commits

Author SHA1 Message Date
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
649d4b8aa8
handle sdk_disabled in all clients 2026-02-12 21:33:35 -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
f31062a602
rename batching modules 2026-01-20 00:15:30 -05:00
Simon Cruanes
3b6e239c17
debug 2026-01-20 00:15:27 -05:00
Simon Cruanes
bf7eaa97bd
setup ambient context in lwt/eio client setups 2026-01-20 00:15:27 -05:00
Simon Cruanes
46960e2021
otel-cohttp-lwt: simplify cleanup 2026-01-20 00:15:26 -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
0bf561b586
update client libraries, remove stop:bool atomic in favor of switches 2026-01-20 00:15:20 -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
a33c57a46e
wip: refactor 2026-01-20 00:15:11 -05:00
Simon Cruanes
8290b9bd81
fix warnings 2025-12-01 20:32:04 -05:00
Corentin Leruth
78dfbffe13 fix comment 2025-11-10 09:20:38 -05:00
Simon Cruanes
b2ef68536d
feat cohttp: set 'accept' header as well 2025-09-15 12:25:04 -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
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
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
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
Shon Feder
d62f680fc3
Refactor client configuration
Enabling sharing all common configuration logic
2025-06-10 00:40:13 -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
66573bd1ac
fix: compat with lwt < 5.7 2025-01-31 16:50:21 -05:00
Simon Cruanes
55977b13d8
fix: wait for cleanup in cohttp client
in `Opentelemetry_client_cohttp_lwt.with_setup` we should now wait for
the cleanup to be done, by sneaking in a `unit Lwt.u` that is only
resolved after the cleanup is done.

close #41
2024-10-17 15:06:45 -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
f0dd5a7a35 remove unused config parameter 2024-08-09 08:04:08 +02:00
Corentin Leruth
3daa0d8762 port changes to cohttp client 2024-08-05 10:00:52 +02: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
Simon Cruanes
f6afc3df1c
use ocaml-protoc 3.0.1 for codegen 2023-12-14 20:49:11 -05:00
Elliott Cable
ed90772a57 Merge branch 'master' into configurable-scope-storage
* master:
  fix ocurl: have ticker thread stop when work queue is closed
  fix get_url test to take config.url into account
  add get_url test with explicit config url
  chore: makefile
  update generated code
  opentelemetry: in Trace, change default span kind
  chore: migrate to OTEL proto files 1.0
  CI: run on 5.0; run on every branch push
  remove use of String.ends_with for compat with 4.08
  remove trailing slash from url
  shorter name for the instrumentation library
  use named signals
2023-09-20 14:47:14 +00:00
Elliott Cable
03f6f69bdd collector: Add debug-wrapping backend 2023-09-19 21:35:09 +00:00
Corentin Leruth
a62f1d891a fix get_url test to take config.url into account 2023-09-13 15:18:13 -04:00
Simon Cruanes
063c046933 remove use of String.ends_with for compat with 4.08 2023-08-31 23:44:16 -04:00
Corentin Leruth
883d4bb806 remove trailing slash from url 2023-08-31 23:44:16 -04:00
Simon Cruanes
67f4f5b9cc
Merge pull request #31 from ELLIOTTCABLE/try-lwt-over-lwt-catch
Use try%lwt over Lwt.catch
2023-06-23 14:20:06 -04:00
Simon Cruanes
8e1a69d886
enable warnings and fix them 2023-06-15 22:18:20 -04:00
Elliott Cable
3e46458499 (style lwt ppx dep) Use try%lwt over Lwt.catch 2023-06-13 22:50:52 +00:00
Simon Cruanes
bc3ecbc30c
gc metrics every 20s 2022-11-30 17:08:08 -05:00
Simon Cruanes
dbd08b7e0a
timeout-based GC metrics collection 2022-11-30 17:05:22 -05:00
Simon Cruanes
f436a1b109
fix(cohttp-lwt-client): do not override config url 2022-11-09 11:53:14 -05:00
Simon Cruanes
c3f5b36e36
feat: add opentelemetry-client-cohttp-lwt library 2022-10-03 12:20:59 -04:00