-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Creates a tree structure for documentation, it allows to organize it better from a developer point of view and also the rendered documentation should be easier to navigate. - Moves partially the main readme to be included in the online docs, the main readme will be updated to have a link to avoid duplicated content) - Moves the examples folder to the docs, so they can be accessed through the online documentation. Creates a new pair of "macros" to create links to specific versions, scm_web & scm_raw_web. Co-authored-by: Chris Kleinknecht <[email protected]>
- Loading branch information
1 parent
9850fb3
commit d5f3a7f
Showing
79 changed files
with
560 additions
and
372 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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.