# osprofiler.drivers package

## Submodules

## osprofiler.drivers.base module

class osprofiler.drivers.base.Driver(connection_str, project=None, service=None, host=None, **kwargs)

  Bases: `object`

  Base Driver class.

  This class provides protected common methods that do not rely on a specific storage backend. Public methods notify() and/or get_report(), which require using storage backend API, must be overridden and implemented by any class derived from this class.

  default_trace_fields = {'base_id', 'timestamp'}
  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Forms and returns report composed from the stored notifications.

    Parameters:

      base_id – Base id of trace elements.

  list_error_traces()

    Query all error traces from the storage.

    :return List of traces, where each trace is a dictionary containing

      base_id and timestamp.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(info, **kwargs)

    This method will be called on each notifier.notify() call.

    To add new drivers you should, create new subclass of this class and implement notify method.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from the backend. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

osprofiler.drivers.base.get_driver(connection_string, *args, **kwargs)

  Create driver’s instance according to specified connection string

## osprofiler.drivers.elasticsearch_driver module

class osprofiler.drivers.elasticsearch_driver.ElasticsearchDriver(connection_str, index_name='osprofiler-notifications', project=None, service=None, host=None, conf=<oslo_config.cfg.ConfigOpts object>, **kwargs)

  Bases: `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Retrieves and parses notification from Elasticsearch.

    Parameters:

      base_id – Base id of trace elements.

  list_error_traces()

    Returns all traces that have error/exception.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(info)

    Send notifications to Elasticsearch.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from Elasticsearch. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

  notify_error_trace(info)

    Store base_id and timestamp of error trace to a separate index.

## osprofiler.drivers.jaeger module

class osprofiler.drivers.jaeger.Jaeger(connection_str, project=None, service=None, host=None, conf=<oslo_config.cfg.ConfigOpts object>, **kwargs)

  Bases: `Driver`

  create_span_tags(payload)

    Create tags for OpenTracing span.

    Parameters:

      info – Information from OSProfiler trace.

    Returns tags:

      A dictionary contains standard tags from OpenTracing sematic conventions, and some other custom tags related to http, db calls.

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Please use Jaeger Tracing UI for this task.

  list_error_traces()

    Please use Jaeger Tracing UI for this task.

  list_traces(fields=None)

    Please use Jaeger Tracing UI for this task.

  notify(payload)

    This method will be called on each notifier.notify() call.

    To add new drivers you should, create new subclass of this class and implement notify method.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from the backend. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

## osprofiler.drivers.loginsight module

Classes to use VMware vRealize Log Insight as the trace data store.

class osprofiler.drivers.loginsight.LogInsightClient(host, username, password, api_port=9000, api_ssl_port=9543, query_timeout=60000)

  Bases: `object`

  A minimal Log Insight client.

  CURRENT_SESSIONS_PATH = 'api/v1/sessions/current'
  EVENTS_INGEST_PATH = 'api/v1/events/ingest/F52D775B-6017-4787-8C8A-F21AE0AEC057'
  LI_OSPROFILER_AGENT_ID = 'F52D775B-6017-4787-8C8A-F21AE0AEC057'
  QUERY_EVENTS_BASE_PATH = 'api/v1/events'
  SESSIONS_PATH = 'api/v1/sessions'
  login()
  query_events(params)
  send_event(event)

class osprofiler.drivers.loginsight.LogInsightDriver(connection_str, project=None, service=None, host=None, **kwargs)

  Bases: `Driver`

  Driver for storing trace data in VMware vRealize Log Insight.

  The driver uses Log Insight ingest service to store trace data and uses the query service to retrieve it. The minimum required Log Insight version is 3.3.

  The connection string to initialize the driver should be of the format: loginsight://<username>:<password>@<loginsight-host>

  If the username or password contains the character ‘:’ or ‘@’, it must be escaped using URL encoding. For example, the connection string to connect to Log Insight server at 10.1.2.3 using username “osprofiler” and password “p@ssword” is: loginsight://osprofiler:p%40ssword@10.1.2.3

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Retrieves and parses trace data from Log Insight.

    Parameters:

      base_id – Trace base ID

  notify(info)

    Send trace to Log Insight server.

## osprofiler.drivers.messaging module

class osprofiler.drivers.messaging.Messaging(connection_str, project=None, service=None, host=None, context=None, conf=None, transport_url=None, idle_timeout=1, **kwargs)

  Bases: `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Forms and returns report composed from the stored notifications.

    Parameters:

      base_id – Base id of trace elements.

  notify(info, context=None)

    Send notifications to backend via oslo.messaging notifier API.

    Parameters:

      - info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

      - context – request context that is mostly used to specify current active user and tenant.

