diff --git a/src/integrations/cohttp/opentelemetry_cohttp_lwt.ml b/src/integrations/cohttp/opentelemetry_cohttp_lwt.ml index a0dee06f..12661022 100644 --- a/src/integrations/cohttp/opentelemetry_cohttp_lwt.ml +++ b/src/integrations/cohttp/opentelemetry_cohttp_lwt.ml @@ -130,7 +130,7 @@ end = struct let open Lwt.Syntax in let req = set_trace_context scope req in let* res, body = callback conn req body in - Otel.Trace.add_attrs scope (fun () -> attrs_of_response res); + Otel.Scope.add_attrs scope (fun () -> attrs_of_response res); Lwt.return (res, body)) let with_ ?trace_state ?service_name ?attrs @@ -190,7 +190,7 @@ let client ?(scope : Otel.Scope.t option) (module C : Cohttp_lwt.S.Client) = ~attrs (fun scope -> let headers = add_traceparent scope headers in let* res, body = C.call ?ctx ~headers ?body ?chunked meth uri in - Otel.Trace.add_attrs scope (fun () -> + Otel.Scope.add_attrs scope (fun () -> let code = Response.status res in let code = Code.code_of_status code in [ "http.status_code", `Int code ]); @@ -220,7 +220,7 @@ let client ?(scope : Otel.Scope.t option) (module C : Cohttp_lwt.S.Client) = ~attrs (fun scope -> let headers = add_traceparent scope headers in let* res, body = C.post_form ?ctx ~headers ~params uri in - Otel.Trace.add_attrs scope (fun () -> + Otel.Scope.add_attrs scope (fun () -> let code = Response.status res in let code = Code.code_of_status code in [ "http.status_code", `Int code ]); diff --git a/tests/bin/emit1.ml b/tests/bin/emit1.ml index 99b112a3..a9baa4d0 100644 --- a/tests/bin/emit1.ml +++ b/tests/bin/emit1.ml @@ -72,7 +72,8 @@ let run_job () = if j = 4 && !i mod 13 = 0 then failwith "oh no"; (* simulate a failure *) - T.Trace.add_event scope (fun () -> T.Event.make "done with alloc") + Opentelemetry.Scope.add_event scope (fun () -> + T.Event.make "done with alloc") with Failure _ -> () done done diff --git a/tests/bin/emit1_cohttp.ml b/tests/bin/emit1_cohttp.ml index deb5359d..5d0caf2e 100644 --- a/tests/bin/emit1_cohttp.ml +++ b/tests/bin/emit1_cohttp.ml @@ -67,7 +67,8 @@ let run_job () : unit Lwt.t = if j = 4 && !i mod 13 = 0 then failwith "oh no"; (* simulate a failure *) - T.Trace.add_event scope (fun () -> T.Event.make "done with alloc"); + Opentelemetry.Scope.add_event scope (fun () -> + T.Event.make "done with alloc"); Lwt.return () with Failure _ -> Lwt.return () done