Configuration

Point the OpenTelemetry Injector at your Collector or backend and control what gets instrumented on a Linux host.

আপনি এই পৃষ্ঠার ইংরেজি সংস্করণ দেখছেন কারণ এটি এখনও সম্পূর্ণভাবে অনুবাদ করা হয়নি। সাহায্য করতে আগ্রহী? দেখুন Contributing

After installing the system packages, the OpenTelemetry Injector instruments supported applications and exports telemetry using OTLP to localhost on ports 4317 (gRPC) and 4318 (HTTP) by default. This page describes how to change where telemetry is sent and how to adjust the injected configuration.

Set the export destination

The recommended setup is to run a local OpenTelemetry Collector on the host that receives this telemetry and forwards it to your backend.

To send telemetry somewhere else, the recommended way is to use a configuration file. You rarely need to write one from scratch: each language package ships a ready-to-use reference file at /etc/opentelemetry/<language>/otel-config.yaml that wires up the exporter endpoint, headers, and service name through environment-variable interpolation. Copy or adapt one of these files with your declarative configuration, then activate it by setting OTEL_CONFIG_FILE in the injector environment file at /etc/opentelemetry/injector/default_env.conf:

OTEL_CONFIG_FILE=/etc/opentelemetry/config.yaml

Restart your applications for configuration changes to take effect.

Configure with environment variables

If you prefer not to use a configuration file, you can set standard OpenTelemetry environment variables directly in the injector environment file at /etc/opentelemetry/injector/default_env.conf. Any variable set there is applied to every instrumented process. For example, to export directly to an OTLP endpoint that requires an API key:

OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.example.com
OTEL_EXPORTER_OTLP_HEADERS=api-key=REPLACE_ME

Because default_env.conf uses standard OpenTelemetry environment variables, you can configure any SDK behavior the same way, such as OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES, or the various sampler and exporter settings. See SDK environment variables for the full list.

Restart your applications for configuration changes to take effect.

Run a local Collector

Running a Collector on the host lets you keep the export configuration of your applications simple: they send OTLP to localhost, and the Collector handles batching, retries, and routing to one or more backends. Install and run the Collector separately for now; it is not yet part of the base opentelemetry metapackage.

Next steps


সর্বশেষ পরিবর্তিত August 20, 2026: Add docs for OpenTelemetry system packages on Linux hosts (#11193) (edb244ce)