From e88bf5f27a3fb3cbcdcfd8a6dffd6204ac580d2f Mon Sep 17 00:00:00 2001 From: Steve Flanders Date: Tue, 30 Jan 2024 23:01:46 -0500 Subject: [PATCH] Update opentelemetry-instrument README (#2108) * Update opentelemetry-instrument README - Clarify trace versus metric documentation - Add console exporter documentation - Add quotes to command to support zsh - Fix grammatical errors * fix typo * fix typo * Remove note on HTTP for trace only --------- --- opentelemetry-instrumentation/README.rst | 50 +++++++++++++----------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index df21ce5b3d..6f66edb623 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -14,7 +14,7 @@ Installation pip install opentelemetry-instrumentation -This package provides a couple of commands that help automatically instruments a program: +This package provides commands that help automatically instrument a program: .. note:: You need to install a distro package to get auto instrumentation working. The ``opentelemetry-distro`` @@ -22,7 +22,7 @@ This package provides a couple of commands that help automatically instruments a For more info about ``opentelemetry-distro`` check `here `__ :: - pip install opentelemetry-distro[otlp] + pip install "opentelemetry-distro[otlp]" When creating a custom distro and/or configurator, be sure to add entry points for each under `opentelemetry_distro` and `opentelemetry_configurator` respectfully. If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` environment variables. @@ -33,13 +33,14 @@ opentelemetry-bootstrap :: - opentelemetry-bootstrap --action=install|requirements + opentelemetry-bootstrap [-a |--action=][install|requirements] -This commands inspects the active Python site-packages and figures out which -instrumentation packages the user might want to install. By default it prints out -a list of the suggested instrumentation packages which can be added to a requirements.txt -file. It also supports installing the suggested packages when run with :code:`--action=install` -flag. +This command install default instrumentation packages and detects active Python site-packages +to figure out which instrumentation packages the user might want to install. By default, it +prints out a list of the default and detected instrumentation packages that can be added to a +requirements.txt file. It also supports installing the packages when run with +:code:`--action=install` or :code:`-a install` flag. All default and detectable +instrumentation packages are defined `here `. opentelemetry-instrument @@ -51,12 +52,12 @@ opentelemetry-instrument The instrument command will try to automatically detect packages used by your python program and when possible, apply automatic tracing instrumentation on them. This means your program -will get automatic distributed tracing for free without having to make any code changes -at all. This will also configure a global tracer and tracing exporter without you having to -make any code changes. By default, the instrument command will use the OTLP exporter but -this can be overridden when needed. +will get automatic distributed tracing without having to make any code changes. This will +also configure a global tracer and tracing exporter as well as a meter and meter exporter. +By default, the instrument command will use the OTLP exporter but this can be overridden. -The command supports the following configuration options as CLI arguments and environment vars: +The command supports the following configuration options as CLI arguments and environment +variables: * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER`` @@ -64,27 +65,32 @@ The command supports the following configuration options as CLI arguments and en * ``--distro`` or ``OTEL_PYTHON_DISTRO`` * ``--configurator`` or ``OTEL_PYTHON_CONFIGURATOR`` -Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter -names (see below). +The exporter options define what exporter destination to use and can be set to one or more +exporter names (see below). You can pass multiple values to configure multiple exporters +(e.g., ``zipkin_json,otlp``). - Defaults to `otlp`. - Can be set to `none` to disable automatic tracer initialization. + - Can be set to 'console` to display JSON results locally. -You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus`` - -Well known trace exporter names: +Trace exporter names: - jaeger_proto - jaeger_thrift - opencensus + - otlp + - otlp_proto_grpc (`deprecated`) + - otlp_proto_http (`deprecated`) - zipkin_json - zipkin_proto + +Metric exporter names: + - otlp - otlp_proto_grpc (`deprecated`) - - otlp_proto_http (`deprecated`) + - prometheus Note: The default transport protocol for ``otlp`` is gRPC. -HTTP is currently supported for traces only, and should be set using ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf`` * ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR`` @@ -106,9 +112,9 @@ Examples :: - opentelemetry-instrument --traces_exporter otlp flask run --port=3000 + opentelemetry-instrument --traces_exporter console flask run --port=3000 -The above command will pass ``--traces_exporter otlp`` to the instrument command and ``--port=3000`` to ``flask run``. +The above command will pass ``--traces_exporter console`` to the instrument command and ``--port=3000`` to ``flask run``. ::