mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
fix(cohttp-lwt-client): do not override config url
This commit is contained in:
parent
9239dbe934
commit
f436a1b109
1 changed files with 5 additions and 3 deletions
|
|
@ -61,6 +61,7 @@ module Httpc : sig
|
|||
|
||||
val send :
|
||||
t ->
|
||||
config:Config.t ->
|
||||
path:string ->
|
||||
decode:[ `Dec of Pbrt.Decoder.t -> 'a | `Ret of 'a ] ->
|
||||
string ->
|
||||
|
|
@ -79,8 +80,9 @@ end = struct
|
|||
let cleanup _self = ()
|
||||
|
||||
(* send the content to the remote endpoint/path *)
|
||||
let send (_self : t) ~path ~decode (bod : string) : ('a, error) result Lwt.t =
|
||||
let full_url = !url ^ path in
|
||||
let send (_self : t) ~(config : Config.t) ~path ~decode (bod : string) :
|
||||
('a, error) result Lwt.t =
|
||||
let full_url = config.url ^ path in
|
||||
let uri = Uri.of_string full_url in
|
||||
|
||||
let open Cohttp in
|
||||
|
|
@ -289,7 +291,7 @@ let mk_emitter ~stop ~(config : Config.t) () : (module EMITTER) =
|
|||
Pbrt.Encoder.reset encoder;
|
||||
encode x encoder;
|
||||
let data = Pbrt.Encoder.to_string encoder in
|
||||
let* r = Httpc.send httpc ~path ~decode:(`Ret ()) data in
|
||||
let* r = Httpc.send httpc ~config ~path ~decode:(`Ret ()) data in
|
||||
match r with
|
||||
| Ok () -> Lwt.return ()
|
||||
| Error `Sysbreak ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue