mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 20:07:55 -04:00
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:
parent
39920ed109
commit
916b962c43
2 changed files with 7 additions and 4 deletions
|
|
@ -36,6 +36,8 @@ let pp out (self : t) : unit =
|
||||||
debug self_trace url_traces url_metrics url_logs ppheaders headers ppiopt
|
debug self_trace url_traces url_metrics url_logs ppheaders headers ppiopt
|
||||||
batch_traces ppiopt batch_metrics ppiopt batch_logs batch_timeout_ms
|
batch_traces ppiopt batch_metrics ppiopt batch_logs batch_timeout_ms
|
||||||
|
|
||||||
|
let default_url = "http://localhost:4318"
|
||||||
|
|
||||||
type 'k make =
|
type 'k make =
|
||||||
?debug:bool ->
|
?debug:bool ->
|
||||||
?url:string ->
|
?url:string ->
|
||||||
|
|
@ -73,8 +75,6 @@ module Env () : ENV = struct
|
||||||
|
|
||||||
let set_debug b = debug_ := b
|
let set_debug b = debug_ := b
|
||||||
|
|
||||||
let default_url = "http://localhost:4318"
|
|
||||||
|
|
||||||
let make_get_from_env env_name =
|
let make_get_from_env env_name =
|
||||||
let value = ref None in
|
let value = ref None in
|
||||||
fun () ->
|
fun () ->
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ type t = private {
|
||||||
To build one, use {!make} below. This might be extended with more fields in
|
To build one, use {!make} below. This might be extended with more fields in
|
||||||
the future. *)
|
the future. *)
|
||||||
|
|
||||||
|
val default_url : string
|
||||||
|
(** The default base URL for the config. *)
|
||||||
|
|
||||||
val pp : Format.formatter -> t -> unit
|
val pp : Format.formatter -> t -> unit
|
||||||
|
|
||||||
type 'k make =
|
type 'k make =
|
||||||
|
|
@ -59,8 +62,8 @@ type 'k make =
|
||||||
|
|
||||||
@param url
|
@param url
|
||||||
base url used to construct per-signal urls. Per-signal url options take
|
base url used to construct per-signal urls. Per-signal url options take
|
||||||
precedence over this base url. Default is "http://localhost:4318", or
|
precedence over this base url. If not provided, this defaults to
|
||||||
"OTEL_EXPORTER_OTLP_ENDPOINT" if set.
|
"OTEL_EXPORTER_OTLP_ENDPOINT" if set, or if not {!default_url}.
|
||||||
|
|
||||||
Example of constructed per-signal urls with the base url
|
Example of constructed per-signal urls with the base url
|
||||||
http://localhost:4318
|
http://localhost:4318
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue