mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
add get_url test with explicit config url
This commit is contained in:
parent
a32e8638ee
commit
329d45ee45
3 changed files with 24 additions and 2 deletions
|
|
@ -1,3 +1,6 @@
|
|||
(tests
|
||||
(names test_trace_context)
|
||||
(libraries opentelemetry))
|
||||
(names test_trace_context test_get_url)
|
||||
(libraries
|
||||
opentelemetry
|
||||
opentelemetry-client-ocurl
|
||||
opentelemetry-client-cohttp-lwt))
|
||||
|
|
|
|||
2
tests/test_get_url.expected
Normal file
2
tests/test_get_url.expected
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ocurl url = http://localhost:4318
|
||||
cohttp url = http://localhost:4318
|
||||
17
tests/test_get_url.ml
Normal file
17
tests/test_get_url.ml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
let url = "http://localhost:3000"
|
||||
|
||||
let ocurl () =
|
||||
let config = Opentelemetry_client_ocurl.Config.make ~url () in
|
||||
Opentelemetry_client_ocurl.with_setup ~config () @@ fun () ->
|
||||
let url = Opentelemetry_client_ocurl.get_url () in
|
||||
print_endline @@ Printf.sprintf "ocurl url = %s" url
|
||||
|
||||
let cohttp () =
|
||||
let config = Opentelemetry_client_cohttp_lwt.Config.make ~url () in
|
||||
Opentelemetry_client_cohttp_lwt.with_setup ~config () @@ fun () ->
|
||||
let url = Opentelemetry_client_cohttp_lwt.get_url () in
|
||||
print_endline @@ Printf.sprintf "cohttp url = %s" url
|
||||
|
||||
let () =
|
||||
ocurl ();
|
||||
cohttp ()
|
||||
Loading…
Add table
Reference in a new issue