Skip to content

Commit

Permalink
web,otel: add url to span name (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatchi authored Nov 15, 2024
1 parent 6ea2ff0 commit 9015595
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web.ml
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@ module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with
]
in
let explicit_span =
let span_name = Printf.sprintf "%s %s" action_name url in
(* We set the value of `__FUNCTION__` to preserve the build with OCaml < 4.12. *)
Possibly_otel.enter_manual_span
~__FUNCTION__:"Devkit.Web.Http.http_request'" ~__FILE__ ~__LINE__ ~data:describe action_name in
~__FUNCTION__:"Devkit.Web.Http.http_request'" ~__FILE__ ~__LINE__ ~data:describe span_name in

let headers = match Possibly_otel.Traceparent.get_ambient ~explicit_span () with
| None -> headers
Expand Down

0 comments on commit 9015595

Please sign in to comment.