Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe4f341

Browse files
Andrew Xuesjbrunstc24t
authored
ext/cloudtrace: added more Cloud Trace troubleshooting tips (open-telemetry#827)
Co-authored-by: Shawn Brunsting <[email protected]> Co-authored-by: Chris Kleinknecht <[email protected]>
1 parent 02b1968 commit fe4f341

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

docs/examples/cloud_monitoring/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ To use this exporter you first need to:
2222
2323
* Run example
2424

25-
.. code-block:: sh
26-
27-
python basic_metrics.py
25+
.. literalinclude:: basic_metrics.py
26+
:language: python
27+
:lines: 1-
2828

2929
Viewing Output
3030
--------------------------

docs/examples/cloud_trace_exporter/README.rst

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Basic Example
88
-------------
99

1010
To use this exporter you first need to:
11-
* A Google Cloud project. You can `create one here. <https://console.cloud.google.com/projectcreate>`_
12-
* Enable Cloud Trace API (aka Stackdriver Trace API) in the project `here. <https://console.cloud.google.com/apis/library?q=cloud_trace>`_
13-
* Enable `Default Application Credentials. <https://developers.google.com/identity/protocols/application-default-credentials>`_
11+
* A Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
12+
* Enable Cloud Trace API (listed in the Cloud Console as Stackdriver Trace API) in the project `here <https://console.cloud.google.com/apis/library?q=cloud%20trace&filter=visibility:public>`_.
13+
* If the page says "API Enabled" then you're done! No need to do anything.
14+
* Enable Default Application Credentials by creating setting `GOOGLE_APPLICATION_CREDENTIALS <https://cloud.google.com/docs/authentication/getting-started>`_ or by `installing gcloud sdk <https://cloud.google.com/sdk/install>`_ and calling ``gcloud auth application-default login``.
1415

1516
* Installation
1617

@@ -20,12 +21,11 @@ To use this exporter you first need to:
2021
pip install opentelemetry-sdk
2122
pip install opentelemetry-exporter-cloud-trace
2223
23-
* Run example locally
24+
* Run an example locally
2425

25-
.. code-block:: sh
26-
27-
cd opentelemetry-python/docs/examples/cloud_trace_exporter
28-
python basic_trace.py
26+
.. literalinclude:: basic_trace.py
27+
:language: python
28+
:lines: 1-
2929

3030
Checking Output
3131
--------------------------
@@ -47,4 +47,33 @@ Running basic_trace.py hangs:
4747

4848
Getting error ``google.api_core.exceptions.ResourceExhausted: 429 Resource has been exhausted``:
4949
################################################################################################
50-
* Check that you've enabled the `Cloud Trace (Stackdriver Trace) API <https://console.cloud.google.com/apis/library?q=cloud_trace>`_
50+
* Check that you've enabled the `Cloud Trace (Stackdriver Trace) API <https://console.cloud.google.com/apis/library?q=cloud%20trace&filter=visibility:public>`_
51+
52+
bash: pip: command not found:
53+
#############################
54+
* `Install pip <https://cloud.google.com/python/setup#installing_python>`_
55+
* If your machine uses python2 by default, pip will also be the python2 version. Try using ``pip3`` instead of ``pip``.
56+
57+
pip install is hanging
58+
######################
59+
Try upgrading pip
60+
61+
.. code-block:: sh
62+
63+
pip install --upgrade pip
64+
65+
``pip install grcpio`` has been known to hang when you aren't using an upgraded version.
66+
67+
ImportError: No module named opentelemetry
68+
##########################################
69+
Make sure you are using python3. If
70+
71+
.. code-block:: sh
72+
73+
python --version
74+
75+
returns ``Python 2.X.X`` try calling
76+
77+
.. code-block:: sh
78+
79+
python3 basic_trace.py

0 commit comments

Comments
 (0)