Open gsakkis opened 7 months ago
We can always improve the documentation to make things explicit. However, opentelemetry-bootstrap
and open telemetry-instrument
exist for different purposes. The first installs default instrumentation packages and detects active Python site packages to determine which the user might want to install. The instrument command will try to automatically detect packages used by your Python program and, when possible, apply automatic tracing instrumentation on them. I don't think we want to mixup those two things in opentelemetry-instrument
.
In the docs here we have this note:
You need to install a distro package to get auto instrumentation working. The opentelemetry-distro package contains the default distro and configurator and automatically configures some of the common options for users.
After wasting half a day trying to figure out why even the simplest auto instrumentation examples for several different frameworks don't work (i.e. they don't emit anything to the console or the OTEL collector), I eventually found the reason: the
opentelemetry-distro
package was not installed. So two issues:The opentelemetry-distro package installs the API, SDK, and the opentelemetry-bootstrap and opentelemetry-instrument tools
and then proceed to describe theopentelemetry-bootstrap
command, which seems like a "quick start" shortcut that installs a bunch ofopentelementry-*
packages that I don't care for. All I (thought I) needed wasopentelemetry-instrument
and a few handpicked packages for the libraries/frameworks I want to instrument (plus their dependencies). It is not obvious at all thatopentelemetry-distro
is required for auto instrumentation.opentelemetry-instrument
, it just defaults to a no-op. I'd expect the auto instrumentation logic that currently lives inopentelemetry-bootstrap
to be inopentelemetry-instrument
, or if for some reason that's not possible or desirable, to get at least a warning if it's missing.