Use Go modules: go mod tidy, go mod download
| Command | Description |
|---|---|
make build |
Build the Go module |
make build-dist |
Build optimized production binary to dist/ |
make build-docker |
Build Docker image |
make test |
Run all tests |
make test-coverage |
Run tests with coverage report |
make vet |
Run go vet static analysis |
make lint |
Run golangci-lint |
make lint-fix |
Lint with auto-fix |
make format |
Format code and tidy modules |
make mod-tidy |
Check go.mod tidiness (CI check) |
make fmt-check |
Check formatting (CI check) |
make upgrade-deps |
Update all dependencies |
make help |
Show all available commands |
AI commits MUST include:
Co-Authored-By: (the agent model's name and attribution byline)
- Follow Sentry commit conventions
- Format:
<type>(<scope>): <subject> - Types:
feat,fix,ref,perf,docs,test,build,ci,chore - Imperative mood, no period, max 70 chars
cmd/agent/main.go- Application entry pointinternal/agent/- All business logic and handlersk8s/manifests/- Kubernetes deployment manifestsk8s/errors/- Test error scenario manifests.github/workflows/- CI/CD pipelines
- Read-only Kubernetes agent - watches cluster events, sends to Sentry
- Never writes to the Kubernetes API
- Uses informers for Jobs, CronJobs, Deployments, ReplicaSets
- Uses watchers for Events and Pods
- Enhancers enrich Sentry events with K8s metadata
- Supports custom DSNs via
k8s.sentry.io/dsnannotation
- First-time setup:
make init(installs Brew deps, Go modules, pre-commit hooks) - Pre-commit hooks run: build, test, go fix, vet, lint, and dprint formatting
- Logging:
github.com/rs/zerolog - K8s client:
k8s.io/client-gov0.35 - Error reporting:
github.com/getsentry/sentry-go - Docker: multi-stage build,
gcr.io/distroless/static:nonrootruntime - RBAC: read-only (
watch,list,getonly) - Run
go fix ./...to apply Go modernizations (also in pre-commit)
SENTRY_DSN- Required. Sentry project DSNSENTRY_ENVIRONMENT- Sentry environment nameSENTRY_K8S_WATCH_NAMESPACES- Comma-separated namespaces,__all__for allSENTRY_K8S_MONITOR_CRONJOBS-1to enable Crons integrationSENTRY_K8S_CUSTOM_DSNS-1to enable per-resource DSN annotationsSENTRY_K8S_LOG_LEVEL-trace/debug/info/warn/error/fatal/panic/disabledSENTRY_K8S_GLOBAL_TAG_*- Custom tags (prefix stripped)SENTRY_K8S_CLUSTER_CONFIG_TYPE-auto/in-cluster/out-cluster