Config.Env
val make :
(Opentelemetry_client.Config.t -> 'a) ->
'a Opentelemetry_client.Config.make
make f
is a make
function that will give f
a safely constructed t
.
Typically this is used to extend the constructor for t
with new optional arguments.
E.g., we can construct a configuration that includes a t
alongside a more specific field like so:
type extended_config = {
new_field: string;
common: t;
}
let make : (new_field:string -> unit -> extended_config) make =
Env.make (fun common ~new_field () -> { new_field; common })
let _example : extended_config =
make ~new_field:"foo" ~url_traces:"foo/bar" ~debug:true ()
As a special case, we can get the simple constructor function for t
with Env.make (fun common () -> common)