mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-13 05:56:20 -04:00
Fix client and try%lwt
This commit is contained in:
parent
d096b9de46
commit
099a05498c
1 changed files with 3 additions and 4 deletions
|
|
@ -86,8 +86,7 @@ module Httpc : sig
|
||||||
val cleanup : t -> unit
|
val cleanup : t -> unit
|
||||||
end = struct
|
end = struct
|
||||||
open Opentelemetry.Proto
|
open Opentelemetry.Proto
|
||||||
open Lwt.Syntax
|
module Httpc = Cohttp_eio.Client
|
||||||
module Httpc = Cohttp_lwt_unix.Client
|
|
||||||
|
|
||||||
type t = unit
|
type t = unit
|
||||||
|
|
||||||
|
|
@ -106,9 +105,9 @@ end = struct
|
||||||
Header.(add headers "Content-Type" "application/x-protobuf")
|
Header.(add headers "Content-Type" "application/x-protobuf")
|
||||||
in
|
in
|
||||||
|
|
||||||
let body = Cohttp_lwt.Body.of_string bod in
|
let body = Cohttp_eio.Body.of_string bod in
|
||||||
let r =
|
let r =
|
||||||
try%lwt
|
try
|
||||||
let r = Httpc.post ~headers ~body uri in
|
let r = Httpc.post ~headers ~body uri in
|
||||||
Ok r
|
Ok r
|
||||||
with e -> Error e
|
with e -> Error e
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue