This repository was archived by the owner on Sep 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
contrib/opencensus-ext-stackdriver
opencensus/ext/stackdriver/trace_exporter Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
33## Unreleased
4+ - Change default transporter in stackdriver exporter
5+ ([ #929 ] ( https://github.com/census-instrumentation/opencensus-python/pull/929 ) )
46
57## 0.7.3
68Released 2020-06-29
Original file line number Diff line number Diff line change @@ -35,20 +35,19 @@ This example shows how to report the traces to Stackdriver Trace:
3535 pip install google-cloud-trace
3636 pipenv install google-cloud-trace
3737
38- By default, traces are exported synchronously, which introduces latency during
39- your code's execution. To avoid blocking code execution, you can initialize
40- your exporter to use a background thread.
38+ By default, traces are exported asynchronously, to reduce latency during
39+ your code's execution. If you would like to export data on the main thread
40+ use the synchronous transporter:
4141
42- This example shows how to configure OpenCensus to use a background thread:
4342
4443.. code :: python
4544
46- from opencensus.common.transports.async_ import AsyncTransport
45+ from opencensus.common.transports.sync import SyncTransport
4746 from opencensus.ext.stackdriver import trace_exporter as stackdriver_exporter
4847 from opencensus.trace import tracer as tracer_module
4948
5049 exporter = stackdriver_exporter.StackdriverExporter(
51- project_id = ' your_cloud_project' , transport = AsyncTransport )
50+ project_id = ' your_cloud_project' , transport = SyncTransport )
5251 tracer = tracer_module.Tracer(exporter = exporter)
5352
5453 Stats
Original file line number Diff line number Diff line change 2323 k8s_utils ,
2424 monitored_resource ,
2525)
26- from opencensus .common .transports import sync
26+ from opencensus .common .transports . async_ import AsyncTransport
2727from opencensus .common .version import __version__
2828from opencensus .trace import attributes_helper , base_exporter , span_data
2929from opencensus .trace .attributes import Attributes
@@ -180,7 +180,7 @@ class StackdriverExporter(base_exporter.Exporter):
180180 """
181181
182182 def __init__ (self , client = None , project_id = None ,
183- transport = sync . SyncTransport ):
183+ transport = AsyncTransport ):
184184 # The client will handle the case when project_id is None
185185 if client is None :
186186 client = Client (project = project_id )
You can’t perform that action at this time.
0 commit comments