Injector
The OpenTelemetry injector, built so the Dash0 distributions can be configured through it.
How it instruments processes
The OpenTelemetry injector is a shared library that the dynamic linker loads into every process on the host, through /etc/ld.so.preload.
When it recognises a runtime it supports, it loads that runtime's automatic instrumentation into the process and applies /etc/opentelemetry/injector/default_env.conf to it.
The injector ships no automatic instrumentation.
Each language package installs its own and a drop-in in /etc/opentelemetry/injector/conf.d/ that tells the injector where it is.
dash0-opentelemetry installs the injector with all language packages.
Why this package exists
This package includes a build of the OpenTelemetry Injector to allow DASH0_-prefixed environment variables alongside upstream's OTEL_.
Limitation: replacing upstream's injector on RPM
Installing this package over an already-installed opentelemetry-injector on an RPM system leaves nothing instrumented.
The issue occurs with these steps:
- Install upstream's
opentelemetry-injectoron an RPM host, such as Fedora, RHEL or Amazon Linux 2023. - Add the Dash0 repository.
- Install
dash0-injector, ordash0-opentelemetry, which pulls it in. dnf replacesopentelemetry-injectorwithdash0-injectorin one transaction. - The transaction succeeds, but
/etc/ld.so.preloadhas no injector entry, so the injector instruments no process.
This is a consequence of rpm's ordering.
Within one transaction rpm runs the incoming package's %post before it erases the package being obsoleted, so the sequence is:
dash0-injector %post writes /etc/ld.so.preload
opentelemetry-injector %preun strips it again ← last writer winsThe upstream injector's %preun cannot tell "I am being removed" from "I am being replaced by another provider of the same interface", so it cleans up in both cases.
Only the incoming package can break the tie, with an RPM %posttrans hook that reruns the postinstall after all erasures.
DEB systems are unaffected.
dpkg removes the outgoing package before it configures the incoming one, so postinst is already the last writer and the entry survives.
Verified on debian:12.
Either of two remedies works, both verified on fedora:41:
sudo dnf remove opentelemetry-injector && sudo dnf install dash0-injector # before
sudo dnf reinstall dash0-injector # afterThe postinstall is idempotent, so the repair is safe to run at any time, and cat /etc/ld.so.preload is the whole diagnosis.
Configuration
Instead of configuring through the process environment, consider using the declarative configuration file that each language package ships: /etc/opentelemetry/<language>/otel-config.yaml.
See the "Declarative configuration" section on each language package's page for more information.
# /etc/opentelemetry/injector/default_env.conf
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingress.eu-west-1.aws.dash0.com
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20auth_...,Dash0-Dataset=defaultThe space in the Bearer <token> value of OTEL_EXPORTER_OTLP_HEADERS must be written as %20.
The injector applies default_env.conf to every process it instruments, and a variable set there replaces the value the process sets itself.
Set per-application settings, such as OTEL_SERVICE_NAME, in the environment of the application instead.
dash0-injector passes on the variables in default_env.conf whose names start with OTEL_ or DASH0_, and drops any other.
Upstream's opentelemetry-injector passes on only the OTEL_ ones.
A DEB host keeps edited configuration files when the package is removed.
On an RPM host, removing the package renames an edited injector.conf or default_env.conf to <name>.rpmsave, and installing it again writes the defaults beside it.
The injector then runs without your settings.
The install prints a warning naming each .rpmsave file it finds, but dnf -q on dnf4 hides it, so check for these files after reinstalling: merge your edits back, then delete them.
Caveats
Processes that are already running when you install the injector and the language packages are not instrumented until they restart.
The injector never instruments statically linked binaries.
The Java agent is injected only when the injector can establish a Java major version of at least 8.
It skips Java older than that, a runtime whose version it cannot determine, a JVM chosen with -XXaltjvm= or JDK_ALTERNATE_VM, and a program that embeds a JVM through the JNI Invocation API, such as jsvc.
Setting jvm_auto_instrumentation_minimum_java_major_version=0 in injector.conf turns the check off and injects into every process.
The injector writes its messages to the standard error of the process it is loaded into, starting with [otel-injector].
By default it writes errors only.
To see why it skipped a process, start that process with OTEL_INJECTOR_LOG_LEVEL=info in its environment.
Installed files
| Path | Purpose |
|---|---|
/usr/lib/opentelemetry/injector/libotelinject.so | The injector library |
/etc/opentelemetry/injector/injector.conf | The injector's own settings; a conffile, so an edited copy is kept on upgrade |
/etc/opentelemetry/injector/default_env.conf | The environment variables applied to every instrumented process; a conffile, so an edited copy is kept on upgrade |
/usr/share/man/man8/opentelemetry-injector.8.gz | The manual page, for man opentelemetry-injector |
/usr/share/doc/dash0-injector/README.md | The installed copy of this page |
/usr/share/doc/dash0-injector/copyright | The license statement and the notice, DEB only |
/usr/share/licenses/dash0-injector/LICENSE | The license, RPM only |
/usr/share/licenses/dash0-injector/NOTICE | The notice, RPM only |
Installing the package also adds the library to /etc/ld.so.preload, and removing it takes the entry out again.
The language packages add their drop-ins to /etc/opentelemetry/injector/conf.d/.
Dependencies
| Package | Relation | Why |
|---|---|---|
dash0-keyring | Depends | Every Dash0 package depends on it, so the signing certificate is owned by a package that upgrades it |
opentelemetry-injector | Conflicts, and Replaces on DEB or Obsoletes on RPM | Takes the place of upstream's injector; see Limitation: replacing upstream's injector on RPM |
Last updated: