Skip to content

Commit

Permalink
Merge pull request #5249 from robhoes/oil2
Browse files Browse the repository at this point in the history
Add tracing for xe calls in the CLI server
  • Loading branch information
robhoes authored Nov 21, 2023
2 parents f907a7e + 1a694d7 commit fca094e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ocaml/idl/datamodel_lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ let prototyped_of_message = function
| "host", "set_https_only" ->
Some "22.27.0"
| "VM", "restart_device_models" ->
Some "23.29.0-next"
Some "23.30.0"
| "pool", "set_ext_auth_max_threads" ->
Some "23.27.0"
| "pool", "set_local_auth_max_threads" ->
Expand Down
7 changes: 7 additions & 0 deletions ocaml/libs/tracing/tracing.mli
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ val get_tracer_providers : unit -> TracerProvider.t list

val get_tracer : name:string -> Tracer.t

val with_tracing :
?attributes:(string * string) list
-> ?parent:Span.t option
-> name:string
-> (Span.t option -> 'a)
-> 'a

module Export : sig
val set_export_interval : float -> unit

Expand Down
3 changes: 2 additions & 1 deletion ocaml/xapi-cli-server/xapi_cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ let do_rpcs _req s username password minimal cmd session args =
try
let generic_rpc = get_rpc () in
(* NB the request we've received is for the /cli. We need an XMLRPC request for the API *)
let req = Xmlrpc_client.xmlrpc ~version:"1.1" "/" in
Tracing.with_tracing ~name:("xe " ^ cmdname) @@ fun tracing ->
let req = Xmlrpc_client.xmlrpc ~version:"1.1" ~tracing "/" in
let rpc = generic_rpc req s in
if do_forward then
with_session ~local:false rpc username password session (fun sess ->
Expand Down

0 comments on commit fca094e

Please sign in to comment.