An example to demonstrate how to call Google StackDriver Trace API in PYTHON.
-
Install pip
-
Install gcloud SDK and run
gcloud init
andgcloud beta auth application-default login
-
Follow instructions on: https://pypi.python.org/pypi/gax-google-devtools-cloudtrace-v1 to set up virtual environment and install gax-google-devtools-cloudtrace-v1 package.
-
Run sample code to list_traces, get_trace, patch_traces
$ python trace_sample_gcloud.py <your GCP project id>
- If it's successful, you will see trace printed and links to view trace patched at Google Cloud Console.