Environment Variables
Complete reference for Telegen environment variables.
Overview
Environment variables provide the highest-priority configuration method. They override all config file settings and are ideal for:
Container deployments
Secrets management
CI/CD pipelines
Per-environment overrides
Naming Convention
Environment variables follow this pattern:
TELEGEN_<SECTION>_<SUBSECTION>_<KEY>
Examples:
TELEGEN_OTLP_ENDPOINT→otlp.endpointTELEGEN_AGENT_PROFILING_ENABLED→agent.profiling.enabled
Core Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Operating mode: |
|
|
Service name for telemetry |
|
hostname |
Unique instance identifier |
|
|
Log level: |
|
|
Log format: |
|
|
Config file path |
OTLP Export Variables
Variable |
Default |
Description |
|---|---|---|
|
- |
Required. OTLP endpoint (e.g., |
|
|
Protocol: |
|
|
Compression: |
|
|
Connection timeout |
|
|
Skip TLS verification |
|
- |
Headers as |
TLS Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Enable TLS |
|
- |
CA certificate path |
|
- |
Client certificate path |
|
- |
Client key path |
|
|
Skip certificate verification |
Per-Signal Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Enable trace export |
|
- |
Override traces endpoint |
|
|
Trace sampling rate (0.0-1.0) |
|
|
Enable metrics export |
|
- |
Override metrics endpoint |
|
|
Enable logs export |
|
- |
Override logs endpoint |
|
|
Enable profiles export |
|
- |
Override profiles endpoint |
Agent Variables
eBPF Configuration
Variable |
Default |
Description |
|---|---|---|
|
|
Enable eBPF |
|
|
Ring buffer size (bytes) |
|
|
Per-CPU perf buffer size |
Network Tracing
Variable |
Default |
Description |
|---|---|---|
|
|
Enable network tracing |
|
|
Trace HTTP |
|
|
Trace gRPC |
|
|
Trace DNS |
|
|
Collect TCP metrics |
Discovery
Variable |
Default |
Description |
|---|---|---|
|
|
Process discovery poll interval |
|
|
Skip OTel-instrumented services |
|
|
Min process age before discovery |
|
|
Use generic tracers only |
|
|
Disable BPF PID filtering (debug) |
|
|
Port for OTel-instrumented detection |
Port-Based Discovery Variables
Variable |
Default |
Description |
|---|---|---|
|
- |
Ports to instrument (e.g., |
|
- |
Glob pattern for executable path |
Examples:
# Instrument only ports 8080-8089
export OTEL_EBPF_INSTRUMENT_PORTS="8080-8089"
# Instrument Java processes on port 8080
export OTEL_EBPF_INSTRUMENT_PORTS="8080"
export OTEL_EBPF_INSTRUMENT_COMMAND="*java*"
# Instrument common web ports
export OTEL_EBPF_INSTRUMENT_PORTS="80,443,3000,5000,8080-8089"
Metadata Discovery Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Enable metadata discovery |
|
|
Discovery interval |
|
|
Detect cloud provider |
|
|
Detect Kubernetes |
|
|
Detect application runtimes |
Profiling
Variable |
Default |
Description |
|---|---|---|
|
|
Enable profiling |
|
|
Sample rate (Hz) |
|
|
CPU profiling |
|
|
Off-CPU profiling |
|
|
Memory profiling |
|
|
Profile duration |
|
|
Upload interval |
Security
Variable |
Default |
Description |
|---|---|---|
|
|
Enable security monitoring |
|
|
Syscall auditing |
|
|
File integrity monitoring |
|
|
Container escape detection |
GPU
Variable |
Default |
Description |
|---|---|---|
|
|
Enable GPU monitoring |
|
|
NVIDIA GPU support |
|
|
GPU polling interval |
Collector Variables
SNMP
Variable |
Default |
Description |
|---|---|---|
|
|
Enable SNMP collection |
|
|
Polling interval |
|
|
SNMP timeout |
|
|
Retry count |
SNMP Trap Receiver
Variable |
Default |
Description |
|---|---|---|
|
|
Enable trap receiver |
|
|
Listen address |
Cloud Variables
AWS
Variable |
Default |
Description |
|---|---|---|
|
|
Enable AWS detection |
|
|
Metadata timeout |
|
|
Refresh interval |
|
|
Collect EC2 tags |
GCP
Variable |
Default |
Description |
|---|---|---|
|
|
Enable GCP detection |
|
|
Metadata timeout |
|
|
Refresh interval |
Azure
Variable |
Default |
Description |
|---|---|---|
|
|
Enable Azure detection |
|
|
Metadata timeout |
|
|
Refresh interval |
Self-Telemetry Variables
The self-telemetry endpoint serves health probes (/healthz, /readyz) and Prometheus metrics (/metrics).
Variable |
Default |
Description |
|---|---|---|
|
|
HTTP listen address for health probes and metrics |
|
|
Prometheus metrics namespace prefix |
Queue Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Trace queue memory limit |
|
|
Max trace age |
|
|
Trace batch size |
|
|
Metrics queue memory limit |
|
|
Max metrics age |
|
|
Metrics batch size |
|
|
Logs queue memory limit |
|
|
Max logs age |
|
|
Logs batch size |
Backoff Variables
Variable |
Default |
Description |
|---|---|---|
|
|
Initial backoff |
|
|
Maximum backoff |
|
|
Backoff multiplier |
|
|
Jitter factor |
|
|
Max retry attempts |
Usage Examples
Docker
docker run -d --name telegen \
--privileged --pid=host --network=host \
-v /sys:/sys:ro \
-v /proc:/host/proc:ro \
-v /sys/kernel/debug:/sys/kernel/debug \
-v /sys/fs/bpf:/sys/fs/bpf \
-e TELEGEN_OTLP_ENDPOINT=otel-collector:4317 \
-e TELEGEN_AGENT_PROFILING_ENABLED=true \
-e TELEGEN_AGENT_SECURITY_ENABLED=true \
ghcr.io/mirastacklabs-ai/telegen:latest
Kubernetes ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: telegen-config
data:
TELEGEN_OTLP_ENDPOINT: "otel-collector.monitoring:4317"
TELEGEN_AGENT_PROFILING_ENABLED: "true"
TELEGEN_AGENT_SECURITY_ENABLED: "true"
TELEGEN_LOG_LEVEL: "info"
Kubernetes Secret
apiVersion: v1
kind: Secret
metadata:
name: telegen-secrets
type: Opaque
stringData:
TELEGEN_OTLP_HEADERS: "Authorization=Bearer your-token"
Shell Script
#!/bin/bash
export TELEGEN_OTLP_ENDPOINT="otel-collector:4317"
export TELEGEN_AGENT_PROFILING_ENABLED=true
export TELEGEN_AGENT_SECURITY_ENABLED=true
export TELEGEN_LOG_LEVEL=debug
telegen
Precedence
Configuration values are resolved in this order (highest to lowest):
Environment variables - Always win
Config file - Merged with defaults
Built-in defaults - Fallback values
Example:
# config.yaml
otlp:
endpoint: "from-config:4317"
# Environment
export TELEGEN_OTLP_ENDPOINT="from-env:4317"
Result: otlp.endpoint = from-env:4317
Secret Substitution
Config files support environment variable substitution using ${VAR} syntax:
otlp:
endpoint: "${OTEL_ENDPOINT}"
headers:
Authorization: "Bearer ${OTEL_TOKEN}"
collector:
snmp:
targets:
- address: "10.0.1.1:161"
security:
auth_password: "${SNMP_AUTH_PASSWORD}"
priv_password: "${SNMP_PRIV_PASSWORD}"
Next Steps
Minimal Configuration - Getting started with minimal config
Full Configuration Reference - Complete configuration reference