Complete guide for setting up a local development environment for SentinelAI, covering all prerequisites, local Kubernetes options, and development workflows.
- Prerequisites
- Quick Start
- Local Kubernetes Options
- Development Tools Setup
- SigNoz Fork Setup
- Development Workflow
- Troubleshooting
- CPU: 4 cores
- Memory: 8GB RAM
- Storage: 20GB free space
- OS: macOS, Linux, or Windows with WSL2
- CPU: 8 cores
- Memory: 16GB RAM
- Storage: 50GB free space (SSD recommended)
- Network: Stable internet connection for image downloads
-
Go (1.21+)
# macOS brew install go # Linux wget https://go.dev/dl/go1.21.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.21.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin # Windows (WSL2) wget https://go.dev/dl/go1.21.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.21.linux-amd64.tar.gz
-
Node.js (18+)
# Using nvm (recommended) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash nvm install 18 nvm use 18 # macOS with Homebrew brew install node@18 # Linux package manager curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs
-
Git
# macOS brew install git # Linux sudo apt-get install git # Configure Git git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
-
Docker Desktop
- Download from docker.com
- Enable Kubernetes in Docker Desktop settings
- Allocate minimum 8GB RAM and 4 CPU cores
-
kubectl
# macOS brew install kubectl # Linux curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl # Verify installation kubectl version --client
-
Helm 3
# macOS brew install helm # Linux curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash # Verify installation helm version
-
GitHub CLI (Recommended)
# macOS brew install gh # Linux curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt update sudo apt install gh # Authenticate gh auth login
-
IDE/Editor Setup
- VS Code with Go and React extensions
- GoLand for comprehensive Go development
- WebStorm for frontend development
# Clone SentinelAI repository
git clone https://github.com/your-username/SentinelAI.git
cd SentinelAI
# Copy environment template and configure
cp .env.example .env
# Edit .env with your settings
# Run complete setup
make setupThis automated setup will:
- Fork and clone SigNoz repository
- Set up local Kubernetes cluster
- Deploy SigNoz for baseline testing
- Configure development environment
If you prefer manual setup or need to troubleshoot:
# 1. Fork and clone SigNoz
./scripts/fork-signoz.sh
# 2. Set up local Kubernetes
./scripts/setup-local-k8s.sh
# 3. Deploy SigNoz for development
./scripts/deploy-signoz-dev.sh- Install Docker Desktop
- Enable Kubernetes in Settings → Kubernetes
- Allocate resources in Settings → Resources:
- Memory: 8GB minimum
- CPUs: 4 minimum
- Swap: 2GB
- Disk: 64GB
# Check Docker Desktop context
kubectl config current-context
# Should show: docker-desktop
# Verify cluster
kubectl cluster-info
kubectl get nodes# Verify default StorageClass
kubectl get storageclass
# Should show 'hostpath' as default
# If needed, set default StorageClass
kubectl patch storageclass hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'# macOS
brew install minikube
# Linux
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube /usr/local/bin/# Start with adequate resources
minikube start \
--memory=8g \
--cpus=4 \
--disk-size=20g \
--kubernetes-version=stable
# Enable required addons
minikube addons enable default-storageclass
minikube addons enable storage-provisioner
# Verify setup
kubectl get nodes
kubectl get storageclass# Check status
minikube status
# Access dashboard
minikube dashboard
# Get cluster IP for services
minikube service list
# SSH into minikube
minikube ssh
# Stop/Delete cluster
minikube stop
minikube delete# macOS
brew install kind
# Linux
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind# Create cluster with SentinelAI configuration
kind create cluster --name sentinelai-dev --config kubernetes/local/kind-config.yaml
# If config file doesn't exist, create basic cluster
kind create cluster --name sentinelai-dev
# Set context
kubectl config use-context kind-sentinelai-devkind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: sentinelai-dev
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 8080
protocol: TCP
- containerPort: 443
hostPort: 8443
protocol: TCP
- containerPort: 3301
hostPort: 3301
protocol: TCP
- role: worker# Install VS Code extensions
code --install-extension golang.go
code --install-extension ms-vscode.vscode-typescript-next
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension ms-vscode.docker
# Workspace settings (.vscode/settings.json)
{
"go.useLanguageServer": true,
"go.gocodeAutoBuild": true,
"typescript.preferences.quoteStyle": "double",
"kubernetes.kubectl-path": "/usr/local/bin/kubectl"
}# Install useful Go tools
go install golang.org/x/tools/gopls@latest
go install github.com/go-delve/delve/cmd/dlv@latest
go install golang.org/x/tools/cmd/goimports@latest
# Configure Go environment
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin# Navigate to SigNoz frontend directory
cd signoz/frontend
# Install dependencies
npm install
# Install additional development tools
npm install -g @typescript-eslint/eslint-plugin
npm install -g prettier
# Configure Prettier
echo '{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "es5"
}' > .prettierrc# macOS
brew install clickhouse
# Linux
sudo apt-get install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install clickhouse-client
# Connect to local ClickHouse (after deployment)
clickhouse-client --host localhost --port 9000- DBeaver: Universal database client
- ClickHouse Tabix: Web-based ClickHouse interface
- DataGrip: JetBrains database IDE
After running ./scripts/fork-signoz.sh, you'll have:
SentinelAI/
├── signoz/ # Forked SigNoz repository
│ ├── cmd/ # Main applications
│ ├── pkg/ # Core packages
│ ├── frontend/ # React frontend
│ ├── deploy/ # Deployment configs
│ └── ...
├── scripts/ # SentinelAI automation
├── docs/ # SentinelAI documentation
└── kubernetes/ # Local development configs
cd signoz
# Main development branch
git checkout sentinelai-develop
# Create feature branches
git checkout -b feature/multi-tenant-auth
git checkout -b feature/ai-insights
git checkout -b feature/smb-dashboards
# Sync with upstream
git fetch upstream
git checkout sentinelai-develop
git merge upstream/main# Make changes in the signoz/ directory
cd signoz
# Backend changes
# Edit files in pkg/, cmd/, etc.
# Frontend changes
cd frontend
npm start # Start development server
# Test changes
cd ..
go test ./...
# Build and test locally
docker build -t sentinelai-local .# Start local Kubernetes (if not running)
minikube start # or use Docker Desktop
# Check cluster status
kubectl cluster-info
# Start SigNoz if needed
make deploy-dev# Navigate to SigNoz directory
cd signoz
# Start frontend development server
cd frontend
npm start
# In another terminal, work on backend
cd ../
# Make changes to Go code
# Test changes
go test ./pkg/...
# Build and restart services as needed
kubectl rollout restart deployment/signoz-frontend -n sentinelai-dev# Run unit tests
go test ./...
# Run frontend tests
cd frontend
npm test
# Integration testing
kubectl get pods -n sentinelai-dev
kubectl logs -f deployment/signoz-frontend -n sentinelai-dev
# Access application
open http://localhost:3301# Enable debug logging
export LOG_LEVEL=debug
# Use delve for debugging
cd signoz
dlv debug ./cmd/...
# Remote debugging in Kubernetes
kubectl port-forward pod/signoz-backend-xxx 2345:2345
dlv connect localhost:2345# React Developer Tools browser extension
# Browser DevTools for network and performance
# VS Code debugger configuration
# .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/signoz/frontend/src"
}
]
}# Connect to ClickHouse
kubectl port-forward svc/clickhouse 9000:9000 -n sentinelai-dev
clickhouse-client --host localhost --port 9000
# Query tenant data
SELECT tenantID, count() FROM distributed_traces_tenant GROUP BY tenantID;
# Check table structure
DESCRIBE distributed_traces_tenant;# Reduce resource requests in values-dev.yaml
# Use local Docker registry for faster image pulls
# Enable hot reload for frontend development
# Frontend hot reload
cd signoz/frontend
npm start -- --host 0.0.0.0 --port 3000
# Backend hot reload with air
go install github.com/cosmtrek/air@latest
air -c .air.toml# Monitor cluster resources
kubectl top nodes
kubectl top pods -n sentinelai-dev
# Monitor specific services
kubectl logs -f deployment/signoz-backend -n sentinelai-dev
kubectl describe pod signoz-clickhouse-xxx -n sentinelai-devIssue: Cluster not starting or pods stuck in pending
# Check cluster status
kubectl cluster-info
kubectl get nodes
# Check events
kubectl get events --sort-by='.lastTimestamp'
# Check resource usage
kubectl top nodes
kubectl describe node <node-name>
# Solution: Increase cluster resources or restart cluster
minikube stop && minikube start --memory=8g --cpus=4Issue: Persistent volumes not mounting
# Check StorageClass
kubectl get storageclass
# Check PVC status
kubectl get pvc -n sentinelai-dev
# Solution: Ensure default StorageClass is set
kubectl patch storageclass <storage-class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'Issue: Cannot access SigNoz UI
# Check services
kubectl get svc -n sentinelai-dev
# Manual port forwarding
kubectl port-forward svc/signoz-frontend 3301:3301 -n sentinelai-dev
# Check if ports are in use
lsof -i :3301
kill -9 <pid> # if neededIssue: Go build failures
# Check Go version
go version
# Clean module cache
go clean -modcache
# Update dependencies
cd signoz
go mod tidy
go mod downloadIssue: Frontend build failures
# Check Node.js version
node --version
npm --version
# Clear npm cache
npm cache clean --force
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install# Collect cluster information
kubectl cluster-info dump > cluster-info.txt
# Collect pod logs
kubectl logs deployment/signoz-frontend -n sentinelai-dev > frontend.log
kubectl logs deployment/signoz-backend -n sentinelai-dev > backend.log
# Collect system information
uname -a > system-info.txt
docker version >> system-info.txt
kubectl version >> system-info.txt- GitHub Issues: SentinelAI Issues
- SigNoz Community: SigNoz Slack
- Documentation: Review docs/ directory for detailed guides
This development setup guide provides a comprehensive foundation for SentinelAI development. The local Kubernetes environment enables full-stack development with realistic production-like conditions while maintaining fast iteration cycles.
Key success factors:
- Adequate Resources: Ensure sufficient CPU and memory allocation
- Tool Familiarity: Invest time in learning kubectl and debugging tools
- Incremental Development: Test changes frequently in the local environment
- Documentation: Keep notes on customizations and integration points
- Community Engagement: Leverage both SigNoz and broader Kubernetes communities
With this setup, you're ready to develop powerful SentinelAI enhancements while maintaining compatibility with the robust SigNoz foundation.