Expose default_url in config

No reason to keep this value hidden, and we want to reuse it for tests.
This commit is contained in:
Shon Feder 2025-06-23 17:04:59 -04:00
parent 39920ed109
commit 916b962c43
No known key found for this signature in database
2 changed files with 7 additions and 4 deletions

View file

@ -36,6 +36,8 @@ let pp out (self : t) : unit =
debug self_trace url_traces url_metrics url_logs ppheaders headers ppiopt
batch_traces ppiopt batch_metrics ppiopt batch_logs batch_timeout_ms
let default_url = "http://localhost:4318"
type 'k make =
?debug:bool ->
?url:string ->
@ -73,8 +75,6 @@ module Env () : ENV = struct
let set_debug b = debug_ := b
let default_url = "http://localhost:4318"
let make_get_from_env env_name =
let value = ref None in
fun () ->

View file

@ -38,6 +38,9 @@ type t = private {
To build one, use {!make} below. This might be extended with more fields in
the future. *)
val default_url : string
(** The default base URL for the config. *)
val pp : Format.formatter -> t -> unit
type 'k make =
@ -59,8 +62,8 @@ type 'k make =
@param url
base url used to construct per-signal urls. Per-signal url options take
precedence over this base url. Default is "http://localhost:4318", or
"OTEL_EXPORTER_OTLP_ENDPOINT" if set.
precedence over this base url. If not provided, this defaults to
"OTEL_EXPORTER_OTLP_ENDPOINT" if set, or if not {!default_url}.
Example of constructed per-signal urls with the base url
http://localhost:4318