Zero-Instrumentation Observability for Kubernetes & Linux Servers
InfraLens is a next-generation observability tool that uses eBPF to automatically discover and visualize service-to-service communication in Kubernetes clusters—without requiring any code changes or sidecars.

cilium/ebpftcp_v4_connect) and IPv6 (tcp_v6_connect)inet_csk_accept tracingclient-go informers/metrics endpointInfraLens includes a powerful AI documentation system that generates comprehensive service documentation by analyzing:
🔒 Privacy First: Only specific non-sensitive files (README, Dockerfile, package.json) are analyzed for context. Source code is sent to AI only on-demand and is never stored permanently. Sensitive data like
.envfiles and secrets are automatically excluded.
| Section | Description |
|---|---|
| 🎯 What This Service Does | Purpose and functionality explanation |
| 🛠️ Technical Stack | Languages, frameworks, and dependencies |
| 🏗️ Architecture & Data Flow | Service role and communication patterns |
| 📂 Code Analysis | Key files and functions with line numbers |
| 🌐 Network Behavior | Ports, protocols, and connections |
| 🛡️ Security Considerations | Vulnerabilities and recommendations |
| ⚡ Performance & Reliability | Resource usage and scaling insights |
| 📋 Recommendations | Actionable improvement suggestions |
| Provider | Type | Default Model | Configuration |
|---|---|---|---|
| OpenAI | Cloud | GPT-3.5-turbo | API Key |
| Anthropic | Cloud | Claude 3 Haiku | API Key |
| Google Gemini | Cloud | Gemini Pro | API Key |
| Ollama | Local | Llama2 | Server URL |
| LM Studio | Local | Any compatible | Server URL |
flowchart TB
subgraph infra["Your Infrastructure"]
A[Service A] --> B[Service B]
B --> C[Service C]
A --> C
end
subgraph ebpf["Kernel Space"]
trace[eBPF Probes
tcp_connect / accept / send / recv]
end
subgraph agent["InfraLens Agent"]
collector[Collector
Event Parsing]
inspector[Deep Inspector]
metrics[Host Metrics]
end
subgraph backend["InfraLens Backend"]
api[REST API]
ws[WebSocket]
db[(SQLite/Postgres)]
ai[AI Providers]
end
subgraph frontend["InfraLens Frontend"]
react[React Flow
Topology View]
end
infra -.->|kernel tracing| ebpf
ebpf --> agent
agent -->|HTTP POST| backend
backend <-->|real-time| frontend
ASCII Diagram (for non-GitHub viewers)
┌─────────────────────────────────────────────────────────────┐
│ Your Infrastructure │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Service │────▶│ Service │────▶│ Service │ │
│ │ A │ │ B │ │ C │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │ │ │ │
│ └──────────────┼──────────────┘ │
│ eBPF Tracing (kernel) │
│ │ │
│ ┌────────────────────┴─────────────────────────────────┐ │
│ │ InfraLens Agent │ │
│ │ (DaemonSet on each node) │ │
│ └──────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌──────────────────────┴───────────────────────────────┐ │
│ │ InfraLens Backend │ │
│ │ (SQLite/Postgres + AI + WebSocket) │ │
│ └──────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌──────────────────────┴───────────────────────────────┐ │
│ │ InfraLens Frontend │ │
│ │ (React Flow Topology Visualization) │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Full Stack (Main Server):
curl -sSL https://raw.githubusercontent.com/Herenn/Infralens/main/scripts/install-full.sh | sudo bash
Agent Only (Additional Servers):
curl -sSL https://raw.githubusercontent.com/Herenn/Infralens/main/scripts/install-agent.sh | sudo bash -s -- --backend=YOUR_BACKEND_IP:8080
helm install infralens ./deploy/helm/infralens -n infralens --create-namespace \
--set ai.openai.apiKey="sk-..." \
--set ingress.enabled=true
cd deploy/docker-compose
cp env.example .env
# Edit .env with your API keys
docker-compose up -d
Access the dashboard at http://localhost:3000
infralens/
├── agent/ # eBPF Agent
│ ├── main.go # Entry point
│ ├── bpf/ # BPF C programs
│ │ ├── traffic.c # Main tracer (CO-RE)
│ │ └── headers/ # vmlinux.h + libbpf
│ ├── collector/ # BPF Go bindings
│ │ ├── gen.go # go:generate directive
│ │ ├── collector.go # Event collection
│ │ └── types.go # Event/Stats types
│ ├── inspector/ # Deep inspection
│ ├── metrics/ # Host monitoring
│ └── updater/ # Auto-update
│
├── backend/ # Backend Server
│ ├── api/ # HTTP handlers
│ ├── service/ # Business logic
│ ├── storage/ # SQLite/Postgres
│ ├── k8s/ # K8s watcher
│ └── pkg/llm/ # AI providers
│
├── frontend/ # React Dashboard
│ ├── src/components/ # UI components
│ └── src/hooks/ # WebSocket hook
│
├── deploy/ # Deployment configs
│ ├── helm/ # Helm chart
│ ├── docker-compose/ # Docker Compose
│ └── k8s/ # Kustomize
│
└── scripts/ # Installation scripts
# ═══════════════════════════════════════════════════════════════════
# SERVER CONFIGURATION
# ═══════════════════════════════════════════════════════════════════
LISTEN_ADDR=:8080 # HTTP listen address
DEBUG=false # Enable debug logging
READ_TIMEOUT=15s # HTTP read timeout
WRITE_TIMEOUT=15s # HTTP write timeout
# ═══════════════════════════════════════════════════════════════════
# DATABASE
# ═══════════════════════════════════════════════════════════════════
DB_DRIVER=sqlite # Database driver: sqlite or postgres
DB_DSN=infralens.db # SQLite: file path, Postgres: connection string
DB_AUTO_MIGRATE=true # Run migrations on startup
DB_MAX_OPEN_CONNS=25 # Max open connections (default: 1 for SQLite, 25 for Postgres)
DB_MAX_IDLE_CONNS=5 # Max idle connections
DB_CONN_MAX_LIFETIME=5m # Connection max lifetime
# ═══════════════════════════════════════════════════════════════════
# DATA PRUNING (Auto-cleanup of stale data)
# ═══════════════════════════════════════════════════════════════════
PRUNE_INTERVAL=5m # How often to prune (0 to disable)
PRUNE_MAX_AGE=30m # Delete data older than this
# ═══════════════════════════════════════════════════════════════════
# SECURITY
# ═══════════════════════════════════════════════════════════════════
API_KEY= # API key for agent auth (empty = disabled)
API_KEY_HEADER=X-API-Key # Header name for API key
CORS_ORIGINS=* # Comma-separated allowed origins
CORS_CREDENTIALS=true # Allow credentials in CORS
# ═══════════════════════════════════════════════════════════════════
# AI PROVIDERS
# ═══════════════════════════════════════════════════════════════════
OPENAI_API_KEY=sk-... # OpenAI API key
OPENAI_MODEL=gpt-3.5-turbo # OpenAI model
ANTHROPIC_API_KEY=sk-ant-... # Anthropic API key
ANTHROPIC_MODEL=claude-3-haiku-20240307
GEMINI_API_KEY=AIza... # Google Gemini API key
GEMINI_MODEL=gemini-pro
OLLAMA_URL=http://localhost:11434 # Ollama server URL
OLLAMA_MODEL=llama2
LMSTUDIO_URL=http://localhost:1234 # LM Studio server URL
LMSTUDIO_MODEL=
DEFAULT_LLM_PROVIDER=openai # Default AI provider
Protect agent ingestion endpoints with API key authentication:
# Generate a secure API key
export API_KEY=$(openssl rand -hex 32)
# Configure backend
export API_KEY="your-secret-api-key"
# Configure agents to use the key
sudo ./infralens-agent --backend=server:8080 --api-key="your-secret-api-key"
Protected endpoints (when API_KEY is set):
- POST /api/v1/events
- POST /api/v1/stats
- POST /api/v1/metrics
- POST /api/v1/inspection
Public endpoints (always accessible):
- GET /api/v1/topology
- GET /api/v1/services
- GET /api/v1/ws (WebSocket)
- GET /health, GET /ready
# Development (allow all)
export CORS_ORIGINS="*"
# Production (specific origins)
export CORS_ORIGINS="https://infralens.example.com,https://admin.example.com"
InfraLens supports SQLite (default) and PostgreSQL.
export DB_DRIVER=sqlite
export DB_DSN=infralens.db
export DB_DRIVER=postgres
export DB_DSN="postgres://user:password@localhost:5432/infralens?sslmode=disable"
export DB_MAX_OPEN_CONNS=25
export DB_MAX_IDLE_CONNS=5
Supports: OpenAI, Anthropic Claude, Google Gemini, Ollama (local), LM Studio
InfraLens uses the following kernel probes to capture network activity:
| Probe | Hook Point | Purpose | Direction |
|---|---|---|---|
kprobe/tcp_v4_connect |
Entry | Store socket for IPv4 outbound | Outbound |
kretprobe/tcp_v4_connect |
Return | Capture IPv4 connection details | Outbound |
kprobe/tcp_v6_connect |
Entry | Store socket for IPv6 outbound | Outbound |
kretprobe/tcp_v6_connect |
Return | Capture IPv6 connection details | Outbound |
kretprobe/inet_csk_accept |
Return | Capture accepted (incoming) connections | Inbound |
kprobe/tcp_sendmsg |
Entry | Track bytes sent | Throughput |
$ claude mcp add Infralens \
-- python -m otcore.mcp_server <graph>