mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04: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 :
|
val send :
|
||||||
t ->
|
t ->
|
||||||
|
config:Config.t ->
|
||||||
path:string ->
|
path:string ->
|
||||||
decode:[ `Dec of Pbrt.Decoder.t -> 'a | `Ret of 'a ] ->
|
decode:[ `Dec of Pbrt.Decoder.t -> 'a | `Ret of 'a ] ->
|
||||||
string ->
|
string ->
|
||||||
|
|
@ -79,8 +80,9 @@ end = struct
|
||||||
let cleanup _self = ()
|
let cleanup _self = ()
|
||||||
|
|
||||||
(* send the content to the remote endpoint/path *)
|
(* send the content to the remote endpoint/path *)
|
||||||
let send (_self : t) ~path ~decode (bod : string) : ('a, error) result Lwt.t =
|
let send (_self : t) ~(config : Config.t) ~path ~decode (bod : string) :
|
||||||
let full_url = !url ^ path in
|
('a, error) result Lwt.t =
|
||||||
|
let full_url = config.url ^ path in
|
||||||
let uri = Uri.of_string full_url in
|
let uri = Uri.of_string full_url in
|
||||||
|
|
||||||
let open Cohttp in
|
let open Cohttp in
|
||||||
|
|
@ -289,7 +291,7 @@ let mk_emitter ~stop ~(config : Config.t) () : (module EMITTER) =
|
||||||
Pbrt.Encoder.reset encoder;
|
Pbrt.Encoder.reset encoder;
|
||||||
encode x encoder;
|
encode x encoder;
|
||||||
let data = Pbrt.Encoder.to_string encoder in
|
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
|
match r with
|
||||||
| Ok () -> Lwt.return ()
|
| Ok () -> Lwt.return ()
|
||||||
| Error `Sysbreak ->
|
| Error `Sysbreak ->
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue