MCPcopy Index your code
hub / github.com/ccfos/huatuo

github.com/ccfos/huatuo @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
1,296 symbols 4,006 edges 201 files 481 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

English | 简体中文

What is HUATUO

HUATUO is a cloud-native operating system observability project open-sourced by DIDI and incubated under the CCF. It focuses on providing deep, kernel-level observability for complex cloud-native. By integrating linux kernel dynamic tracking such as kprobe, tracepoint, ftrace and eBPF, it has achieved multi-dimensional kernel observability, such as more refined metrics, kernel runtime exception contexts, and automatic tracking. HUATUO has been deployed at scale in Didi's production environment and plays a critical role in troubleshooting system failure, enhancing the high availability and performance of the cloud-native operating system. Through continuous evolution, HUATUO aims to advance eBPF in observability toward lower overhead and greater efficiency. For more information: https://huatuo.tech

Key Features

  • Low-Overhead Kernel Observability: Leverages eBPF to maintain performance overhead below 1%, delivering in-depth, low-level, and comprehensive observability into linux core subsystem, such as memory, cpu scheduling, networking, and block I/O.
  • Event-Driven Context Capture: This automatically acquires runtime context by triggering on critical events such as page faults, scheduling delays, and lock contention. Each event generates detailed observable data - including register states, stack traces, task info, and resource usage - for immediate analysis.
  • AutoTracing: Leverages heuristic tracking algorithms and automated snapshots for system troubleshooting. This approach resolves performance degradation in complex cloud-native environments, addressing issues such as CPU idle, CPU sys, I/O, and Loadavg.
  • Continuous Performance Profiling: A comprehensive and continuous performance profiling of the operating system and applications, covering CPU, Memory, I/O, and Locks. This feature can help applications continuously iterate and release, and plays a key role in stress testing and fault injection.
  • Distributed Tracing: Network-centric distributed tracing for service requests, which can map system calls and node relationships. This feature supports cross-node tracing in large-scale distributed systems and provides a comprehensive view of microservice interactions.
  • Integration with Open Source Ecosystem: Deeply integrated with other open-source observability stacks, it can automatically associate K8S container tags, annotations, and Linux kernel events, breaking down data silos. Programming the Kernel with eBPF, which is zero instrumentation and programmable.

Software Architecture

Getting Started

  • Quick Run

Use the docker cli to launch the huatuo service:

    $ docker run --privileged --cgroupns=host --network=host -v /sys:/sys -v /run:/run huatuo/huatuo-bamai:latest

Pull the metric on another terminal:

    $ curl -s localhost:19704/metrics
  • Quick Setup

Launch the Elasticsearch, Prometheus, Grafana, and huatuo services using docker compose. Once the services are running, access http://localhost:3000 via your web browser.

    $ docker compose --project-directory ./build/docker up

For more information, please refer to: Quick Start or https://huatuo.tech/quickstart/

  • NOTE

Do not deploy images with the latest tag to production environment, as this is a development and testing image.

Kernel Versions

Supports kernel versions from 4.18 and later.

HUATUO Kernel Version OS Distribution
1.0.0 4.18.x CentOS 8.x
1.0.0 5.4.x OpenCloudOS V8/Ubuntu 20.04
1.0.0 5.10.x OpenEuler 22.03/Anolis OS 8.10
1.0.0 5.15.x Ubuntu 22.04
1.0.0 6.6.x OpenEuler 24.03/Anolis OS 23.3/OpenCloudOS V9
1.0.0 6.8.x Ubuntu 24.04
1.0.0 6.14.x Fedora 42

Documentation

For more information, visit https://huatuo.tech

Contact Us

  • WeChat Group and Official Account:

License

This project is open source under the Apache License 2.0. The BPF code is licensed under the GPL license.

Extension points exported contracts — how you extend this code

Collector (Interface)
Collector is the interface a collector has to implement. go:generate mockery --name=Collector --dir=. --filename=mock_c [31 …
pkg/metric/collector.go
ITracingEvent (Interface)
ITracingEvent represents a tracing/event [25 implementers]
pkg/tracing/tracing.go
Writer (Interface)
go:generate mockery --name=Writer --dir=. --filename=mock_writer_test.go --inpackage --case=underscore [4 implementers]
internal/storage/storage.go
PerfEventReader (Interface)
PerfEventReader reads the eBPF perf_event. [1 implementers]
internal/bpf/perf_event_reader.go
Cgroup (Interface)
(no doc) [2 implementers]
internal/cgroups/cgroups.go
BPF (Interface)
(no doc) [1 implementers]
internal/bpf/bpf.go

Core symbols most depended-on inside this repo

Run
called by 90
internal/services/services.go
Debugf
called by 76
internal/log/log.go
Get
called by 74
internal/conf/config.go
Error
called by 71
core/metrics/metax/sml/errors.go
Close
called by 64
internal/bpf/bpf.go
Infof
called by 58
internal/log/log.go
NewGaugeData
called by 52
pkg/metric/data.go
RegisterEventTracing
called by 48
pkg/tracing/register_event.go

Shape

Function 680
Method 281
Struct 195
Class 105
TypeAlias 26
Interface 7
Enum 2

Languages

Go85%
C13%
C++2%

Modules by API surface

bpf/iotracing.c42 symbols
internal/bpf/bpf_default.go31 symbols
internal/bpf/bpf.go26 symbols
core/metrics/metax/sml/device.go24 symbols
internal/pod/container_kubelet_sync.go23 symbols
core/autotracing/dload.go21 symbols
cmd/iotracing/iotracing.go21 symbols
internal/log/log.go20 symbols
internal/cgroups/cgroups.go20 symbols
internal/bpf/bpf_default_test.go19 symbols
bpf/cpu_runqlat_tracing.c18 symbols
core/autotracing/cpuidle.go17 symbols

For agents

$ claude mcp add huatuo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact