A Kubernetes-native Go microservice framework for building production-grade gRPC services
Documentation · Getting Started · Packages · How-To Guides · Config Reference
ColdBrew is a collection of Go libraries for creating cloud-native microservices. Built for Kubernetes, follows 12-factor principles, production-proven at 100+ microservices handling ~70k QPS each.
| Feature | Description |
|---|---|
| gRPC + REST Gateway | Define your API once in protobuf — get gRPC, REST, and Swagger docs automatically via grpc-gateway |
| Structured Logging | Pluggable backends (go-kit, zap, logrus) with per-request context fields and trace ID propagation |
| Distributed Tracing | OpenTelemetry, Jaeger, and New Relic support with automatic span creation |
| Prometheus Metrics | Built-in request latency, error rate, and circuit breaker metrics at /metrics |
| Error Tracking | Stack traces, gRPC status codes, and async notification to Sentry, Rollbar, or Airbrake |
| Resilience | Client-side circuit breaking and retries via interceptors |
| Fast Serialization | vtprotobuf codec enabled by default — faster gRPC marshalling with automatic fallback |
| Kubernetes-native | Health/ready probes, graceful SIGTERM shutdown, structured JSON logs, env var config via envconfig |
| Swagger / OpenAPI | Interactive API docs auto-served at /swagger/ from your protobuf definitions |
| Profiling | Go pprof endpoints at /debug/pprof/ for CPU, memory, goroutine, and trace profiling |
| gRPC Reflection | Server reflection enabled by default — works with grpcurl, grpcui, and Postman |
| HTTP Compression | Automatic gzip compression for all HTTP gateway responses |
| Container-aware Runtime | Auto-tunes GOMAXPROCS to match container CPU limits via automaxprocs |
| Package | Description |
|---|---|
| core | gRPC server + HTTP gateway, health checks, metrics, signal handling, graceful shutdown |
| interceptors | gRPC server/client interceptors for logging, tracing, metrics, errors, retries |
| errors | Enhanced errors with stack traces, gRPC status codes, error notification (Sentry/Rollbar) |
| log | Structured logging with pluggable backends (go-kit, zap, logrus) |
| tracing | Distributed tracing via OpenTelemetry, OpenTracing, Jaeger, New Relic |
| options | Request-scoped key-value store using context |
| grpcpool | Round-robin gRPC connection pool |
| data-builder | Dependency injection with automatic resolution and parallel execution |
options → errors → log → tracing → grpcpool → interceptors → data-builder → core
# Install cookiecutter
brew install cookiecutter # or: pip install cookiecutter
# Generate a new service
cookiecutter gh:go-coldbrew/cookiecutter-coldbrew
# Build and run
cd YourService/
make runYour service starts with gRPC + REST gateway, Prometheus metrics, health checks, and Swagger UI — all out of the box.
All ColdBrew packages are licensed under the Apache License 2.0.
