Module Telemetry.Jsonrpc

Follow the OpenTelemetry specs for JSON RPC servers, see https://opentelemetry.io/docs/specs/semconv/rpc/json-rpc/

val trace_batch_with : service_name:string -> batch_size:int -> (Opentelemetry.Scope.t -> 'a Lwt.t) -> 'a Lwt.t

trace_batch_with ~service_name ~batch_size k traces the continuation k as the handler of a batch of size batch_size.

val trace_dispatch_with : ?websocket:bool -> service_name:string -> string -> Rpc_encodings.JSONRPC.id_repr option -> (Opentelemetry.Scope.t -> 'a Lwt.t) -> 'a Lwt.t

trace_dispatch_with ~service_name method_ id k traces the continuation k as the handler of the JSON RPC method method_ sent by a client a given id.

val return_error : Rpc_encodings.JSONRPC.error -> ('a, Rpc_encodings.JSONRPC.error) Stdlib.result Lwt.t

return_error err decorates the current scope with the attributes related to err.