Module Octez_telemetry.HTTP_client

Follow the OpenTelemetry specs for HTTP client, see https://opentelemetry.io/docs/specs/semconv/http/http-spans

val call_service : Tezos_rpc_http.Media_type.t Tezos_base.TzPervasives.trace -> ?logger:Tezos_rpc_http_client_unix.RPC_client_unix.logger -> ?headers:(string * string) Tezos_base.TzPervasives.trace -> base:Uri.t -> ([< Resto.meth ], unit, 'a, 'b, 'c, 'd) Tezos_rpc.Service.t -> 'a -> 'b -> 'c -> 'd Tezos_base.TzPervasives.tzresult Lwt.t

call_service media_types ?logger ?headers ~base service params query body makes an HTTP request to the specified RPC service with OpenTelemetry tracing.

This function follows the OpenTelemetry semantic conventions for HTTP client spans, automatically setting appropriate attributes like HTTP method, URL, status code, etc. It also adds the header traceparent to allow traces across different services.

  • parameter media_types

    List of accepted media types for the request

  • parameter logger

    Optional logger for RPC client operations

  • parameter headers

    Optional additional HTTP headers to include in the request

  • parameter base

    The base URI to which the request will be sent

  • parameter service

    The RPC service definition

  • parameter params

    The path parameters for the service

  • parameter query

    The query parameters for the service

  • parameter body

    The request body

  • returns

    The result of the RPC call, wrapped in the Tezos error monad