-
Notifications
You must be signed in to change notification settings - Fork 711
Improve docs structure #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
c24t
merged 12 commits into
open-telemetry:master
from
mauriciovasquezbernal:improve-docsv1
Mar 10, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f1b1f0c
Improve docs
mauriciovasquezbernal eb9198e
more improvemnts to documents
mauriciovasquezbernal 9145172
fix tests for examples
mauriciovasquezbernal fba61f0
one more
mauriciovasquezbernal 7db34bb
fix lint
mauriciovasquezbernal 3724c98
disable warnings as errors in docs target
mauriciovasquezbernal 0529ed6
simple fixes
mauriciovasquezbernal 0b4e89c
update repo url
mauriciovasquezbernal 0d56707
improve metrics example
mauriciovasquezbernal a37d029
Update docs/examples/opentracing/README.rst
mauriciovasquezbernal f97b3cf
Update docs/index.rst
mauriciovasquezbernal a01766f
Update docs/index.rst
mauriciovasquezbernal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
OpenTelemetry Python API | ||
======================== | ||
|
||
.. TODO: what is the API | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
context | ||
metrics | ||
trace | ||
util.loader |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Submodules | |
|
||
.. toctree:: | ||
|
||
opentelemetry.context.context | ||
context.context | ||
|
||
Module contents | ||
--------------- | ||
|
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Basic Tracer | ||
============ | ||
|
||
This example shows how to use OpenTelemetry to instrument a Python application - e.g. a batch job. | ||
It supports exporting spans either to the console or to Jaeger_. | ||
|
||
The source files required to run this example are available :scm_web:`here <docs/examples/basic_tracer/>`. | ||
|
||
|
||
Run the application | ||
------------------- | ||
|
||
Console | ||
******* | ||
|
||
* Run the sample | ||
|
||
.. code-block:: sh | ||
|
||
$ python tracer.py | ||
|
||
The output will be displayed at the console | ||
|
||
:: | ||
|
||
Hello world from OpenTelemetry Python! | ||
Span(name="baz", context=SpanContext(trace_id=0xf906f80f64d57c71ea8da4dfbbd2ddf2, span_id=0x5611c1407e06e4d7, trace_state={}), kind=SpanKind.INTERNAL, parent=Span(name="bar", context=SpanContext(trace_id=0xf906f80f64d57c71ea8da4dfbbd2ddf2, span_id=0x1b9db0e0cc1a3f60, trace_state={})), start_time=2019-11-07T21:26:45.934412Z, end_time=2019-11-07T21:26:45.934567Z) | ||
Span(name="bar", context=SpanContext(trace_id=0xf906f80f64d57c71ea8da4dfbbd2ddf2, span_id=0x1b9db0e0cc1a3f60, trace_state={}), kind=SpanKind.INTERNAL, parent=Span(name="foo", context=SpanContext(trace_id=0xf906f80f64d57c71ea8da4dfbbd2ddf2, span_id=0x1d5d87441ec2f410, trace_state={})), start_time=2019-11-07T21:26:45.934396Z, end_time=2019-11-07T21:26:45.934576Z) | ||
Span(name="foo", context=SpanContext(trace_id=0xf906f80f64d57c71ea8da4dfbbd2ddf2, span_id=0x1d5d87441ec2f410, trace_state={}), kind=SpanKind.INTERNAL, parent=None, start_time=2019-11-07T21:26:45.934369Z, end_time=2019-11-07T21:26:45.934580Z) | ||
|
||
|
||
Jaeger | ||
****** | ||
|
||
Setup `Jaeger Tracing <https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one>`_. | ||
|
||
* Run the sample | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install opentelemetry-ext-jaeger | ||
$ EXPORTER=jaeger python tracer.py | ||
|
||
|
||
The traces should be available in the Jaeger UI at `<http://localhost:16686>`_ | ||
|
||
|
||
Collector | ||
********* | ||
|
||
* Start Collector | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install docker-compose | ||
$ cd docker | ||
$ docker-compose up | ||
|
||
* Run the sample | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install opentelemetry-ext-otcollector | ||
$ EXPORTER=collector python tracer.py | ||
|
||
|
||
Collector is configured to export to Jaeger, follow Jaeger UI instructions to find the traces. | ||
|
||
Useful links | ||
------------ | ||
|
||
- For more information on OpenTelemetry, visit OpenTelemetry_. | ||
- For more information on tracing in Python, visit Jaeger_. | ||
|
||
.. _Jaeger: https://www.jaegertracing.io/ | ||
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
HTTP Example | ||
============ | ||
|
||
This example shows how to use | ||
`OpenTelemetryMiddleware <https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-ext-wsgi>`_ | ||
and `requests <https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-ext-http-requests>`_ integrations to instrument a client and a server in Python. | ||
It supports exporting spans either to the console or to Jaeger_. | ||
|
||
The source files required to run this example are available :scm_web:`here <docs/examples/http/>`. | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install opentelemetry-api | ||
$ pip install opentelemetry-sdk | ||
$ pip install opentelemetry-ext-wsgi | ||
$ pip install opentelemetry-ext-http-requests | ||
|
||
|
||
Run the application | ||
------------------- | ||
|
||
Console | ||
******* | ||
|
||
* Run the server | ||
|
||
.. code-block:: sh | ||
|
||
$ python server.py | ||
|
||
|
||
* Run the client from a different terminal | ||
|
||
.. code-block:: sh | ||
|
||
$ python tracer_client.py | ||
|
||
|
||
The output will be displayed at the console on the client side | ||
|
||
:: | ||
|
||
Span(name="/", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x3703fd889dcdeb2b, trace_state={}), kind=SpanKind.CLIENT, parent=None, start_time=2019-11-07T21:52:59.591634Z, end_time=2019-11-07T21:53:00.386014Z) | ||
|
||
|
||
And on the server | ||
|
||
:: | ||
|
||
127.0.0.1 - - [07/Nov/2019 13:53:00] "GET / HTTP/1.1" 200 - | ||
Span(name="/wiki/Rabbit", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x4bf0be462b91d6ef, trace_state={}), kind=SpanKind.CLIENT, parent=Span(name="parent", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x68338643ccb2d53b, trace_state={})), start_time=2019-11-07T21:52:59.601597Z, end_time=2019-11-07T21:53:00.380491Z) | ||
Span(name="parent", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x68338643ccb2d53b, trace_state={}), kind=SpanKind.INTERNAL, parent=Span(name="/", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x36050ac596949bc1, trace_state={})), start_time=2019-11-07T21:52:59.601233Z, end_time=2019-11-07T21:53:00.384485Z) | ||
Span(name="/", context=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x36050ac596949bc1, trace_state={}), kind=SpanKind.SERVER, parent=SpanContext(trace_id=0x7c5c0d62031570f00fd106d968139300, span_id=0x3703fd889dcdeb2b, trace_state={}), start_time=2019-11-07T21:52:59.600816Z, end_time=2019-11-07T21:53:00.385322Z) | ||
|
||
|
||
Jaeger | ||
****** | ||
|
||
Setup `Jaeger Tracing <https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one>`_. | ||
|
||
* Run the server | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install opentelemetry-ext-jaeger | ||
$ EXPORTER=jaeger python server.py | ||
|
||
* Run the client from a different terminal | ||
|
||
.. code-block:: sh | ||
|
||
$ EXPORTER=jaeger python tracer_client.py | ||
|
||
The traces should be available in the Jaeger UI at `<http://localhost:16686>`_ | ||
|
||
Useful links | ||
------------ | ||
|
||
- For more information on OpenTelemetry, visit OpenTelemetry_. | ||
- For more information on tracing in Python, visit Jaeger_. | ||
|
||
.. _Jaeger: https://www.jaegertracing.io/ | ||
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
OpenTracing Shim Example | ||
========================== | ||
|
||
This example shows how to use the `opentelemetry-ext-opentracing-shim | ||
package <https://github.com/open-telemetry/opentelemetry-python/tree/master/ext/opentelemetry-ext-opentracing-shim>`_ | ||
to interact with libraries instrumented with | ||
`opentracing-python <https://github.com/opentracing/opentracing-python>`_. | ||
|
||
The included ``rediscache`` library creates spans via the OpenTracing Redis | ||
integration, | ||
`redis_opentracing <https://github.com/opentracing-contrib/python-redis>`_. | ||
Spans are exported via the Jaeger exporter, which is attached to the | ||
OpenTelemetry tracer. | ||
|
||
|
||
The source files required to run this example are available :scm_web:`here <docs/examples/opentracing/>`. | ||
|
||
Installation | ||
------------ | ||
|
||
Jaeger | ||
****** | ||
|
||
Setup `Jaeger Tracing <https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one>`_. | ||
|
||
Redis | ||
***** | ||
|
||
Install Redis following the `instructions <https://redis.io/topics/quickstart>`_. | ||
|
||
Make sure that the Redis server is running by executing this: | ||
|
||
.. code-block:: sh | ||
|
||
$ redis-server | ||
|
||
|
||
Python Dependencies | ||
******************* | ||
|
||
Install the Python dependencies in :scm_raw_web:`requirements.txt <docs/examples/opentracing>` | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install -r requirements.txt | ||
|
||
|
||
Alternatively, you can install the Python dependencies separately: | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install \ | ||
opentelemetry-api \ | ||
opentelemetry-sdk \ | ||
opentelemetry-ext-jaeger \ | ||
opentelemetry-opentracing-shim \ | ||
redis \ | ||
redis_opentracing | ||
|
||
|
||
Run the Application | ||
------------------- | ||
|
||
The example script calculates a few Fibonacci numbers and stores the results in | ||
Redis. The script, the ``rediscache`` library, and the OpenTracing Redis | ||
integration all contribute spans to the trace. | ||
|
||
To run the script: | ||
|
||
.. code-block:: sh | ||
|
||
$ python main.py | ||
|
||
|
||
After running, you can view the generated trace in the Jaeger UI. | ||
|
||
Jaeger UI | ||
********* | ||
|
||
Open the Jaeger UI in your browser at | ||
`<http://localhost:16686>`_ and view traces for the | ||
"OpenTracing Shim Example" service. | ||
|
||
Each ``main.py`` run should generate a trace, and each trace should include | ||
multiple spans that represent calls to Redis. | ||
|
||
Note that tags and logs (OpenTracing) and attributes and events (OpenTelemetry) | ||
from both tracing systems appear in the exported trace. | ||
|
||
Useful links | ||
------------ | ||
|
||
- For more information on OpenTelemetry, visit OpenTelemetry_. | ||
- For more information on tracing in Python, visit Jaeger_. | ||
|
||
.. _Jaeger: https://www.jaegertracing.io/ | ||
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/ |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. include:: ../../../ext/opentelemetry-ext-dbapi/README.rst | ||
|
||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: opentelemetry.ext.dbapi | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
docs/opentelemetry.ext.http_requests.rst → docs/ext/http_requests/http_requests.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. include:: ../../../ext/opentelemetry-ext-jaeger/README.rst | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: opentelemetry.ext.jaeger | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Submodules | ||
---------- | ||
|
||
.. automodule:: opentelemetry.ext.jaeger.gen.jaeger.ttypes | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!