Skip to content

Commit

Permalink
Add true auto-instrumentation support to opentelemetry-instrument
Browse files Browse the repository at this point in the history
This commit extends the instrument command so it automatically
configures tracing with a provider, span processor and exporter. Most of
the component used can be customized with env vars or CLI arguments.

Details can be found on opentelemetry-instrumentation's README package.

Fixes open-telemetry#663
  • Loading branch information
owais authored and NathanielRN committed Nov 20, 2020
1 parent 8660dea commit 20e9f18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions opentelemetry-instrumentation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ The command supports the following configuration options as CLI arguments and en
* ``--exporter`` or ``OTEL_EXPORTER``

Used to specify which trace exporter to use. Can be set to one or more
<<<<<<< HEAD
of the well-known exporter names (see below).

- Defaults to `otlp`.
- Can be set to `none` to disable automatic tracer initialization.
=======
of the well-known exporter names (see below) or a fully
qualified Python import path to a span exporter implementation.

- Defaults to `otlp`.
- Can be set to `none` to disbale automatic tracer initialization.
>>>>>>> Add true auto-instrumentation support to opentelemetry-instrument

You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus``

Expand All @@ -79,11 +87,19 @@ check `here <https://opentelemetry-python.readthedocs.io/en/stable/index.html#in

Examples
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<<< HEAD

::

opentelemetry-instrument -e otlp flask run --port=3000

=======

::

opentelemetry-instrument -e otlp flask run --port=3000

>>>>>>> Add true auto-instrumentation support to opentelemetry-instrument
The above command will pass ``-e otlp`` to the instrument command and ``--port=3000`` to ``flask run``.

::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def initialize():
if (
hasattr(sys, "argv")
and sys.argv[0].split(os.path.sep)[-1] == "celery"
<<<<<<< HEAD
and "worker" in sys.argv[1:]
=======
and "worker" in sys.argv
>>>>>>> Add true auto-instrumentation support to opentelemetry-instrument
):
from celery.signals import worker_process_init # pylint:disable=E0401

Expand Down

0 comments on commit 20e9f18

Please sign in to comment.