This repository was archived by the owner on Sep 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,31 @@ This example shows how to report the traces to Stackdriver Trace:
136136 project_id = ' your_cloud_project' )
137137 tracer = tracer_module.Tracer(exporter = exporter)
138138
139+ StackdriverExporter requires the google-cloud-trace package. Install
140+ google-cloud-trace using `pip `_ or `pipenv `_:
141+
142+ ::
143+
144+ pip install google-cloud-trace
145+ pipenv install google-cloud-trace
146+
147+ By default, traces are exported synchronously, which introduces latency during
148+ your code's execution. To avoid blocking code execution, you can initialize
149+ your exporter to use a background thread.
150+
151+ This example shows how to configure Census to use a background thread:
152+
153+ .. code :: python
154+
155+ from opencensus.trace.exporters import stackdriver_exporter
156+ from opencensus.trace import tracer as tracer_module
157+ from opencensus.trace.exporters.transports.background_thread \
158+ import BackgroundThreadTransport
159+
160+ exporter = stackdriver_exporter.StackdriverExporter(
161+ project_id = ' your_cloud_project' , transport = BackgroundThreadTransport)
162+ tracer = tracer_module.Tracer(exporter = exporter)
163+
139164 Propagators
140165~~~~~~~~~~~
141166
You can’t perform that action at this time.
0 commit comments