From cbd8df944a2526921b8586280dd006ffe66a63aa Mon Sep 17 00:00:00 2001 From: Stewart Reichling Date: Sat, 18 Aug 2018 08:16:09 -0700 Subject: [PATCH 1/2] Document 'google-cloud-trace' and BackgroundThreadTransport --- README.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.rst b/README.rst index 911141647..f56fe2ac5 100644 --- a/README.rst +++ b/README.rst @@ -136,6 +136,34 @@ 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 + +.. _pip: https://pip.pypa.io +.. _pipenv: https://docs.pipenv.org/ + +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 ~~~~~~~~~~~ From de615422e61fe01e78462bb2748455c68a73bbf9 Mon Sep 17 00:00:00 2001 From: Stewart Reichling Date: Thu, 23 Aug 2018 17:20:56 -0700 Subject: [PATCH 2/2] Remove re-definitions of `pip` and `pipenv` --- README.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.rst b/README.rst index f56fe2ac5..a8c44a9cf 100644 --- a/README.rst +++ b/README.rst @@ -144,9 +144,6 @@ google-cloud-trace using `pip`_ or `pipenv`_: pip install google-cloud-trace pipenv install google-cloud-trace -.. _pip: https://pip.pypa.io -.. _pipenv: https://docs.pipenv.org/ - 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.