Skip to content

Commit 332972a

Browse files
liyanhui1228landrito
authored andcommitted
Add trace docs to main docs index (googleapis#3683)
1 parent 5b82533 commit 332972a

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
monitoring/usage
1818
logging/usage
1919
storage/client
20+
trace/index
2021
translate/usage
2122
vision/index
2223

docs/trace/apis.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ APIs
55
----
66

77
.. autosummary::
8-
:toctree:
8+
9+
.. :toctree::
910

1011
google.cloud.gapic.trace.v1.trace_service_client
1112

@@ -14,6 +15,6 @@ API types
1415
~~~~~~~~~
1516

1617
.. autosummary::
17-
:toctree:
18+
.. :toctree::
1819

1920
google.cloud.gapic.trace.v1.enums

docs/trace/starting.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Getting started
22
===============
33

4-
gapic-google-cloud-trace-v1 will allow you to connect to the `Stackdriver Trace API`_ and access all its methods. In order to achieve this, you need to set up authentication as well as install the library locally.
4+
google-cloud-trace will allow you to connect to the `Stackdriver Trace API`_ and access all its methods. In order to achieve this, you need to set up authentication as well as install the library locally.
55

66
.. _`Stackdriver Trace API`: https://developers.google.com/apis-explorer/?hl=en_US#p/cloudtrace/v1/
77

@@ -29,7 +29,7 @@ Mac/Linux
2929
pip install virtualenv
3030
virtualenv <your-env>
3131
source <your-env>/bin/activate
32-
<your-env>/bin/pip install gapic-google-cloud-trace-v1
32+
<your-env>/bin/pip install google-cloud-trace
3333
3434
Windows
3535
~~~~~~~
@@ -39,7 +39,7 @@ Windows
3939
pip install virtualenv
4040
virtualenv <your-env>
4141
<your-env>\Scripts\activate
42-
<your-env>\Scripts\pip.exe install gapic-google-cloud-trace-v1
42+
<your-env>\Scripts\pip.exe install google-cloud-trace
4343
4444
4545
Using the API
@@ -74,5 +74,20 @@ At this point you are all set to continue.
7474
Examples
7575
~~~~~~~~
7676

77-
To see example usage, please read through the :doc:`API reference </apis>`. The
78-
documentation for each API method includes simple examples.
77+
.. code-block:: python
78+
79+
from google.cloud.trace import client
80+
81+
client = client.Client(project_id='your_project_id')
82+
83+
# Patch traces, traces should be a dict
84+
client.patch_traces(traces=traces)
85+
86+
# Get trace
87+
client.get_trace(trace_id='your_trace_id')
88+
89+
# List traces
90+
traces = client.list_traces()
91+
92+
for trace in traces:
93+
print(trace)

0 commit comments

Comments
 (0)