CLI Reference
Command-line interface reference for Telegen.
Synopsis
telegen [command] [flags]
Global Flags
Flag |
Short |
Description |
Default |
|---|---|---|---|
|
|
Config file path |
|
|
|
Log level (debug, info, warn, error) |
|
|
Log format (json, text) |
|
|
|
|
Show help |
|
|
|
Show version |
Commands
telegen
Run Telegen agent or collector.
telegen [flags]
Examples:
# Run with default config
telegen
# Run with custom config
telegen --config /path/to/config.yaml
# Run with debug logging
telegen --log-level debug
# Run with environment variable config
TELEGEN_CONFIG_FILE=/path/to/config.yaml telegen
Flags:
Flag |
Description |
Default |
|---|---|---|
|
Path to configuration file |
|
|
Operating mode (agent, collector) |
|
telegen version
Display version information.
telegen version [flags]
Examples:
# Short version
telegen version
# Detailed version
telegen version --long
Output:
telegen version 3.0.0
commit: abc1234
built: 2024-01-15T10:00:00Z
go: go1.21.5
Flags:
Flag |
Description |
|---|---|
|
Show detailed version info |
|
Output as JSON |
telegen validate
Validate configuration file.
telegen validate [flags]
Examples:
# Validate default config
telegen validate
# Validate specific file
telegen validate --config /path/to/config.yaml
# Validate and show parsed config
telegen validate --show
Flags:
Flag |
Description |
|---|---|
|
Config file to validate |
|
Show parsed configuration |
|
Enable strict validation |
Output:
✓ Configuration is valid
Parsed configuration:
Mode: agent
OTLP Endpoint: otel-collector:4317
eBPF: enabled
Profiling: enabled
telegen diagnostics
Collect diagnostic information.
telegen diagnostics [flags]
Examples:
# Create diagnostic bundle
telegen diagnostics > diagnostics.tar.gz
# Output to specific file
telegen diagnostics --output /tmp/telegen-diag.tar.gz
# Include sensitive data (use with caution)
telegen diagnostics --include-config
Flags:
Flag |
Description |
|---|---|
|
Output file path |
|
Include config (may contain secrets) |
|
Include recent logs |
Bundle Contents:
System information (kernel, distro, arch)
Telegen version and build info
eBPF program list
Metrics snapshot
Configuration (sanitized unless
--include-config)Recent logs (if
--include-logs)
telegen completion
Generate shell completion scripts.
telegen completion [shell] [flags]
Supported Shells:
bashzshfishpowershell
Examples:
# Bash completion
telegen completion bash > /etc/bash_completion.d/telegen
# Zsh completion
telegen completion zsh > "${fpath[1]}/_telegen"
# Fish completion
telegen completion fish > ~/.config/fish/completions/telegen.fish
Environment Variables
Configuration can be set via environment variables.
Core Settings
Variable |
Description |
Example |
|---|---|---|
|
Config file path |
|
|
Operating mode |
|
|
Log level |
|
|
Log format |
|
OTLP Settings
Variable |
Description |
Example |
|---|---|---|
|
OTLP endpoint |
|
|
OTLP headers |
|
|
Skip TLS verification |
|
|
Compression |
|
Resource Attributes
Variable |
Description |
Example |
|---|---|---|
|
Service name |
|
|
Resource attributes |
|
Feature Flags
Variable |
Description |
Example |
|---|---|---|
|
Enable eBPF |
|
|
Enable profiling |
|
|
Enable security |
|
|
Enable network |
|
Kubernetes
Variable |
Description |
Example |
|---|---|---|
|
Pod name |
|
|
Pod namespace |
|
|
Pod UID |
|
|
Node name |
|
|
K8s API host |
|
|
K8s API port |
|
Exit Codes
Code |
Description |
|---|---|
0 |
Success |
1 |
General error |
2 |
Configuration error |
3 |
eBPF initialization error |
4 |
Permission error |
5 |
Export error |
Signal Handling
Signal |
Action |
|---|---|
|
Graceful shutdown |
|
Graceful shutdown |
|
Reload configuration |
|
Dump status to logs |
Examples:
# Graceful shutdown
kill -TERM $(pidof telegen)
# Reload configuration
kill -HUP $(pidof telegen)
# Dump status
kill -USR1 $(pidof telegen)
Debugging
Enable Debug Logging
# Via flag
telegen --log-level debug
# Via environment
TELEGEN_LOG_LEVEL=debug telegen
# In config
telegen:
log_level: debug
eBPF Debugging
# Enable eBPF debug output
TELEGEN_AGENT_EBPF_DEBUG=true telegen --log-level debug
# Check loaded programs
bpftool prog list | grep telegen
# View eBPF maps
bpftool map list | grep telegen
# Trace eBPF output
cat /sys/kernel/debug/tracing/trace_pipe
Dry Run
# Validate config without starting
telegen validate --config /path/to/config.yaml
# Show effective configuration
telegen validate --show
Examples
Basic Agent
telegen --config /etc/telegen/config.yaml
With Custom Endpoint
OTEL_EXPORTER_OTLP_ENDPOINT=my-collector:4317 telegen
Debug Mode
telegen --log-level debug --log-format text
Collector Mode
telegen --mode collector --config /etc/telegen/collector.yaml
Docker Run
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 \
-v /etc/telegen:/etc/telegen:ro \
-e OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317 \
ghcr.io/mirastacklabs-ai/telegen:latest
Next Steps
API Reference - REST API endpoints
Full Configuration Reference - Configuration options
Troubleshooting - Troubleshooting guide