Opentelemetry_client.Exporter_configConstructing and managing the configuration common to many (most?) HTTP-based clients.
This is extended and reused by concrete client implementations that exports signals over HTTP, depending on their needs.
type log_level = Opentelemetry.Self_debug.level optionNone disables internal diagnostic logging; Some level enables it at that level and above. Maps to OTEL_LOG_LEVEL env var.
opaque type to force using make while allowing record updates
type t = {debug : bool;log_level : log_level;Log level for internal diagnostics. Read from OTEL_LOG_LEVEL or falls back to OTEL_OCAML_DEBUG for compatibility.
*)sdk_disabled : bool;If true, the SDK is completely disabled and no-ops. Read from OTEL_SDK_DISABLED. Default false.
*)url_traces : string;Url to send traces/spans
*)url_metrics : string;Url to send metrics
*)url_logs : string;Url to send logs
*)headers : (string * string) list;Global API headers sent to all endpoints. Default is none or "OTEL_EXPORTER_OTLP_HEADERS" if set. Signal-specific headers can override these.
*)headers_traces : (string * string) list;Headers for traces endpoint. Merges OTEL_EXPORTER_OTLP_HEADERS with OTEL_EXPORTER_OTLP_TRACES_HEADERS (signal-specific takes precedence).
*)headers_metrics : (string * string) list;Headers for metrics endpoint. Merges OTEL_EXPORTER_OTLP_HEADERS with OTEL_EXPORTER_OTLP_METRICS_HEADERS (signal-specific takes precedence).
*)headers_logs : (string * string) list;Headers for logs endpoint. Merges OTEL_EXPORTER_OTLP_HEADERS with OTEL_EXPORTER_OTLP_LOGS_HEADERS (signal-specific takes precedence).
*)protocol : protocol;Wire protocol to use. Read from OTEL_EXPORTER_OTLP_PROTOCOL. Default Http_protobuf.
*)timeout_ms : int;General timeout in milliseconds for exporter operations. Read from OTEL_EXPORTER_OTLP_TIMEOUT. Default 10_000.
*)timeout_traces_ms : int;Timeout for trace exports. Read from OTEL_EXPORTER_OTLP_TRACES_TIMEOUT, falls back to timeout_ms.
*)timeout_metrics_ms : int;Timeout for metric exports. Read from OTEL_EXPORTER_OTLP_METRICS_TIMEOUT, falls back to timeout_ms.
*)timeout_logs_ms : int;Timeout for log exports. Read from OTEL_EXPORTER_OTLP_LOGS_TIMEOUT, falls back to timeout_ms.
*)traces : Opentelemetry.Provider_config.t;Per-provider batching config for traces. Default: batch=400, timeout=2s. The batch size is read from OTEL_BSP_MAX_EXPORT_BATCH_SIZE if set.
*)metrics : Opentelemetry.Provider_config.t;Per-provider batching config for metrics. Default: batch=200, timeout=2s. The batch size is read from OTEL_METRIC_EXPORT_INTERVAL if set.
*)logs : Opentelemetry.Provider_config.t;Per-provider batching config for logs. Default: batch=400, timeout=2s.
*)self_trace : bool;If true, the OTEL library will perform some self-instrumentation. Default false.
self_metrics : bool;If true, the OTEL library will regularly emit metrics about itself. Default false.
http_concurrency_level : int option;How many HTTP requests can be done simultaneously (at most)? This can be used to represent the size of a pool of workers where each worker gets a batch to send, send it, and repeats.
*)retry_max_attempts : int;Maximum number of retry attempts for failed exports. 0 means no retry, 1 means one retry after initial failure. Default 3.
*)retry_initial_delay_ms : float;Initial delay in milliseconds before first retry. Default 100ms.
*)retry_max_delay_ms : float;Maximum delay in milliseconds between retries. Default 5000ms.
*)retry_backoff_multiplier : float;Multiplier for exponential backoff. Default 2.0.
*)_rest : rest;}Configuration.
To build one, use make below. This might be extended with more fields in the future.
val pp : Stdlib.Format.formatter -> t -> unittype 'k make =
?debug:bool ->
?log_level:log_level ->
?sdk_disabled:bool ->
?url:string ->
?url_traces:string ->
?url_metrics:string ->
?url_logs:string ->
?batch_traces:int ->
?batch_metrics:int ->
?batch_logs:int ->
?batch_timeout_ms:int ->
?traces:Opentelemetry.Provider_config.t ->
?metrics:Opentelemetry.Provider_config.t ->
?logs:Opentelemetry.Provider_config.t ->
?headers:(string * string) list ->
?headers_traces:(string * string) list ->
?headers_metrics:(string * string) list ->
?headers_logs:(string * string) list ->
?protocol:protocol ->
?timeout_ms:int ->
?timeout_traces_ms:int ->
?timeout_metrics_ms:int ->
?timeout_logs_ms:int ->
?self_trace:bool ->
?self_metrics:bool ->
?http_concurrency_level:int ->
?retry_max_attempts:int ->
?retry_initial_delay_ms:float ->
?retry_max_delay_ms:float ->
?retry_backoff_multiplier:float ->
'kA function that gathers all the values needed to construct a t, and produces a 'k. 'k is typically a continuation used to construct a configuration that includes a t.
Example of constructed per-signal urls with the base url http://localhost:4318
Use per-signal url options if different urls are needed for each signal type.