ocaml-opentelemetry/src/integrations/cohttp
2022-10-03 12:20:58 -04:00
..
dune wip: cohttp integration 2022-03-24 17:38:46 +00:00
opentelemetry_cohttp_lwt.ml comments for cohttp 2022-10-03 12:20:58 -04:00
README.md refactor(cohttp): wrap in Server module 2022-03-24 17:51:43 +00:00

Opentelemetry tracing for Cohttp_lwt servers

Wrap your server callback with Opentelemetry_cohttp_lwt.Server.trace:

let my_server callback =
  let callback =
    Opentelemetry_cohttp_lwt.Server.trace ~service_name:"my-service" callback in
  Cohttp_lwt_unix.Server.create ~mode:(`TCP (`Port 8080))
    (Server.make () ~callback)