semvec/pypi-packages huggingface dataset:
opencensus-ext-sqlalchemy 0.1.3
OpenCensus SQLAlchemy Integration
License: Apache-2.0

OpenCensus SQLAlchemy Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-sqlalchemy.svg
   :target: https://pypi.org/project/opencensus-ext-sqlalchemy/

You can trace usage of the `sqlalchemy package`_, regardless of the underlying
database, by specifying ``'sqlalchemy'`` to ``trace_integrations``.

.. _SQLAlchemy package: https://pypi.org/project/SQLAlchemy

.. note:: If you enable tracing of SQLAlchemy as well as the underlying database
    driver, you will get duplicate spans. Instead, just trace SQLAlchemy.

Installation
------------

::

    pip install opencensus-ext-sqlalchemy

Usage
-----

.. code:: python

    from opencensus.trace import config_integration

    config_integration.trace_integrations(['sqlalchemy'])

References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-pyramid 0.7.3
OpenCensus Pyramid Integration
License: Apache-2.0

OpenCensus Pyramid Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-pyramid.svg
   :target: https://pypi.org/project/opencensus-ext-pyramid/

Installation
------------

::

    pip install opencensus-ext-pyramid

Usage
-----

In your application, add the pyramid tween and your requests will be
traced.

.. code:: python

    def main(global_config, **settings):
        config = Configurator(settings=settings)

        config.add_tween('opencensus.ext.pyramid'
                         '.pyramid_middleware.OpenCensusTweenFactory')

Additional configuration can be provided, please read
`Customization <https://github.com/census-instrumentation/opencensus-python#customization>`_
for a complete reference.

.. code:: python

    from opencensus.trace import print_exporter
    from opencensus.trace import samplers

    settings = {
        'OPENCENSUS': {
            'TRACE': {
                'EXPORTER': print_exporter.PrintExporter(),
                'SAMPLER': samplers.ProbabilitySampler(rate=0.5),
            }
        }
    }

    config = Configurator(settings=settings)

References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-pymysql 0.1.3
OpenCensus PyMySQL Integration
License: Apache-2.0

OpenCensus PyMySQL Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-pymysql.svg
   :target: https://pypi.org/project/opencensus-ext-pymysql/

Installation
------------

::

    pip install opencensus-ext-pymysql

Usage
-----

.. code:: python

    from opencensus.trace import config_integration

    config_integration.trace_integrations(['pymysql'])

References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-postgresql 0.1.3
OpenCensus PostgreSQL Integration
License: Apache-2.0

OpenCensus PostgreSQL Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-postgresql.svg
   :target: https://pypi.org/project/opencensus-ext-postgresql/

The integration with PostgreSQL supports the `psycopg2`_ library and is specified
to ``trace_integrations`` using ``'postgresql'``.

.. _psycopg2: https://pypi.org/project/psycopg2

Installation
------------

::

    pip install opencensus-ext-postgresql

Usage
-----

.. code:: python

    from opencensus.trace import config_integration

    config_integration.trace_integrations(['postgresql'])

References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-mysql 0.1.3
OpenCensus MySQL Integration
License: Apache-2.0

OpenCensus MySQL Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-mysql.svg
   :target: https://pypi.org/project/opencensus-ext-mysql/

The integration with MySQL supports the `mysql-connector`_ library and is specified
to ``trace_integrations`` using ``'mysql'``.

.. _mysql-connector: https://pypi.org/project/mysql-connector

Installation
------------

::

    pip install opencensus-ext-mysql

Usage
-----

.. code:: python

    from opencensus.trace import config_integration

    config_integration.trace_integrations(['mysql'])

References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-logging 0.1.1
OpenCensus logging Integration
License: Apache-2.0

OpenCensus logging Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-logging.svg
   :target: https://pypi.org/project/opencensus-ext-logging/

The logging integration enriches the log records with trace ID, span ID and sampling flag.
The following attributes will be added to ``LogRecord``:

    * traceId
    * spanId
    * traceSampled

Note that this only takes effect for loggers created after the integration.

Installation
------------

::

    pip install opencensus-ext-logging

Usage
-----

.. code:: python

    import logging

    from opencensus.trace import config_integration
    from opencensus.trace.samplers import AlwaysOnSampler
    from opencensus.trace.tracer import Tracer

    config_integration.trace_integrations(['logging'])
    logging.basicConfig(format='%(asctime)s traceId=%(traceId)s spanId=%(spanId)s %(message)s')
    tracer = Tracer(sampler=AlwaysOnSampler())

    logger = logging.getLogger(__name__)
    logger.warning('Before the span')
    with tracer.span(name='hello'):
        logger.warning('In the span')
    logger.warning('After the span')


References
----------

* `OpenCensus Project <https://opencensus.io/>`_
opencensus-ext-httplib 0.7.5
OpenCensus httplib Integration
License: Apache-2.0

OpenCensus httplib Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-httplib.svg
   :target: https://pypi.org/project/opencensus-ext-httplib/

OpenCensus can trace HTTP requests made with the httplib library.

You can enable requests integration by specifying ``'httplib'`` to ``trace_integrations``.

It's possible to configure a list of URL you don't want traced. See requests integration
for more information. The only difference is that you need to specify hostname and port
every time.

Installation
------------

::

    pip install opencensus-ext-httplib

Usage
-----

.. code:: python

    import requests
    from opencensus.trace import config_integration
    from opencensus.trace.tracer import Tracer

    config_integration.trace_integrations(['httplib'])
    tracer = Tracer()

    with tracer.span(name='parent'):
        response = requests.get('https://www.wikipedia.org/wiki/Rabbit')

References
----------

* `OpenCensus Project <https://opencensus.io/>`_