class_docstr: Object to encapsulate the code related to handle the data requests passing to executor and its returned values
class_docstr_tok: ["Object","to","encapsulate","the","code","related","to","handle","the","data","requests","passing","to","executor","and","its","returned","values"]
code: def _init_monitoring(
      self,
      metrics_registry: Optional["CollectorRegistry"] = None,
      meter: Optional["metrics.Meter"] = None,
  ):
      if metrics_registry:
          with ImportExtensions(
              required=True,
              help_text="You need to install the `prometheus_client` to use the montitoring functionality of jina",
          ):
              from prometheus_client import Counter, Summary
  
              from jina.serve.monitoring import _SummaryDeprecated
  
              self._document_processed_metrics = Counter(
                  "document_processed",
                  "Number of Documents that have been processed by the executor",
                  namespace="jina",
                  labelnames=(
                      "executor_endpoint",
                      "executor",
                      "runtime_name",
                  ),
                  registry=metrics_registry,
              )
  
              self._request_size_metrics = _SummaryDeprecated(
                  old_name="request_size_bytes",
                  name="received_request_bytes",
                  documentation="The size in bytes of the request returned to the gateway",
                  namespace="jina",
                  labelnames=(
                      "executor_endpoint",
                      "executor",
                      "runtime_name",
                  ),
                  registry=metrics_registry,
              )
  
              self._sent_response_size_metrics = Summary(
                  "sent_response_bytes",
                  "The size in bytes of the response sent to the gateway",
                  namespace="jina",
                  labelnames=(
                      "executor_endpoint",
                      "executor",
                      "runtime_name",
                  ),
                  registry=metrics_registry,
              )
      else:
          self._document_processed_metrics = None
          self._request_size_metrics = None
          self._sent_response_size_metrics = None
  
      if meter:
          self._document_processed_counter = meter.create_counter(
              name="jina_document_processed",
              description="Number of Documents that have been processed by the executor",
          )
  
          self._request_size_histogram = meter.create_histogram(
              name="jina_received_request_bytes",
              description="The size in bytes of the request returned to the gateway",
          )
  
          self._sent_response_size_histogram = meter.create_histogram(
              name="jina_sent_response_bytes",
              description="The size in bytes of the response sent to the gateway",
          )
      else:
          self._document_processed_counter = None
          self._request_size_histogram = None
          self._sent_response_size_histogram = None
  
imports: import argparse
  import asyncio
  import functools
  import json
  import os
  import tempfile
  import threading
  import uuid
  import warnings
  from typing import TYPE_CHECKING, AsyncIterator, Dict, Generator, List, Optional, Tuple, Union
  from google.protobuf.struct_pb2 import Struct
  from jina._docarray import DocumentArray, docarray_v2
  from jina.constants import __default_endpoint__
  from jina.excepts import BadConfigSource, RuntimeTerminated
  from jina.helper import get_full_version
  from jina.importer import ImportExtensions
  from jina.proto import jina_pb2
  from jina.serve.executors import BaseExecutor
  from jina.serve.instrumentation import MetricsTimer
  from jina.serve.runtimes.worker.batch_queue import BatchQueue
  from jina.types.request.data import DataRequest, SingleDocumentRequest
label_desc: Use image node_id 6 for calling the WorkerRequestHandler obj's underlying member method code with example usage: obj._init_monitoring(metrics_registry, meter) without return types