jina.serve.instrumentation package#

Module contents#

class jina.serve.instrumentation.InstrumentationMixin[source]#

Bases: object

Instrumentation mixin for OpenTelemetery Tracing and Metrics handling

aio_tracing_server_interceptors()[source]#

Create a gRPC aio server interceptor. :rtype: Optional[Sequence[ServerInterceptor]] :returns: A service-side aio interceptor object.

aio_tracing_client_interceptors()[source]#

Create a gRPC client aio channel interceptor. :rtype: Optional[Sequence[ClientInterceptor]] :returns: An invocation-side list of aio interceptor objects.

tracing_client_interceptor()[source]#
Return type:

Optional[OpenTelemetryClientInterceptor]

Returns:

a gRPC client interceptor with the global tracing provider.

class jina.serve.instrumentation.MetricsTimer(summary_metric, histogram, histogram_metric_labels=None)[source]#

Bases: object

Helper dataclass that accepts optional Summary or Histogram recorders which are used to record the time take to execute the decorated or context managed function