class osprofiler.drivers.messaging.NotifyEndpoint(oslo_messaging, base_id)

  Bases: `object`

  get_last_read_time()
  get_messages()
  info(ctxt, publisher_id, event_type, payload, metadata)

exception osprofiler.drivers.messaging.SignalExit

  Bases: `BaseException`

osprofiler.drivers.messaging.signal_handler(signum, frame, state)

## osprofiler.drivers.mongodb module

class osprofiler.drivers.mongodb.MongoDB(connection_str, db_name='osprofiler', project=None, service=None, host=None, **kwargs)

  Bases: `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Retrieves and parses notification from MongoDB.

    Parameters:

      base_id – Base id of trace elements.

  list_error_traces()

    Returns all traces that have error/exception.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(info)

    Send notifications to MongoDB.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from MongoDB. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

  notify_error_trace(data)

    Store base_id and timestamp of error trace to a separate db.

## osprofiler.drivers.otlp module

class osprofiler.drivers.otlp.OTLP(connection_str, project=None, service=None, host=None, conf=<oslo_config.cfg.ConfigOpts object>, **kwargs)

  Bases: `Driver`

  create_span_tags(payload)

    Create tags an OpenTracing compatible span.

    Parameters:

      info – Information from OSProfiler trace.

    Returns tags:

      A dictionary contains standard tags from OpenTracing sematic conventions, and some other custom tags related to http, db calls.

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Forms and returns report composed from the stored notifications.

    Parameters:

      base_id – Base id of trace elements.

  list_error_traces()

    Query all error traces from the storage.

    :return List of traces, where each trace is a dictionary containing

      base_id and timestamp.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(payload)

    This method will be called on each notifier.notify() call.

    To add new drivers you should, create new subclass of this class and implement notify method.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from the backend. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

## osprofiler.drivers.redis_driver module

class osprofiler.drivers.redis_driver.Redis(connection_str, db=0, project=None, service=None, host=None, conf=<oslo_config.cfg.ConfigOpts object>, **kwargs)

  Bases: `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Retrieves and parses notification from Redis.

    Parameters:

      base_id – Base id of trace elements.

  list_error_traces()

    Returns all traces that have error/exception.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(info)

    Send notifications to Redis.

    Parameters:

      info – Contains information about trace element. In payload dict there are always 3 ids: “base_id” - uuid that is common for all notifications related to one trace. Used to simplify retrieving of all trace elements from Redis. “parent_id” - uuid of parent element in trace “trace_id” - uuid of current element in trace With parent_id and trace_id it’s quite simple to build tree of trace elements, which simplify analyze of trace.

  notify_error_trace(data)

    Store base_id and timestamp of error trace to a separate key.

class osprofiler.drivers.redis_driver.RedisSentinel(connection_str, db=0, project=None, service=None, host=None, conf=<oslo_config.cfg.ConfigOpts object>, **kwargs)

  Bases: `Redis`, `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

## osprofiler.drivers.sqlalchemy_driver module

class osprofiler.drivers.sqlalchemy_driver.SQLAlchemyDriver(connection_str, project=None, service=None, host=None, **kwargs)

  Bases: `Driver`

  classmethod get_name()

    Returns backend specific name for the driver.

  get_report(base_id)

    Forms and returns report composed from the stored notifications.

    Parameters:

      base_id – Base id of trace elements.

  list_traces(fields=None)

    Query all traces from the storage.

    Parameters:

      fields – Set of trace fields to return. Defaults to ‘base_id’ and ‘timestamp’

    Returns:

      List of traces, where each trace is a dictionary containing at least base_id and timestamp.

  notify(info, context=None)

    Write a notification the the database

## Module contents

this page last updated: 2026-03-27 00:00:00

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug