# deepflowio/deepflow architecture

> Architecture diagram of the GitHub repository deepflowio/deepflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deepflowio/deepflow
- Repository: https://github.com/deepflowio/deepflow

## Overview

DeepFlow is a zero-code observability platform for cloud-native and AI applications. Host agents collect network, application, tracing, metric, and profiling signals; the server manages agents and metadata, ingests telemetry, and exposes query services. The agent workflow is represented through capture, flow/protocol processing, and forwarding; server management, ingestion, and querying remain distinct stages. README statements establish the product-level links; sampled source additionally confirms agent startup and server component startup. Unsampled subsystems are shown only where README capabilities and the repository tree support them.

Main entry points: [`agent/src/ebpf_dispatcher.rs`](https://github.com/deepflowio/deepflow/blob/main/agent/src/ebpf_dispatcher.rs) (eBPF collection), [`agent/src/flow_generator/flow_map.rs`](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/flow_map.rs) (Flow generation), [`agent/src/flow_generator/protocol_logs.rs`](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/protocol_logs.rs) (Protocol parsers), [`agent/src/trident.rs`](https://github.com/deepflowio/deepflow/blob/main/agent/src/trident.rs) (Agent runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Host agent"]
  node_agent_runtime["Agent runtime<br/>[trident.rs]"]
  node_configuration["Agent configuration<br/>[config.rs]"]
  node_config_handler["Config handler<br/>[handler.rs]"]
  node_ebpf["eBPF collection<br/>[ebpf_dispatcher.rs]"]
  node_network_capture["Packet capture<br/>[mod.rs]"]
  node_telemetry_sender["Telemetry sender<br/>[mod.rs]"]
end

subgraph group_processing["Telemetry processing"]
  node_packet_model["Packet and flow model<br/>[meta_packet.rs]"]
  node_flow_model["Flow model<br/>[flow.rs]"]
  node_endpoint_model["Endpoint metadata<br/>[endpoint.rs]"]
  node_flow_map["Flow generation<br/>[flow_map.rs]"]
  node_protocol_registry["Protocol registry<br/>[l7_protocol_log.rs]"]
  node_protocol_parsers["Protocol parsers<br/>[protocol_logs.rs]"]
  node_http_parser["HTTP parser<br/>[http.rs]"]
  node_l7_info["L7 protocol data"]
end

subgraph group_server["Server platform"]
  node_server_runtime["Server runtime<br/>[main.go]"]
  node_controller["Agent management<br/>[controller.go]"]
  node_cloud_inventory["Cloud inventory<br/>[manager.go]"]
  node_ingester["Telemetry ingestion<br/>[ingester.go]"]
  node_query_router["Query API<br/>[query.go]"]
  node_query_service["Query service<br/>[query.go]"]
  node_storage[("ClickHouse storage<br/>[ingester.go]")]
end

subgraph group_features["Observability capabilities"]
  node_universal_map["Service map<br/>[service_table.rs]"]
  node_distributed_tracing["Distributed tracing"]
  node_continuous_profiling["Continuous profiling<br/>[perf_profiler.c]"]
  node_integrations["Telemetry integrations"]
  node_prometheus["Prometheus interface"]
end

node_host(("Host processes"))

node_host -->|"observes"| node_ebpf
node_host -->|"sends traffic"| node_network_capture
node_agent_runtime -->|"uses configuration"| node_configuration
node_agent_runtime -->|"starts collection"| node_ebpf
node_network_capture -.->|"produces packets"| node_packet_model
node_ebpf -->|"collects signals"| node_packet_model
node_packet_model -.->|"builds flows"| node_flow_map
node_flow_map -->|"selects protocol"| node_protocol_registry
node_protocol_registry -->|"dispatches parsing"| node_protocol_parsers
node_protocol_parsers -->|"includes parser"| node_http_parser
node_protocol_parsers -.->|"produces protocol data"| node_l7_info
node_flow_map -.->|"aggregates flows"| node_flow_model
node_flow_model -->|"enriches metadata"| node_endpoint_model
node_agent_runtime -.->|"forwards telemetry"| node_telemetry_sender
node_telemetry_sender -->|"sends telemetry"| node_ingester
node_server_runtime -->|"starts"| node_controller
node_server_runtime -->|"starts"| node_ingester
node_server_runtime -->|"starts"| node_query_service
node_controller -->|"manages agents"| node_agent_runtime
node_controller -.->|"coordinates inventory"| node_cloud_inventory
node_ingester -->|"writes telemetry"| node_storage
node_query_router -->|"routes queries"| node_query_service
node_query_service -.->|"queries data"| node_storage
node_flow_map -->|"supports service mapping"| node_universal_map
node_ebpf -->|"collects spans"| node_distributed_tracing
node_ebpf -->|"collects profiles"| node_continuous_profiling
node_protocol_parsers -->|"supports plugins"| node_integrations
node_query_router -.->|"exposes queries"| node_prometheus

click node_agent_runtime "https://github.com/deepflowio/deepflow/blob/main/agent/src/trident.rs"
click node_configuration "https://github.com/deepflowio/deepflow/blob/main/agent/src/config/config.rs"
click node_config_handler "https://github.com/deepflowio/deepflow/blob/main/agent/src/config/handler.rs"
click node_ebpf "https://github.com/deepflowio/deepflow/blob/main/agent/src/ebpf_dispatcher.rs"
click node_network_capture "https://github.com/deepflowio/deepflow/blob/main/agent/src/dispatcher/recv_engine/mod.rs"
click node_packet_model "https://github.com/deepflowio/deepflow/blob/main/agent/src/common/meta_packet.rs"
click node_flow_model "https://github.com/deepflowio/deepflow/blob/main/agent/src/common/flow.rs"
click node_endpoint_model "https://github.com/deepflowio/deepflow/blob/main/agent/src/common/endpoint.rs"
click node_flow_map "https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/flow_map.rs"
click node_protocol_registry "https://github.com/deepflowio/deepflow/blob/main/agent/src/common/l7_protocol_log.rs"
click node_protocol_parsers "https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/protocol_logs.rs"
click node_http_parser "https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/protocol_logs/http.rs"
click node_l7_info "https://github.com/deepflowio/deepflow/blob/main/agent/src/common/l7_protocol_info.rs"
click node_telemetry_sender "https://github.com/deepflowio/deepflow/blob/main/agent/src/sender/mod.rs"
click node_server_runtime "https://github.com/deepflowio/deepflow/blob/main/server/cmd/server/main.go"
click node_controller "https://github.com/deepflowio/deepflow/blob/main/server/controller/controller/controller.go"
click node_cloud_inventory "https://github.com/deepflowio/deepflow/blob/main/server/controller/manager/manager.go"
click node_ingester "https://github.com/deepflowio/deepflow/blob/main/server/ingester/ingester/ingester.go"
click node_query_router "https://github.com/deepflowio/deepflow/blob/main/server/querier/router/query.go"
click node_query_service "https://github.com/deepflowio/deepflow/blob/main/server/querier/service/query.go"
click node_universal_map "https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/service_table.rs"
click node_distributed_tracing "https://github.com/deepflowio/deepflow/tree/main/agent/src/flow_generator"
click node_continuous_profiling "https://github.com/deepflowio/deepflow/blob/main/agent/src/ebpf/user/profile/perf_profiler.c"
click node_integrations "https://github.com/deepflowio/deepflow/tree/main/agent/plugins"
click node_prometheus "https://github.com/deepflowio/deepflow/blob/main/server/querier/app/prometheus/service/queryable_offload.go"
click node_storage "https://github.com/deepflowio/deepflow/blob/main/server/ingester/ingester/ingester.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent_runtime,node_configuration,node_config_handler,node_ebpf,node_network_capture,node_telemetry_sender toneBlue
class node_packet_model,node_flow_model,node_endpoint_model,node_flow_map,node_protocol_registry,node_protocol_parsers,node_http_parser,node_l7_info toneAmber
class node_server_runtime,node_controller,node_cloud_inventory,node_ingester,node_query_router,node_query_service,node_storage toneMint
class node_universal_map,node_distributed_tracing,node_continuous_profiling,node_integrations,node_prometheus toneRose
class node_host toneIndigo
```

## Components

### Host agent

- [Agent runtime](https://github.com/deepflowio/deepflow/blob/main/agent/src/trident.rs): `agent/src/trident.rs`
- [Agent configuration](https://github.com/deepflowio/deepflow/blob/main/agent/src/config/config.rs): `agent/src/config/config.rs`
- [Config handler](https://github.com/deepflowio/deepflow/blob/main/agent/src/config/handler.rs): `agent/src/config/handler.rs`
- [eBPF collection](https://github.com/deepflowio/deepflow/blob/main/agent/src/ebpf_dispatcher.rs): `agent/src/ebpf_dispatcher.rs`
- [Packet capture](https://github.com/deepflowio/deepflow/blob/main/agent/src/dispatcher/recv_engine/mod.rs): `agent/src/dispatcher/recv_engine/mod.rs`
- [Telemetry sender](https://github.com/deepflowio/deepflow/blob/main/agent/src/sender/mod.rs): `agent/src/sender/mod.rs`

### Telemetry processing

- [Packet and flow model](https://github.com/deepflowio/deepflow/blob/main/agent/src/common/meta_packet.rs): `agent/src/common/meta_packet.rs`
- [Flow model](https://github.com/deepflowio/deepflow/blob/main/agent/src/common/flow.rs): `agent/src/common/flow.rs`
- [Endpoint metadata](https://github.com/deepflowio/deepflow/blob/main/agent/src/common/endpoint.rs): `agent/src/common/endpoint.rs`
- [Flow generation](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/flow_map.rs): `agent/src/flow_generator/flow_map.rs`
- [Protocol registry](https://github.com/deepflowio/deepflow/blob/main/agent/src/common/l7_protocol_log.rs): `agent/src/common/l7_protocol_log.rs`
- [Protocol parsers](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/protocol_logs.rs): `agent/src/flow_generator/protocol_logs.rs`
- [HTTP parser](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/protocol_logs/http.rs): `agent/src/flow_generator/protocol_logs/http.rs`
- [L7 protocol data](https://github.com/deepflowio/deepflow/blob/main/agent/src/common/l7_protocol_info.rs): `agent/src/common/l7_protocol_info.rs`

### Server platform

- [Server runtime](https://github.com/deepflowio/deepflow/blob/main/server/cmd/server/main.go): `server/cmd/server/main.go`
- [Agent management](https://github.com/deepflowio/deepflow/blob/main/server/controller/controller/controller.go): `server/controller/controller/controller.go`
- [Cloud inventory](https://github.com/deepflowio/deepflow/blob/main/server/controller/manager/manager.go): `server/controller/manager/manager.go`
- [Telemetry ingestion](https://github.com/deepflowio/deepflow/blob/main/server/ingester/ingester/ingester.go): `server/ingester/ingester/ingester.go`
- [Query API](https://github.com/deepflowio/deepflow/blob/main/server/querier/router/query.go): `server/querier/router/query.go`
- [Query service](https://github.com/deepflowio/deepflow/blob/main/server/querier/service/query.go): `server/querier/service/query.go`
- [ClickHouse storage](https://github.com/deepflowio/deepflow/blob/main/server/ingester/ingester/ingester.go): `server/ingester/ingester/ingester.go`

### Observability capabilities

- [Service map](https://github.com/deepflowio/deepflow/blob/main/agent/src/flow_generator/service_table.rs): `agent/src/flow_generator/service_table.rs`
- [Distributed tracing](https://github.com/deepflowio/deepflow/tree/main/agent/src/flow_generator): `agent/src/flow_generator`
- [Continuous profiling](https://github.com/deepflowio/deepflow/blob/main/agent/src/ebpf/user/profile/perf_profiler.c): `agent/src/ebpf/user/profile/perf_profiler.c`
- [Telemetry integrations](https://github.com/deepflowio/deepflow/tree/main/agent/plugins): `agent/plugins`
- [Prometheus interface](https://github.com/deepflowio/deepflow/blob/main/server/querier/app/prometheus/service/queryable_offload.go): `server/querier/app/prometheus/service/queryable_offload.go`

### Other components

- **Host processes**

## Connections

- Host processes → eBPF collection: observes (evidence: `README.md`)
- Host processes → Packet capture: sends traffic (evidence: `README.md`)
- Agent runtime → Agent configuration: uses configuration (evidence: `agent/src/config/config.rs`)
- Agent runtime → eBPF collection: starts collection (evidence: `agent/src/trident.rs`)
- Packet capture → Packet and flow model: produces packets
- eBPF collection → Packet and flow model: collects signals (evidence: `README.md`)
- Packet and flow model → Flow generation: builds flows
- Flow generation → Protocol registry: selects protocol (evidence: `agent/src/common/l7_protocol_log.rs`)
- Protocol registry → Protocol parsers: dispatches parsing (evidence: `agent/src/common/l7_protocol_log.rs`)
- Protocol parsers → HTTP parser: includes parser (evidence: `agent/src/flow_generator/protocol_logs.rs`)
- Protocol parsers → L7 protocol data: produces protocol data
- Flow generation → Flow model: aggregates flows
- Flow model → Endpoint metadata: enriches metadata (evidence: `agent/src/flow_generator/service_table.rs`)
- Agent runtime → Telemetry sender: forwards telemetry
- Telemetry sender → Telemetry ingestion: sends telemetry (evidence: `README.md`)
- Server runtime → Agent management: starts (evidence: `server/cmd/server/main.go`)
- Server runtime → Telemetry ingestion: starts (evidence: `server/cmd/server/main.go`)
- Server runtime → Query service: starts (evidence: `server/cmd/server/main.go`)
- Agent management → Agent runtime: manages agents (evidence: `README.md`)
- Agent management → Cloud inventory: coordinates inventory
- Telemetry ingestion → ClickHouse storage: writes telemetry (evidence: `server/ingester/ingester/ingester.go`)
- Query API → Query service: routes queries (evidence: `server/querier/router/query.go`)
- Query service → ClickHouse storage: queries data
- Flow generation → Service map: supports service mapping (evidence: `README.md`)
- eBPF collection → Distributed tracing: collects spans (evidence: `README.md`)
- eBPF collection → Continuous profiling: collects profiles (evidence: `README.md`)
- Protocol parsers → Telemetry integrations: supports plugins (evidence: `README.md`)
- Query API → Prometheus interface: exposes queries
