Skip to content

Commit 6713d90

Browse files
authored
Update example setup instructions for getting GCP credentials (#247)
* Update example setup instructions for ADC * "Enable" -> "Set up"
1 parent 48aef5f commit 6713d90

6 files changed

Lines changed: 58 additions & 34 deletions

File tree

docs/examples/cloud_monitoring/README.rst

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

1010
To use this exporter you first need to:
11-
* `Create a Google Cloud project <https://console.cloud.google.com/projectcreate>`_.
12-
* Enable the Cloud Monitoring API (aka Stackdriver Monitoring API) in the project `here <https://console.cloud.google.com/apis/library?q=cloud_monitoring>`_.
13-
* Enable `Default Application Credentials <https://developers.google.com/identity/protocols/application-default-credentials>`_.
11+
12+
* `Create a Google Cloud project <https://console.cloud.google.com/projectcreate>`_.
13+
* Set up `Application Default Credentials
14+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
15+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
16+
application-default login``.
1417

1518
* Installation
1619

@@ -30,9 +33,10 @@ Viewing Output
3033
--------------------------
3134

3235
After running the example:
33-
* Go to the `Cloud Monitoring Metrics Explorer page <https://console.cloud.google.com/monitoring/metrics-explorer>`_.
34-
* In "Select a Metric" enter "workload.googleapis.com/request_counter".
35-
* You can filter by labels and change the graphical output here as well.
36+
37+
* Go to the `Cloud Monitoring Metrics Explorer page <https://console.cloud.google.com/monitoring/metrics-explorer>`_.
38+
* In "Select a Metric" enter "workload.googleapis.com/request_counter".
39+
* You can filter by labels and change the graphical output here as well.
3640

3741
Troubleshooting
3842
--------------------------
@@ -42,7 +46,7 @@ Troubleshooting
4246

4347
Currently, Cloud Monitoring allows one write every 5 seconds for any unique tuple (metric_name, metric_label_value_1, metric_label_value_2, ...). The exporter should rate limit on its own but issues arise if:
4448

45-
* You are restarting the server more than once every 5 seconds.
46-
* You have a multiple exporters (possibly on different threads) writing to the same tuple.
49+
* You are restarting the server more than once every 5 seconds.
50+
* You have a multiple exporters (possibly on different threads) writing to the same tuple.
4751

4852
For both cases, you can pass ``add_unique_identifier=True`` to the CloudMonitoringMetricsExporter constructor. This adds a UUID label_value, making the tuple unique again. For the first case, you can also choose to just wait longer than 5 seconds between restarts.

docs/examples/cloud_resource_detector/README.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ Basic Example
99
-------------
1010

1111
To use this feature you first need to:
12-
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
13-
* (If you want to send resource info to Cloud Trace) Enable `Cloud Trace API <https://console.cloud.google.com/apis/library?q=cloud%20trace&filter=visibility:public>`_ (listed in the Cloud Console as Stackdriver Trace API) in the project.
14-
* (If you want to send resource info to Cloud Monitoring) Enable the `Cloud Monitoring API <https://console.cloud.google.com/apis/library?q=cloud_monitoring>`_ (aka Stackdriver Monitoring API) in the project.
15-
* 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``.
16-
* Setup a Google tool like `Google Compute Engine <https://cloud.google.com/compute/docs/quickstart-linux>`_ (GCE) or `Google Kubernetes Engine <https://cloud.google.com/kubernetes-engine/docs/quickstart>`_ (GKE).
17-
* Run the below example in the Google tool.
12+
13+
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
14+
* Set up `Application Default Credentials
15+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
16+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
17+
application-default login``.
18+
* Setup a Google tool like `Google Compute Engine <https://cloud.google.com/compute/docs/quickstart-linux>`_ (GCE) or `Google Kubernetes Engine <https://cloud.google.com/kubernetes-engine/docs/quickstart>`_ (GKE).
19+
* Run the below example in the Google tool.
1820

1921
* Installation
2022

@@ -40,9 +42,10 @@ Checking Output
4042
--------------------------
4143

4244
After running the metrics example:
43-
* Go to the `Cloud Monitoring Metrics Explorer page <https://console.cloud.google.com/monitoring/metrics-explorer>`_.
44-
* In "Find resource type and metric" enter "OpenTelemetry/request_counter_with_resource".
45-
* You can filter by resource info and change the graphical output here as well.
45+
46+
* Go to the `Cloud Monitoring Metrics Explorer page <https://console.cloud.google.com/monitoring/metrics-explorer>`_.
47+
* In "Find resource type and metric" enter "OpenTelemetry/request_counter_with_resource".
48+
* You can filter by resource info and change the graphical output here as well.
4649

4750
Or, if you ran the tracing example, you can go to `Cloud Trace overview <https://console.cloud.google.com/traces/list>`_ to see the results.
4851

docs/examples/cloud_trace_exporter/README.rst

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

1010
To use this exporter you first need to:
11-
* Create 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>`_. If the page says "API Enabled" then you're done! No need to do anything.
13-
* 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``.
11+
12+
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
13+
* Set up `Application Default Credentials
14+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
15+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
16+
application-default login``.
17+
1418

1519
* Installation
1620

@@ -51,16 +55,19 @@ Troubleshooting
5155

5256
Running basic_trace.py hangs:
5357
#############################
54-
* Make sure you've setup Application Default Credentials. Either run ``gcloud auth application-default login`` or set the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to be a path to a service account token file.
58+
59+
* Make sure you've setup Application Default Credentials. Either run ``gcloud auth application-default login`` or set the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to be a path to a service account token file.
5560

5661
Getting error ``google.api_core.exceptions.ResourceExhausted: 429 Resource has been exhausted``:
5762
################################################################################################
58-
* Check that you've enabled the `Cloud Trace (Stackdriver Trace) API <https://console.cloud.google.com/apis/library?q=cloud%20trace&filter=visibility:public>`_
63+
64+
* Check that you've enabled the `Cloud Trace (Stackdriver Trace) API <https://console.cloud.google.com/apis/library?q=cloud%20trace&filter=visibility:public>`_
5965

6066
bash: pip: command not found:
6167
#############################
62-
* `Install pip <https://cloud.google.com/python/setup#installing_python>`_
63-
* If your machine uses python2 by default, pip will also be the python2 version. Try using ``pip3`` instead of ``pip``.
68+
69+
* `Install pip <https://cloud.google.com/python/setup#installing_python>`_
70+
* If your machine uses python2 by default, pip will also be the python2 version. Try using ``pip3`` instead of ``pip``.
6471

6572
pip install is hanging
6673
######################

docs/examples/cloud_trace_propagator/README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ Basic Example
99
-------------
1010

1111
To use this feature you first need to:
12-
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
13-
* 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>`_. 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``.
12+
13+
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
14+
* Set up `Application Default Credentials
15+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
16+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
17+
application-default login``.
18+
1519

1620
* Installation
1721

docs/examples/flask_e2e/README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ script that uses ``requests`` to call the Flask app and propagate context with t
99
propagator.
1010

1111
To run this example you first need to:
12-
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
13-
* 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>`_. 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``.
12+
13+
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
14+
* Set up `Application Default Credentials
15+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
16+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
17+
application-default login``.
1518

1619
It is also recommended to create a fresh virtualenv for running this example:
1720

docs/examples/prometheus_exemplars/README.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ traces to `Google Cloud Trace <https://cloud.google.com/trace/docs/overview>`_.
3737
}
3838

3939
To run this example you first need to:
40-
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
41-
* 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>`_. If the page says "API Enabled" then you're done! No need to do anything.
42-
* 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``.
43-
* Have docker and docker compose installed on your machine
40+
41+
* Create a Google Cloud project. You can `create one here <https://console.cloud.google.com/projectcreate>`_.
42+
* Set up `Application Default Credentials
43+
<https://cloud.google.com/docs/authentication/provide-credentials-adc>`_ by `installing
44+
gcloud <https://cloud.google.com/sdk/install>`_ and running ``gcloud auth
45+
application-default login``.
46+
* Have docker and docker compose installed on your machine
4447

4548
Attaching Prometheus Exemplars
4649
------------------------------

0 commit comments

Comments
 (0)