-
Notifications
You must be signed in to change notification settings - Fork 0
Docs: improve approachability, discoverability, and content depth #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c89bcba
fix: resolve Getting Started vs Quickstart navigation confusion
ankurs ca4956d
docs: add config reference, production guide, expand howto guides, im…
ankurs d8b18e3
docs: add vtprotobuf documentation across home, integrations, and howto
ankurs 360b2ef
docs: add vtprotobuf to home page DRY section and FAQ
ankurs 1da3912
docs: add Kubernetes-native and 12-factor messaging
ankurs de63bcf
docs: add Swagger, pprof, gRPC reflection, gzip, automaxprocs to feat…
ankurs c959b86
docs: add Self-Documenting APIs section to architecture page
ankurs fdab711
docs: replace Minimal Service Example with Define Once proto snippet
ankurs a53491c
docs: add compile-time safety messaging across home, architecture, qu…
ankurs ae94b72
docs: remove dependency chain and standalone note from home page Pack…
ankurs 116a6a1
docs: restore standalone package usage note on home page
ankurs 513a140
docs: document trace ID auto-extraction from HTTP headers and proto f…
ankurs 6a75dba
test: update Playwright tests for navigation changes and new pages
ankurs a111093
docs: link grpcui in feature table, soften contract guarantee language
ankurs 826ebd8
docs: address PR review feedback
ankurs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| --- | ||
| layout: default | ||
| title: "Configuration Reference" | ||
| nav_order: 5 | ||
| description: "Complete environment variable reference for ColdBrew Go microservice framework configuration" | ||
| permalink: /config-reference | ||
| --- | ||
| # Configuration Reference | ||
| {: .no_toc } | ||
|
|
||
| ## Table of contents | ||
| {: .no_toc .text-delta } | ||
|
|
||
| 1. TOC | ||
| {:toc} | ||
|
|
||
| --- | ||
|
|
||
| ColdBrew is configured entirely through environment variables using [envconfig](https://github.com/kelseyhightower/envconfig). All fields have sensible defaults — you can run a service with zero configuration. | ||
|
|
||
| Access the config in code via: | ||
|
|
||
| ```go | ||
| cfg := config.GetColdBrewConfig() | ||
| ``` | ||
|
|
||
| ## Server | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `LISTEN_HOST` | string | `0.0.0.0` | Host address to listen on | | ||
| | `GRPC_PORT` | int | `9090` | gRPC server port | | ||
| | `HTTP_PORT` | int | `9091` | HTTP gateway port | | ||
| | `APP_NAME` | string | `""` | Application name (used in logs, metrics, New Relic) | | ||
| | `ENVIRONMENT` | string | `""` | Environment name (e.g., production, staging, development) | | ||
| | `RELEASE_NAME` | string | `""` | Release/version name | | ||
|
|
||
| ## Logging | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `LOG_LEVEL` | string | `info` | Log level: debug, info, warn, error | | ||
| | `JSON_LOGS` | bool | `true` | Emit logs in JSON format | | ||
|
|
||
| ## gRPC Server | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `DISABLE_GRPC_REFLECTION` | bool | `false` | Disable gRPC server reflection (used by tools like grpcurl) | | ||
| | `DO_NOT_LOG_GRPC_REFLECTION` | bool | `true` | Suppress logging of gRPC reflection API calls | | ||
| | `GRPC_MAX_SEND_MSG_SIZE` | int | `2147483647` | Maximum send message size in bytes (default: ~2GB, unlimited) | | ||
| | `GRPC_MAX_RECV_MSG_SIZE` | int | `4194304` | Maximum receive message size in bytes (default: 4MB) | | ||
| | `DISABLE_VT_PROTOBUF` | bool | `false` | Disable [vtprotobuf](https://github.com/planetscale/vtprotobuf) marshaller for gRPC | | ||
|
|
||
| ## gRPC TLS | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `GRPC_TLS_KEY_FILE` | string | `""` | Path to TLS private key file. Both key and cert must be set to enable TLS | | ||
| | `GRPC_TLS_CERT_FILE` | string | `""` | Path to TLS certificate file. Both key and cert must be set to enable TLS | | ||
| | `GRPC_TLS_INSECURE_SKIP_VERIFY` | bool | `false` | Skip TLS certificate verification (development only) | | ||
|
|
||
| ## gRPC Keepalive | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `GRPC_SERVER_MAX_CONNECTION_IDLE_IN_SECONDS` | int | `0` | Close idle connections after this duration (0 = disabled) | | ||
| | `GRPC_SERVER_MAX_CONNECTION_AGE_IN_SECONDS` | int | `0` | Maximum connection lifetime with ±10% jitter (0 = disabled) | | ||
| | `GRPC_SERVER_MAX_CONNECTION_AGE_GRACE_IN_SECONDS` | int | `0` | Grace period after max connection age before force-closing | | ||
|
|
||
| ## HTTP Gateway | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `DISABLE_SWAGGER` | bool | `false` | Disable Swagger UI at the swagger URL | | ||
| | `SWAGGER_URL` | string | `/swagger/` | URL path for Swagger UI | | ||
| | `DISABLE_DEBUG` | bool | `false` | Disable pprof debug endpoints at `/debug/` | | ||
| | `USE_JSON_BUILTIN_MARSHALLER` | bool | `false` | Use `encoding/json` instead of the default protojson marshaller for `application/json` | | ||
| | `JSON_BUILTIN_MARSHALLER_MIME` | string | `application/json` | Content-Type for the JSON builtin marshaller | | ||
| | `HTTP_HEADER_PREFIXES` | []string | `""` | HTTP header prefixes to forward as gRPC metadata (comma-separated) | | ||
| | `TRACE_HEADER_NAME` | string | `x-trace-id` | HTTP header name for trace ID propagation to log/trace contexts | | ||
|
|
||
| ## Prometheus Metrics | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `DISABLE_PROMETHEUS` | bool | `false` | Disable Prometheus metrics endpoint at `/metrics` | | ||
| | `ENABLE_PROMETHEUS_GRPC_HISTOGRAM` | bool | `true` | Enable gRPC request latency histograms | | ||
| | `PROMETHEUS_GRPC_HISTOGRAM_BUCKETS` | []float64 | `""` | Custom histogram buckets (comma-separated seconds, e.g., `0.005,0.01,0.025,0.05,0.1,0.25,0.5,1,2.5,5,10`) | | ||
|
|
||
| ## New Relic | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `NEW_RELIC_LICENSE_KEY` | string | `""` | New Relic license key (required to enable New Relic) | | ||
| | `NEW_RELIC_APPNAME` | string | `""` | Application name in New Relic | | ||
| | `DISABLE_NEW_RELIC` | bool | `false` | Disable all New Relic reporting | | ||
| | `NEW_RELIC_DISTRIBUTED_TRACING` | bool | `true` | Enable New Relic distributed tracing | | ||
| | `NEW_RELIC_OPENTELEMETRY` | bool | `true` | Enable New Relic via OpenTelemetry | | ||
| | `NEW_RELIC_OPENTELEMETRY_SAMPLE` | float64 | `0.2` | Trace sampling ratio for New Relic OpenTelemetry (0.0–1.0) | | ||
|
|
||
| ## OpenTelemetry (OTLP) | ||
|
|
||
| {: .note } | ||
| When `OTLP_ENDPOINT` is set, it takes precedence over New Relic OpenTelemetry configuration. | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `OTLP_ENDPOINT` | string | `""` | OTLP gRPC endpoint (e.g., `localhost:4317`, `api.honeycomb.io:443`) | | ||
| | `OTLP_HEADERS` | string | `""` | Custom headers as `key=value` pairs (comma-separated, e.g., `x-honeycomb-team=your-key`) | | ||
| | `OTLP_COMPRESSION` | string | `gzip` | Compression type: `gzip` or `none` | | ||
| | `OTLP_INSECURE` | bool | `false` | Disable TLS for OTLP connection (development only) | | ||
| | `OTLP_SAMPLING_RATIO` | float64 | `0.2` | Trace sampling ratio (0.0–1.0, where 1.0 = sample all) | | ||
| | `OTLP_USE_OPENTRACING_BRIDGE` | bool | `true` | Enable OpenTracing compatibility bridge for existing instrumentation | | ||
|
|
||
| ## Error Tracking | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `SENTRY_DSN` | string | `""` | Sentry DSN for error notification | | ||
|
|
||
| ## Graceful Shutdown | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `DISABLE_SIGNAL_HANDLER` | bool | `false` | Disable ColdBrew's SIGINT/SIGTERM handler | | ||
| | `SHUTDOWN_DURATION_IN_SECONDS` | int | `15` | Time to wait for in-flight requests to complete before forced shutdown | | ||
| | `GRPC_GRACEFUL_DURATION_IN_SECONDS` | int | `7` | Time to wait for healthcheck failure to propagate before initiating shutdown. Should be less than `SHUTDOWN_DURATION_IN_SECONDS` | | ||
|
|
||
| ## Runtime | ||
|
|
||
| | Variable | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `DISABLE_AUTO_MAX_PROCS` | bool | `false` | Disable automatic GOMAXPROCS tuning (useful if your container runtime already sets it) | | ||
|
|
||
| ## Deprecated | ||
|
|
||
| | Variable | Replacement | Notes | | ||
| |----------|------------|-------| | ||
| | `HTTP_HEADER_PREFIX` | `HTTP_HEADER_PREFIXES` | Single prefix replaced by comma-separated list | | ||
|
|
||
| --- | ||
|
|
||
| ## Example: Minimal Production Configuration | ||
|
|
||
| ```bash | ||
| export APP_NAME=myservice | ||
| export ENVIRONMENT=production | ||
| export LOG_LEVEL=info | ||
| export NEW_RELIC_LICENSE_KEY=your-key | ||
| export NEW_RELIC_APPNAME=myservice | ||
| export SENTRY_DSN=https://your-dsn@sentry.io/123 | ||
| ``` | ||
|
|
||
| ## Example: Local Development with Jaeger | ||
|
|
||
| ```bash | ||
| export APP_NAME=myservice | ||
| export ENVIRONMENT=development | ||
| export LOG_LEVEL=debug | ||
| export OTLP_ENDPOINT=localhost:4317 | ||
| export OTLP_INSECURE=true | ||
| export OTLP_SAMPLING_RATIO=1.0 | ||
| export DISABLE_NEW_RELIC=true | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| Source: [`core/config/config.go`](https://github.com/go-coldbrew/core/blob/main/config/config.go) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.