class_docstr: The monitor implementation to log data to OTLP endpoint.
  The otlp exporter could be configured by environment variables or
  by passing arguments to the monitor from the config file.
  For more information, please refer to:
  * https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/
  
  The sample output of the data is as follows:
  
  .. code-block:: json
  
      {
          "sepal length": 4.9,
          "sepal width": 3.0,
          "petal length": 1.4,
          "petal width": 0.2,
          "pred": "setosa",
          "timestamp": 1668660679.587727,
          "request_id": "6413930528999883196",
          "bento_meta": {
              "bento_name": "iris_classifier",
              "bento_version": "not available",
              "monitor_name": "iris_classifier_prediction",
              "schema": {
                  "sepal length": {
                      "name": "sepal length",
                      "role": "feature",
                      "type": "numerical",
                  },
                  "sepal width": {
                      "name": "sepal width",
                      "role": "feature",
                      "type": "numerical",
                  },
                  "petal length": {
                      "name": "petal length",
                      "role": "feature",
                      "type": "numerical",
                  },
                  "petal width": {
                      "name": "petal width",
                      "role": "feature",
                      "type": "numerical",
                  },
                  "pred": {"name": "pred", "role": "prediction", "type": "categorical"},
              },
          },
      }
class_docstr_tok: ["The","monitor","implementation","to","log","data","to","OTLP","endpoint",".","The","otlp","exporter","could","be","configured","by","environment","variables","or","by","passing","arguments","to","the","monitor","from","the","config","file",".","For","more","information",",","please","refer","to",":","*","https",":","\/\/opentelemetry.io\/docs\/concepts\/sdk-configuration\/otlp-exporter-configuration\/","The","sample","output","of","the","data","is","as","follows",":","..","code-block",":",":","json","{","``","sepal","length","''",":","4.9",",","``","sepal","width","''",":","3.0",",","``","petal","length","''",":","1.4",",","``","petal","width","''",":","0.2",",","``","pred","''",":","``","setosa","''",",","``","timestamp","''",":","1668660679.587727",",","``","request_id","''",":","``","6413930528999883196","''",",","``","bento_meta","''",":","{","``","bento_name","''",":","``","iris_classifier","''",",","``","bento_version","''",":","``","not","available","''",",","``","monitor_name","''",":","``","iris_classifier_prediction","''",",","``","schema","''",":","{","``","sepal","length","''",":","{","``","name","''",":","``","sepal","length","''",",","``","role","''",":","``","feature","''",",","``","type","''",":","``","numerical","''",",","}",",","``","sepal","width","''",":","{","``","name","''",":","``","sepal","width","''",",","``","role","''",":","``","feature","''",",","``","type","''",":","``","numerical","''",",","}",",","``","petal","length","''",":","{","``","name","''",":","``","petal","length","''",",","``","role","''",":","``","feature","''",",","``","type","''",":","``","numerical","''",",","}",",","``","petal","width","''",":","{","``","name","''",":","``","petal","width","''",",","``","role","''",":","``","feature","''",",","``","type","''",":","``","numerical","''",",","}",",","``","pred","''",":","{","``","name","''",":","``","pred","''",",","``","role","''",":","``","prediction","''",",","``","type","''",":","``","categorical","''","}",",","}",",","}",",","}"]
docstr: Export data. This method should be called after all data is logged.
docstr_tok: ["Export","data",".","This","method","should","be","called","after","all","data","is","logged","."]
code: def export_data(
      self,
      datas: t.Dict[str, collections.deque[JSONSerializable]],
  ) -> None:
      """
      Export data. This method should be called after all data is logged.
      """
      if self.data_logger is None:
          self._init_logger()
          assert self.data_logger is not None
  
      if (
          self._will_export_schema
          or random.random() < self.meta_sample_rate
      ):
          extra_columns = {
              self.COLUMN_TIME: datetime.datetime.now().timestamp(),
              self.COLUMN_RID: str(trace_context.request_id),
              self.COLUMN_META: {
                  "bento_name": component_context.bento_name,
                  "bento_version": component_context.bento_version,
                  "monitor_name": self.name,
                  "schema": self._schema,
              },
          }
          self._will_export_schema = False
      else:
          extra_columns = {
              self.COLUMN_TIME: datetime.datetime.now().timestamp(),
              self.COLUMN_RID: str(trace_context.request_id),
          }
      while True:
          try:
              record = {k: v.popleft() for k, v in datas.items()}
              record.update(extra_columns)  # type: ignore  # pyright can not resolve backward reference correctly for JSONSerializable
              self.data_logger.info(record)
          except IndexError:
              break
  
imports: from __future__ import annotations
  import collections
  import datetime
  import logging
  import logging.config
  import os
  import random
  import typing
  from opentelemetry._logs import set_logger_provider
  from opentelemetry.sdk._logs import LoggerProvider
  from opentelemetry.sdk._logs import LoggingHandler
  from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_CERTIFICATE
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_COMPRESSION
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_ENDPOINT
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_HEADERS
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_INSECURE
  from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_TIMEOUT
  from opentelemetry.sdk.resources import Resource
  from ...exceptions import MissingDependencyException
  from ..context import component_context
  from ..context import trace_context
  from .base import MonitorBase
label_desc: Use image node_id 5 for calling the OTLPMonitor obj's underlying member method code with example usage: obj.export_data(datas) without return types