Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,31 @@ This example shows how to report the traces to Stackdriver Trace:
project_id='your_cloud_project')
tracer = tracer_module.Tracer(exporter=exporter)

StackdriverExporter requires the google-cloud-trace package. Install
google-cloud-trace using `pip`_ or `pipenv`_:

::

pip install google-cloud-trace
pipenv install google-cloud-trace

By default, traces are exported synchronously, which introduces latency during
your code's execution. To avoid blocking code execution, you can initialize
your exporter to use a background thread.

This example shows how to configure Census to use a background thread:

.. code:: python

from opencensus.trace.exporters import stackdriver_exporter
from opencensus.trace import tracer as tracer_module
from opencensus.trace.exporters.transports.background_thread \
import BackgroundThreadTransport

exporter = stackdriver_exporter.StackdriverExporter(
project_id='your_cloud_project', transport=BackgroundThreadTransport)
tracer = tracer_module.Tracer(exporter=exporter)

Propagators
~~~~~~~~~~~

Expand Down