Professional Go function tracing analysis tool with advanced visualization. Built with Kratos backend and Vue3 frontend.
- 🔍 Function Tracing - Real-time goroutine execution capture
- 📊 Visualization - Interactive Mermaid flowcharts and heatmaps
- 📈 Performance - Bottleneck identification and analysis
- 🔄 Git Integration - GitLab MR change analysis
- 🌐 Web UI - Modern Vue3 interface
- Backend: Kratos, gRPC, SQLite
- Frontend: Vue3, Bootstrap, ECharts
- Visualization: Mermaid.js, D3.js
- Download from GitHub Releases
- Extract and run:
# Linux - Start with default configuration ./goanalysis-linux-v* server # Windows - Start with default configuration goanalysis-windows-v*.exe server
- Open http://localhost:8001
git clone https://github.com/toheart/goanalysis.git
cd goanalysis
make init
make sync-frontend
make build
./bin/goanalysis serverGoAnalysis now supports direct configuration via command line arguments without creating config files:
# Start with default configuration
./goanalysis server
# Customize port and log level
./goanalysis server --http-addr=0.0.0.0:8080 --log-level=info
# Customize database path
./goanalysis server --db-path=./my-database.db
# Set GitLab configuration
./goanalysis server --gitlab-token="your-token" --gitlab-url="https://gitlab.com/api/v4"# View all available parameters
./goanalysis server --helpServer Configuration:
--http-addr- HTTP server address (default: 0.0.0.0:8001)--grpc-addr- gRPC server address (default: 0.0.0.0:9000)--http-timeout- HTTP timeout (default: 1s)--grpc-timeout- gRPC timeout (default: 1s)
Logging Configuration:
--log-level- Log level (default: debug)--log-file- Log file path (default: ./logs/app.log)--log-console- Output to console (default: true)
GitLab Configuration:
--gitlab-token- GitLab access token--gitlab-url- GitLab API URL--gitlab-clone-dir- Clone directory (default: ./data)
OpenAI Configuration:
--openai-api-key- OpenAI API key--openai-api-base- OpenAI API base URL--openai-model- OpenAI model name
Storage Paths:
--static-store-path- Static storage path (default: ./data/static)--runtime-store-path- Runtime storage path (default: ./data/runtime)--file-storage-path- File storage path (default: ./data/files)
Data Configuration:
--db-path- Database path (default: ./goanalysis.db)
Sensitive information can also be set via environment variables:
export GITLAB_TOKEN="your-gitlab-token"
export GITLAB_API_URL="https://gitlab.com/api/v4"
export OPENAI_API_KEY="your-openai-key"
export OPENAI_API_BASE="https://api.openai.com/v1"
export OPENAI_MODEL="gpt-3.5-turbo"
./goanalysis serverStill supports traditional configuration file approach:
# Generate default configuration file
./goanalysis config
# Start with configuration file
./goanalysis server --conf=configs/config.yamlConfiguration file example:
server:
http:
addr: 0.0.0.0:8001
grpc:
addr: 0.0.0.0:9000
logger:
level: debug
file_path: ./logs/app.log
console: true
biz:
gitlab:
token: "${GITLAB_TOKEN}"
url: "${GITLAB_API_URL}"
clone_dir: ./data
openai:
api_key: "${OPENAI_API_KEY}"
api_base: "${OPENAI_API_BASE}"
model: "${OPENAI_MODEL}"
data:
dbpath: ./goanalysis.dbConfiguration priority from high to low:
- Command Line Arguments - Highest priority
- Environment Variables - For sensitive information
- Configuration File - Traditional approach
- Default Values - Lowest priority
# Start with default configuration
./goanalysis server
# Start with custom configuration
./goanalysis server --http-addr=0.0.0.0:8080 --log-level=info
# Code rewriting
./goanalysis rewrite -d /path/to/project# Set GitLab configuration
export GITLAB_TOKEN="your-token"
export GITLAB_API_URL="https://gitlab.com/api/v4"
# Start server
./goanalysis server├── api/ # API definitions
├── cmd/ # CLI commands
├── internal/ # Core logic
├── web/ # Frontend files
└── configs/ # Configuration
docker run -p 8000:8000 -p 9000:9000 \
ghcr.io/toheart/goanalysis:latestmake package-linux
make package-windows| Issue | Solution |
|---|---|
| Port in use | lsof -i :8000; kill -9 <PID> |
| DB locked | rm -f goanalysis.db-* |
| Frontend missing | make sync-frontend |
- Fork repository
- Create feature branch
- Make changes with tests
- Submit pull request
Follow Conventional Commits.
| Version | Date | Changes |
|---|---|---|
| v1.1.4 | 2024-12-16 | GitLab integration |
| v1.1.0 | 2024-12-01 | Vue3 upgrade |
| v1.0.0 | 2024-11-15 | First stable |
MIT License - see LICENSE file.
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📖 Docs: Wiki
- 📱 WeChat: Follow "小唐的技术日志" for updates
GoAnalysis - Empowering Go developers
⭐ Star us on GitHub!
