TelemetryFlow Agent (OTEL Agent)
10K+
Enterprise-grade telemetry collection agent built on OpenTelemetry Go SDK v1.43.0. Provides comprehensive system monitoring with metrics collection, heartbeat monitoring, and OTLP telemetry export for the TelemetryFlow Platform.
This agent works as the client-side counterpart to the TelemetryFlow Backend Agent Module (NestJS), providing:
TFO-Agent is fully aligned with the TelemetryFlow ecosystem, sharing the same OpenTelemetry SDK version:
graph LR
subgraph "TelemetryFlow Ecosystem v1.3.5"
subgraph "Instrumentation"
SDK[TFO-Go-SDK<br/>OTEL SDK v1.43.0]
end
subgraph "Collection"
AGENT[TFO-Agent<br/>OTEL SDK v1.43.0]
end
subgraph "Processing"
COLLECTOR[TFO-Collector<br/>OTEL v0.146.1]
end
end
APP[Application] --> SDK
SDK -->|OTLP| AGENT
HOST[Host Metrics] --> AGENT
AGENT -->|OTLP gRPC/HTTP| COLLECTOR
COLLECTOR --> BACKEND[TelemetryFlow<br/>Platform]
style SDK fill:#81C784,stroke:#388E3C
style AGENT fill:#64B5F6,stroke:#1976D2
style COLLECTOR fill:#FFB74D,stroke:#F57C00
| Component | Version | OTEL Base | Description |
|---|---|---|---|
| TFO-Agent | v1.2.0 | SDK v1.43.0 | Telemetry collection agent |
| TFO-Go-SDK | v1.2.0 | SDK v1.43.0 | Go instrumentation SDK |
| TFO-Collector | v1.1.8 | Collector v0.147.0 | Central telemetry collector |
š New to TFO-Agent? Check the Quick Start Guideā for step-by-step setup with Docker, Kubernetes, or binary installation.
# Clone the repository
git clone https://github.com/telemetryflow/telemetryflow-agent.git
cd telemetryflow-agent
# Build
make build
# Run
./build/tfo-agent --help
# Copy environment template
cp .env.example .env
# Edit .env with your configuration
vim .env
# Build and start
docker-compose up -d --build
# View logs
docker-compose logs -f tfo-agent
# Stop
docker-compose down
# Build image
docker build \
--build-arg VERSION=1.1.8 \
--build-arg GIT_COMMIT=$(git rev-parse --short HEAD) \
--build-arg GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
--build-arg BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') \
-t telemetryflow/telemetryflow-agent:1.1.8 .
# Run container
docker run -d --name tfo-agent \
-p 4317:4317 \
-p 4318:4318 \
-p 8888:8888 \
-p 13133:13133 \
-v /path/to/config.yaml:/etc/tfo-agent/tfo-agent.yaml:ro \
-v /var/lib/tfo-agent:/var/lib/tfo-agent \
telemetryflow/telemetryflow-agent:1.1.8
| Port | Protocol | Description |
|---|---|---|
| 4317 | gRPC | OTLP gRPC (v1 & v2) |
| 4318 | HTTP | OTLP HTTP (v1 & v2) |
| 8888 | HTTP | OTEL Collector metrics |
| 8889 | HTTP | Prometheus exporter |
| 13133 | HTTP | Health check |
| 55679 | HTTP | zPages (debugging) |
| 1777 | HTTP | pprof (profiling) |
The TFO-Collector supports both TelemetryFlow (v2) and OTEL Community (v1) endpoints:
TelemetryFlow Platform (Recommended):
POST http://localhost:4318/v2/traces
POST http://localhost:4318/v2/metrics
POST http://localhost:4318/v2/logs
OTEL Community (Backwards Compatible):
POST http://localhost:4318/v1/traces
POST http://localhost:4318/v1/metrics
POST http://localhost:4318/v1/logs
gRPC: localhost:4317 (both v1 and v2)
š Complete Configuration: See
configs/tfo-agent.default.yamlā for a full configuration example showing Node Exporter, Kubernetes, and eBPF collectors integrated with TFO Platform. š Integration Guide: See TFO Platform Integration Guideā for architecture diagrams, data flow, and production deployment examples.
Create configuration file at /etc/tfo-agent/tfo-agent.yaml:
# TelemetryFlow Platform Configuration (v1.3.5+)
telemetryflow:
api_key_id: "${TELEMETRYFLOW_API_KEY_ID}"
api_key_secret: "${TELEMETRYFLOW_API_KEY_SECRET}"
endpoint: "${TELEMETRYFLOW_ENDPOINT:-localhost:4317}"
protocol: grpc # grpc or http
tls:
enabled: true
skip_verify: false
retry:
enabled: true
max_attempts: 3
initial_interval: 1s
max_interval: 30s
agent:
name: "TelemetryFlow Agent"
hostname: "" # Auto-detected if empty
tags:
environment: production
heartbeat:
interval: 60s
timeout: 10s
collector:
system:
enabled: true
interval: 15s
cpu: true
memory: true
disk: true
network: true
exporter:
otlp:
enabled: true
batch_size: 100
flush_interval: 10s
compression: gzip
buffer:
enabled: true
path: "/var/lib/tfo-agent/buffer"
max_size_mb: 100
# TelemetryFlow Platform (v1.3.5+)
export TELEMETRYFLOW_ENDPOINT="localhost:4317"
export TELEMETRYFLOW_API_KEY_ID="tfk_your_key_id"
export TELEMETRYFLOW_API_KEY_SECRET="tfs_your_key_secret"
export TELEMETRYFLOW_ENVIRONMENT="production"
# Agent Configuration
export TELEMETRYFLOW_AGENT_ID="your-agent-id"
export TELEMETRYFLOW_AGENT_NAME="my-agent"
# Logging
export TELEMETRYFLOW_LOG_LEVEL="info"
# Start agent
tfo-agent start
# Start with custom config
tfo-agent start --config /path/to/config.yaml
# Validate configuration
tfo-agent config validate
# Show version
tfo-agent version
tfo-agent/
āāā cmd/tfo-agent/ # CLI entry point
āāā internal/
ā āāā agent/ # Core agent lifecycle
ā āāā buffer/ # Disk-backed retry buffer
ā āāā collector/ # Metric collectors
ā ā āāā aurora/ # Amazon Aurora CloudWatch/PI/RDS collector
ā ā āāā cadvisor/ # cAdvisor Prometheus scraper collector
ā ā āāā clickhouse/ # ClickHouse database collector
ā ā āāā cockroachdb/ # CockroachDB database collector
ā ā āāā docker/ # Docker container metrics collector
ā ā āāā ebpf/ # eBPF kernel-level metrics collector
ā ā āāā kubernetes/ # Kubernetes metrics collector
ā ā āāā mongodb/ # MongoDB database collector
ā ā āāā mssql/ # Microsoft SQL Server collector
ā ā āāā mysql/ # MySQL/MariaDB/Percona collector
ā ā āāā nodeexporter/ # Node Exporter metrics collector
ā ā āāā postgresql/ # PostgreSQL/RDS PostgreSQL collector
ā ā āāā sqlite3/ # SQLite3 database collector
ā ā āāā system/ # System metrics collector
ā ā āāā timescaledb/ # TimescaleDB collector
ā āāā config/ # Configuration management
ā āāā exporter/ # OTLP data exporters
ā āāā version/ # Version and banner info
āāā pkg/ # LEGO Building Blocks
ā āāā api/ # HTTP API client
ā āāā banner/ # Startup banner
ā āāā config/ # Config loader utilities
ā āāā plugin/ # Plugin registry system
āāā configs/ # Configuration templates
āāā scripts/ # Build/install scripts
āāā build/ # Build output
āāā Makefile
āāā Dockerfile # Docker build
āāā docker-compose.yml # Docker Compose
āāā .env.example # Environment template
āāā README.md
The pkg/ directory contains reusable building blocks:
| Block | Description |
|---|---|
pkg/banner | ASCII art startup banner |
pkg/config | Flexible configuration loader |
pkg/plugin | Plugin registry for extensibility |
pkg/api | HTTP client for backend communication |
import "github.com/telemetryflow/telemetryflow/telemetryflow-agent/pkg/plugin"
// Register a custom collector
plugin.Register("my-collector", func() plugin.Plugin {
return &MyCustomCollector{}
})
// Use the plugin
p, _ := plugin.Get("my-collector")
p.Init(config)
p.Start()
| Metric | Type | Description |
|---|---|---|
system.cpu.usage | gauge | CPU usage percentage |
system.cpu.cores | gauge | Number of CPU cores |
system.memory.total | gauge | Total memory (bytes) |
system.memory.used | gauge | Used memory (bytes) |
system.memory.usage | gauge | Memory usage percentage |
system.disk.total | gauge | Total disk space (bytes) |
system.disk.used | gauge | Used disk space (bytes) |
system.disk.usage | gauge | Disk usage percentage |
system.network.bytes_sent | counter | Total bytes sent |
system.network.bytes_recv | counter | Total bytes received |
The Docker collector provides 32 per-container metrics via Docker Engine API:
container.cpu.{usage_percent,usage_total,user,kernel,online_cpus,throttled_periods,throttled_time}container.memory.{usage,working_set,limit,max_usage,rss,cache,usage_percent}container.network.{rx,tx}_{bytes,packets,errors,dropped} (per-interface)container.diskio.{read,write}_{bytes,ops}container.pids.currentcontainer.state.{running,stopped,paused,restarting,total}The cAdvisor collector scrapes Prometheus metrics from a running cAdvisor instance:
container_* and machine_* metric familiesThe agent provides native collectors for popular databases via direct connection or cloud SDK:
| Collector | Source | Metrics |
|---|---|---|
| Amazon Aurora | AWS SDK (CloudWatch, RDS, Performance Insights) | 60+ CloudWatch metrics across storage, replication, cache, latency, transactions, availability, backtrack, serverless, global, instance, volume |
| MySQL/MariaDB | Direct connection | Global status, InnoDB, replication, Galera, query analytics, schema, MariaDB-specific (Aria, ColumnStore, Spider, query cache, thread pool, user stats) |
| PostgreSQL | Direct connection | pg_stat_activity, pg_stat_database, pg_stat_bgwriter, pg_stat_statements, table stats, replication |
| MSSQL | Direct connection | Wait stats, perf counters, index usage, tempdb, agent jobs, query store, file I/O |
| MongoDB | Direct connection | Server status, replica set, sharding, query profiler, collection stats |
| ClickHouse | HTTP API | System tables, query metrics, merge stats, replication queue |
| CockroachDB | Direct connection | SQL stats, range stats, store metrics, replication |
| TimescaleDB | Direct connection | Hypertable stats, chunk stats, compression ratios, continuous aggregates, job health |
| SQLite3 | File access | Page cache, WAL metrics, lock contention, integrity checks, table stats |
The eBPF collector provides 28 kernel-level metrics across 7 categories:
ebpf.syscall.{count,latency_ns,errors} with pid, comm, syscall labelsebpf.tcp.{connections,bytes_sent,bytes_recv,rtt_ns,retransmits}, ebpf.udp.{packets_sent,packets_recv}ebpf.fileio.{operations,bytes,latency_ns} with operation labelebpf.sched.{context_switches,runq_latency_ns,oncpu_ns,migrations}ebpf.memory.{page_faults,major_faults,minor_faults}ebpf.tcp.state_transitions with old_state, new_state labelshubble.{flows,drops,policy_verdicts,http_requests,dns_queries,l7_errors}See eBPF Metrics Documentationā for complete catalog.
# Show all commands
make help
# Build Commands
make # Build agent (default)
make build # Build agent for current platform
make build-all # Build agent for all platforms
make build-linux # Build for Linux (amd64 and arm64)
make build-darwin # Build for macOS (amd64 and arm64)
# Development Commands
make run # Build and run agent
make dev # Run with go run (faster for development)
make lint # Run linter
make fmt # Format code
make vet # Run go vet
# Dependencies
make deps # Download dependencies
make deps-update # Update dependencies
make tidy # Tidy go modules
# Other Commands
make clean # Clean build artifacts
make install # Install binary to /usr/local/bin
make uninstall # Uninstall binary
make docker-build # Build Docker image
make docker-push # Push Docker image
make version # Show version information
# Run all tests
make test # Run unit and integration tests
make test-all # Run unit, integration, and E2E tests
make test-unit # Run unit tests only
make test-integration # Run integration tests only
make test-e2e # Run E2E tests only
# Run specific tests
make test-run PKG=integrations # Run all integration tests
make test-run PKG=domain/agent # Run agent domain tests
make test-run TEST=TestPerconaCollector # Run test by name pattern
make test-run PKG=integrations TEST=TestKafka # Run specific test in package
make test-list # List available test packages
# Coverage and CI
make test-coverage # Generate coverage report
make ci-test # Run with race detection (CI mode)
# Using test script directly
./scripts/test-specific.sh integrations # Run all integration tests
./scripts/test-specific.sh -c domain/agent # Run with coverage
./scripts/test-specific.sh -r TestExporter # Run with race detector
./scripts/test-specific.sh --ci infrastructure # CI mode (race + coverage)
./scripts/test-specific.sh -l # List available packages
| Package | Description | Test Files |
|---|---|---|
application | CLI commands, configuration | 3 |
domain/agent | Agent lifecycle management | 2 |
domain/collector/mysql | MySQL/MariaDB collector | 3 |
domain/collector/mongodb | MongoDB collector | 3 |
domain/collector/postgresql | PostgreSQL collector | 3 |
domain/collector/timescaledb | TimescaleDB collector | 1 |
domain/ebpf | eBPF collector | 4 |
domain/kubernetes | Kubernetes collector | 1 |
domain/nodeexporter | Node Exporter collector | 1 |
domain/plugin | Plugin registry | 1 |
domain/telemetry | Telemetry collection | 2 |
infrastructure/api | API client | 1 |
infrastructure/buffer | Disk-backed buffer | 1 |
infrastructure/config | Configuration loader | 1 |
infrastructure/exporter | OTLP exporters | 3 |
integrations | 3rd party integrations | 36 |
presentation/banner | Startup banner | 1 |
# /etc/systemd/system/tfo-agent.service
[Unit]
Description=TelemetryFlow Agent - CEOP
After=network.target
[Service]
Type=simple
User=telemetryflow
ExecStart=/usr/local/bin/tfo-agent start --config /etc/tfo-agent/tfo-agent.yaml
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable tfo-agent
sudo systemctl start tfo-agent
TelemetryFlow Agent supports 39+ integrations for enterprise environments across multiple categories.
| Category | Integrations | Count |
|---|---|---|
| Cloud Providers | GCP, Azure, Alibaba Cloud, AWS CloudWatch | 4 |
| Infrastructure | Proxmox, VMware vSphere, Nutanix, Azure Arc | 4 |
| Network & IoT | Cisco (DNA Center/Meraki), SNMP v1/v2c/v3, MQTT | 3 |
| Kernel/System | eBPF (syscalls, network, file I/O, scheduler), Cilium Hubble | 2 |
| APM Platforms | Dynatrace, IBM Instana, Datadog, New Relic | 4 |
| OSS Observability | SigNoz, Coroot, HyperDX, OpenObserve, Netdata | 5 |
| Observability | Prometheus, Splunk, Elasticsearch | 3 |
| Streaming & Logs | Kafka, Loki, InfluxDB | 3 |
| Tracing | Jaeger, Zipkin | 2 |
| Monitoring Tools | Telegraf, Grafana Alloy, Percona PMM, Blackbox, ManageEngine | 5 |
| Custom | Webhook | 1 |
| Capability | Description |
|---|---|
| Unified Agent | Single agent for cloud, infrastructure, network, and system |
| OTLP-First | Native OpenTelemetry Protocol support (gRPC & HTTP) |
| Enterprise Ready | TLS, mTLS, API key authentication, retry with backoff |
| Hybrid Cloud | Proxmox, VMware, Nutanix, Azure Arc in one agent |
| Network Observability | Cisco DNA/Meraki, SNMP v3, MQTT for IoT |
| Kernel-Level | eBPF for syscalls, network, file I/O, scheduler metrics |
| Resilient | Disk-backed buffer with automatic retry and flush |
| Extensible | Plugin architecture for custom integrations |
See Integration Documentationā for detailed configuration.
Apache License 2.0 - See LICENSEā
Copyright (c) 2024-2026 Telemetri Data Indonesia. All rights reserved.
Content type
Image
Digest
sha256:657ff458bā¦
Size
99.1 MB
Last updated
4 days ago
docker pull telemetryflow/telemetryflow-agent