{"id":21951883,"url":"https://github.com/go-coldbrew/core","last_synced_at":"2026-05-01T16:01:09.302Z","repository":{"id":42632161,"uuid":"313239196","full_name":"go-coldbrew/core","owner":"go-coldbrew","description":"Go microservice framework — gRPC server, HTTP gateway, observability, graceful shutdown","archived":false,"fork":false,"pushed_at":"2026-04-27T07:53:10.000Z","size":482,"stargazers_count":5,"open_issues_count":3,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T09:25:39.780Z","etag":null,"topics":["coldbrew","framework","go","golang","grpc","grpc-gateway","lightweight","microservice","microservices","observability","opentelemetry","prometheus"],"latest_commit_sha":null,"homepage":"https://docs.coldbrew.cloud","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-coldbrew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-16T08:41:59.000Z","updated_at":"2026-04-27T07:52:10.000Z","dependencies_parsed_at":"2025-03-26T06:22:36.431Z","dependency_job_id":"a8ae905c-b2da-41ef-a08b-5139e07c45da","html_url":"https://github.com/go-coldbrew/core","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/go-coldbrew/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-coldbrew","download_url":"https://codeload.github.com/go-coldbrew/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Fcore/sbom","scorecard":{"id":431545,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-coldbrew/core","commit":"e7d8b08067d20fa0087138d7ab4464bfc48889d7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":4,"reason":"Found 8/17 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/go-coldbrew/core/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/go-coldbrew/core/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":1,"reason":"SAST tool is not run on all commits -- score normalized to 1","details":["Warn: 4 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:28:02.578Z","repository_id":42632161,"created_at":"2025-08-19T03:28:02.578Z","updated_at":"2025-08-19T03:28:02.578Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32503204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coldbrew","framework","go","golang","grpc","grpc-gateway","lightweight","microservice","microservices","observability","opentelemetry","prometheus"],"created_at":"2024-11-29T06:18:01.901Z","updated_at":"2026-05-01T16:01:09.116Z","avatar_url":"https://github.com/go-coldbrew.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n# ColdBrew\n\n[![CI](https://github.com/go-coldbrew/core/actions/workflows/go.yml/badge.svg)](https://github.com/go-coldbrew/core/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-coldbrew/core)](https://goreportcard.com/report/github.com/go-coldbrew/core)\n[![GoDoc](https://pkg.go.dev/badge/github.com/go-coldbrew/core.svg)](https://pkg.go.dev/github.com/go-coldbrew/core)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**A Go microservice framework for building production-grade gRPC services with built-in observability, resilience, and HTTP gateway support.**\n\nColdBrew powers 100+ microservices serving 70k+ QPS each in production. It provides a batteries-included foundation so you can focus on business logic instead of boilerplate.\n\n## Packages\n\nColdBrew is a collection of composable packages:\n\n| Package | Description |\n|---------|-------------|\n| **[core](https://github.com/go-coldbrew/core)** | gRPC server, HTTP gateway, health checks, Prometheus metrics, graceful shutdown |\n| **[interceptors](https://github.com/go-coldbrew/interceptors)** | Chained gRPC interceptors: logging, tracing, Prometheus, circuit breaking, retries |\n| **[errors](https://github.com/go-coldbrew/errors)** | Enhanced errors with stack traces, gRPC status codes, error notification |\n| **[log](https://github.com/go-coldbrew/log)** | Structured logging with pluggable backends (zap, logrus, go-kit) |\n| **[tracing](https://github.com/go-coldbrew/tracing)** | Distributed tracing: OpenTelemetry, OpenTracing, NewRelic |\n| **[options](https://github.com/go-coldbrew/options)** | Request-scoped key-value metadata via context |\n| **[grpcpool](https://github.com/go-coldbrew/grpcpool)** | Round-robin gRPC connection pool |\n| **[data-builder](https://github.com/go-coldbrew/data-builder)** | Dependency injection with automatic resolution and parallel execution |\n| **[workers](https://github.com/go-coldbrew/workers)** | Background worker lifecycle with panic recovery, restart, and tracing |\n\n## Quick Start\n\n```bash\n# Generate a new service from the template\npip install cookiecutter\ncookiecutter gh:go-coldbrew/cookiecutter-coldbrew\n\n# Build and run\ncd YourApp\nmake run\n```\n\nYour service starts with gRPC on `:9090`, HTTP gateway on `:9091`, Prometheus metrics at `/metrics`, and health checks at `/healthcheck` and `/readycheck`.\n\n## Documentation\n\n- **[docs.coldbrew.cloud](https://docs.coldbrew.cloud)** — Full documentation, guides, and integrations\n- **[Getting Started](https://docs.coldbrew.cloud/getting-started)** — Create your first service with cookiecutter\n- **[How-To Guides](https://docs.coldbrew.cloud/howto)** — Tracing, logging, metrics, error handling, and more\n\n---\n\n## API Reference\n\n\n\n# core\n\n```go\nimport \"github.com/go-coldbrew/core\"\n```\n\nPackage core is the main entry point for the ColdBrew microservice framework. It creates a gRPC server with an HTTP gateway \\(via grpc\\-gateway\\), wires health checks, Prometheus metrics, pprof endpoints, signal handling, graceful shutdown, and all interceptors. Services implement the [CBService](\u003c#CBService\u003e) interface to register their gRPC and HTTP handlers.\n\nColdBrew builds on proven open\\-source libraries:\n\n- [github.com/grpc\\\\\\-ecosystem/grpc\\\\\\-gateway](\u003chttps://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/\u003e) — REST gateway for gRPC services\n- [github.com/prometheus/client\\\\\\_golang](\u003chttps://pkg.go.dev/github.com/prometheus/client_golang/\u003e) — Prometheus metrics\n- [go.opentelemetry.io/otel](\u003chttps://pkg.go.dev/go.opentelemetry.io/otel/\u003e) — Distributed tracing via OpenTelemetry\n- [github.com/newrelic/go\\\\\\-agent](\u003chttps://pkg.go.dev/github.com/newrelic/go-agent/\u003e) — New Relic APM integration\n\n### Usage\n\n```\ncb := core.New(config.Config{\n    GRPCPort:    \"9090\",\n    HTTPPort:    \"9091\",\n    ServiceName: \"my-service\",\n})\ncb.SetService(myService)\ncb.Run()\n```\n\nFor full documentation, visit https://docs.coldbrew.cloud\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n- [func InitializeVTProto\\(\\)](\u003c#InitializeVTProto\u003e)\n- [func OTELMeterProvider\\(\\) otelmetric.MeterProvider](\u003c#OTELMeterProvider\u003e)\n- [func SetOTELGRPCClientOptions\\(opts ...otelgrpc.Option\\)](\u003c#SetOTELGRPCClientOptions\u003e)\n- [func SetOTELGRPCServerOptions\\(opts ...otelgrpc.Option\\)](\u003c#SetOTELGRPCServerOptions\u003e)\n- [func SetOTELOptions\\(opts grpcotel.Options\\)](\u003c#SetOTELOptions\u003e)\n- [func SetupAutoMaxProcs\\(\\)](\u003c#SetupAutoMaxProcs\u003e)\n- [func SetupEnvironment\\(env string\\)](\u003c#SetupEnvironment\u003e)\n- [func SetupHystrixPrometheus\\(\\)](\u003c#SetupHystrixPrometheus\u003e)\n- [func SetupLogger\\(logLevel string, jsonlogs bool\\) error](\u003c#SetupLogger\u003e)\n- [func SetupNROpenTelemetry\\(serviceName, license, version string, ratio float64\\) error](\u003c#SetupNROpenTelemetry\u003e)\n- [func SetupNewRelic\\(serviceName, apiKey string, tracing bool\\) error](\u003c#SetupNewRelic\u003e)\n- [func SetupOTELMetrics\\(config OTLPConfig, interval time.Duration\\) \\(\\*sdkmetric.MeterProvider, error\\)](\u003c#SetupOTELMetrics\u003e)\n- [func SetupOpenTelemetry\\(config OTLPConfig\\) error](\u003c#SetupOpenTelemetry\u003e)\n- [func SetupReleaseName\\(rel string\\)](\u003c#SetupReleaseName\u003e)\n- [func SetupSentry\\(dsn string\\)](\u003c#SetupSentry\u003e)\n- [type CB](\u003c#CB\u003e)\n  - [func New\\(c config.Config\\) CB](\u003c#New\u003e)\n- [type CBGracefulStopper](\u003c#CBGracefulStopper\u003e)\n- [type CBPostStarter](\u003c#CBPostStarter\u003e)\n- [type CBPostStopper](\u003c#CBPostStopper\u003e)\n- [type CBPreStarter](\u003c#CBPreStarter\u003e)\n- [type CBPreStopper](\u003c#CBPreStopper\u003e)\n- [type CBService](\u003c#CBService\u003e)\n- [type CBStopper](\u003c#CBStopper\u003e)\n- [type CBWorkerProvider](\u003c#CBWorkerProvider\u003e)\n- [type OTLPConfig](\u003c#OTLPConfig\u003e)\n\n\n## Constants\n\n\u003ca name=\"SupportPackageIsVersion1\"\u003e\u003c/a\u003eSupportPackageIsVersion1 is a compile\\-time assertion constant. Downstream packages reference this to enforce version compatibility.\n\n```go\nconst SupportPackageIsVersion1 = true\n```\n\n\u003ca name=\"InitializeVTProto\"\u003e\u003c/a\u003e\n## func [InitializeVTProto](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L452\u003e)\n\n```go\nfunc InitializeVTProto()\n```\n\nInitializeVTProto initializes the vtproto package for use with the service\n\nhttps://github.com/planetscale/vtprotobuf?tab=readme-ov-file#mixing-protobuf-implementations-with-grpc\n\n\u003ca name=\"OTELMeterProvider\"\u003e\u003c/a\u003e\n## func [OTELMeterProvider](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L347\u003e)\n\n```go\nfunc OTELMeterProvider() otelmetric.MeterProvider\n```\n\nOTELMeterProvider returns the global OTel MeterProvider. This is a convenience accessor for code that needs the interface type.\n\n\u003ca name=\"SetOTELGRPCClientOptions\"\u003e\u003c/a\u003e\n## func [SetOTELGRPCClientOptions](\u003chttps://github.com/go-coldbrew/core/blob/main/core.go#L623\u003e)\n\n```go\nfunc SetOTELGRPCClientOptions(opts ...otelgrpc.Option)\n```\n\nDeprecated: Use SetOTELOptions instead. Only applies when OTEL\\_USE\\_LEGACY\\_INSTRUMENTATION=true.\n\n\u003ca name=\"SetOTELGRPCServerOptions\"\u003e\u003c/a\u003e\n## func [SetOTELGRPCServerOptions](\u003chttps://github.com/go-coldbrew/core/blob/main/core.go#L617\u003e)\n\n```go\nfunc SetOTELGRPCServerOptions(opts ...otelgrpc.Option)\n```\n\nDeprecated: Use SetOTELOptions instead. Only applies when OTEL\\_USE\\_LEGACY\\_INSTRUMENTATION=true.\n\n\u003ca name=\"SetOTELOptions\"\u003e\u003c/a\u003e\n## func [SetOTELOptions](\u003chttps://github.com/go-coldbrew/core/blob/main/core.go#L630\u003e)\n\n```go\nfunc SetOTELOptions(opts grpcotel.Options)\n```\n\nSetOTELOptions configures the native gRPC stats/opentelemetry integration. Must be called during init, before the gRPC server starts. When set, processConfig\\(\\) will NOT overwrite these with auto\\-built options.\n\n\u003ca name=\"SetupAutoMaxProcs\"\u003e\u003c/a\u003e\n## func [SetupAutoMaxProcs](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L418\u003e)\n\n```go\nfunc SetupAutoMaxProcs()\n```\n\nSetupAutoMaxProcs sets up the GOMAXPROCS to match Linux container CPU quota This is used to set the GOMAXPROCS to the number of CPUs allocated to the container\n\n\u003ca name=\"SetupEnvironment\"\u003e\u003c/a\u003e\n## func [SetupEnvironment](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L101\u003e)\n\n```go\nfunc SetupEnvironment(env string)\n```\n\nSetupEnvironment sets the environment This is used to identify the environment in Sentry and New Relic env is the environment to set for the service \\(e.g. prod, staging, dev\\)\n\n\u003ca name=\"SetupHystrixPrometheus\"\u003e\u003c/a\u003e\n## func [SetupHystrixPrometheus](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L384\u003e)\n\n```go\nfunc SetupHystrixPrometheus()\n```\n\nSetupHystrixPrometheus sets up the hystrix metrics This is a workaround for hystrix\\-go not supporting the prometheus registry It uses sync.Once to ensure the Prometheus collectors are only registered once, since duplicate registration panics.\n\n\u003ca name=\"SetupLogger\"\u003e\u003c/a\u003e\n## func [SetupLogger](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L74\u003e)\n\n```go\nfunc SetupLogger(logLevel string, jsonlogs bool) error\n```\n\nSetupLogger sets up the logger using ColdBrew's slog\\-native Handler. It calls log.SetDefault which also wires slog.SetDefault, so native slog.LogAttrs calls automatically get ColdBrew context fields. logLevel is the log level to set for the logger jsonlogs is a boolean to enable or disable json logs\n\n\u003ca name=\"SetupNROpenTelemetry\"\u003e\u003c/a\u003e\n## func [SetupNROpenTelemetry](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L361\u003e)\n\n```go\nfunc SetupNROpenTelemetry(serviceName, license, version string, ratio float64) error\n```\n\nSetupNROpenTelemetry sets up OpenTelemetry tracing with New Relic\n\nThis function configures OpenTelemetry to send traces to New Relic's OTLP endpoint. It's a convenience wrapper around SetupOpenTelemetry with New Relic\\-specific configuration.\n\nParameters:\n\n- serviceName: the name of the service\n- license: the New Relic license key\n- version: the version of the service\n- ratio: the sampling ratio to use for traces \\(0.0 to 1.0\\)\n\n\u003ca name=\"SetupNewRelic\"\u003e\u003c/a\u003e\n## func [SetupNewRelic](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L47\u003e)\n\n```go\nfunc SetupNewRelic(serviceName, apiKey string, tracing bool) error\n```\n\nSetupNewRelic sets up the New Relic tracing and monitoring agent for the service It uses the New Relic Go Agent to send traces to New Relic One APM and Insights serviceName is the name of the service apiKey is the New Relic license key tracing is a boolean to enable or disable tracing\n\n\u003ca name=\"SetupOTELMetrics\"\u003e\u003c/a\u003e\n## func [SetupOTELMetrics](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L296\u003e)\n\n```go\nfunc SetupOTELMetrics(config OTLPConfig, interval time.Duration) (*sdkmetric.MeterProvider, error)\n```\n\nSetupOTELMetrics creates a MeterProvider with an OTLP gRPC exporter that reuses the same resource as the TracerProvider \\(set by SetupOpenTelemetry\\). The MeterProvider is set as the global OTel MeterProvider.\n\nCall this after SetupOpenTelemetry so the shared resource is available.\n\n\u003ca name=\"SetupOpenTelemetry\"\u003e\u003c/a\u003e\n## func [SetupOpenTelemetry](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L227\u003e)\n\n```go\nfunc SetupOpenTelemetry(config OTLPConfig) error\n```\n\nSetupOpenTelemetry sets up OpenTelemetry tracing with a generic OTLP exporter.\n\nIt configures a TracerProvider with the given sampling ratio and OTLP backend, sets it as the global provider, and stores it for graceful shutdown.\n\nExample usage with Jaeger:\n\n```\nconfig := OTLPConfig{\n    Endpoint:       \"localhost:4317\",\n    ServiceName:    \"my-service\",\n    ServiceVersion: \"v1.0.0\",\n    SamplingRatio:  0.1,\n    Insecure:       true, // for local development\n}\nerr := SetupOpenTelemetry(config)\n```\n\nExample usage with Honeycomb:\n\n```\nconfig := OTLPConfig{\n    Endpoint:       \"api.honeycomb.io:443\",\n    Headers:        map[string]string{\"x-honeycomb-team\": \"your-api-key\"},\n    ServiceName:    \"my-service\",\n    ServiceVersion: \"v1.0.0\",\n    SamplingRatio:  0.2,\n}\nerr := SetupOpenTelemetry(config)\n```\n\n\u003ca name=\"SetupReleaseName\"\u003e\u003c/a\u003e\n## func [SetupReleaseName](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L110\u003e)\n\n```go\nfunc SetupReleaseName(rel string)\n```\n\nSetupReleaseName sets the release name This is used to identify the release in Sentry rel is the release name to set for the service \\(e.g. v1.0.0\\)\n\n\u003ca name=\"SetupSentry\"\u003e\u003c/a\u003e\n## func [SetupSentry](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L92\u003e)\n\n```go\nfunc SetupSentry(dsn string)\n```\n\nSetupSentry sets up the Sentry notifier It uses the Sentry HTTP Transport to send errors to Sentry server dsn is the Sentry DSN to use for sending errors\n\n\u003ca name=\"CB\"\u003e\u003c/a\u003e\n## type [CB](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L83-L95\u003e)\n\nCB is the interface that wraps coldbrew methods.\n\n```go\ntype CB interface {\n    // SetService sets the service.\n    SetService(CBService) error\n    // Run runs the service.\n    // Run is blocking. It returns an error if the service fails. Otherwise, it returns nil.\n    Run() error\n    // SetOpenAPIHandler sets the OpenAPI handler.\n    SetOpenAPIHandler(http.Handler)\n    // Stop stops the service.\n    // Stop is blocking. It returns an error if the service fails. Otherwise, it returns nil.\n    // duration is the duration to wait for the service to stop.\n    Stop(time.Duration) error\n}\n```\n\n\u003ca name=\"New\"\u003e\u003c/a\u003e\n### func [New](\u003chttps://github.com/go-coldbrew/core/blob/main/core.go#L1029\u003e)\n\n```go\nfunc New(c config.Config) CB\n```\n\nNew creates a new ColdBrew object It takes a config object and returns a CB interface The CB interface is used to start and stop the server The CB interface also provides a way to add services to the server The services are added using the AddService method The services are started and stopped in the order they are added\n\n\u003ca name=\"CBGracefulStopper\"\u003e\u003c/a\u003e\n## type [CBGracefulStopper](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L29-L33\u003e)\n\nCBGracefulStopper is the interface that wraps the graceful stop method.\n\n```go\ntype CBGracefulStopper interface {\n    // FailCheck set if the service is ready to stop.\n    // FailCheck is called by the core package.\n    FailCheck(bool)\n}\n```\n\n\u003ca name=\"CBPostStarter\"\u003e\u003c/a\u003e\n## type [CBPostStarter](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L63-L65\u003e)\n\nCBPostStarter is implemented by services that need to act after servers are listening. Use this for registering with service discovery, logging startup banners, or notifying external systems.\n\n```go\ntype CBPostStarter interface {\n    PostStart(ctx context.Context)\n}\n```\n\n\u003ca name=\"CBPostStopper\"\u003e\u003c/a\u003e\n## type [CBPostStopper](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L78-L80\u003e)\n\nCBPostStopper is implemented by services that need final cleanup after all servers and workers have stopped. Use this for closing audit logs, pushing final metrics, or any cleanup that must happen after all in\\-flight work is complete.\n\n```go\ntype CBPostStopper interface {\n    PostStop(ctx context.Context)\n}\n```\n\n\u003ca name=\"CBPreStarter\"\u003e\u003c/a\u003e\n## type [CBPreStarter](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L56-L58\u003e)\n\nCBPreStarter is implemented by services that need setup before servers start. Called during Run\\(\\), before initGRPC/initHTTP. If PreStart returns an error, startup is aborted. Use this for connecting to databases, message brokers, configuring interceptors, or any setup that must complete before the service accepts traffic.\n\n```go\ntype CBPreStarter interface {\n    PreStart(ctx context.Context) error\n}\n```\n\n\u003ca name=\"CBPreStopper\"\u003e\u003c/a\u003e\n## type [CBPreStopper](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L70-L72\u003e)\n\nCBPreStopper is implemented by services that need to act before graceful shutdown begins. Use this for deregistering from load balancers, flushing buffers, or notifying external systems of impending shutdown.\n\n```go\ntype CBPreStopper interface {\n    PreStop(ctx context.Context)\n}\n```\n\n\u003ca name=\"CBService\"\u003e\u003c/a\u003e\n## type [CBService](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L17-L26\u003e)\n\nCBService is the interface that wraps service methods used in ColdBrew. InitHTTP initializes the HTTP server. InitGRPC initializes the gRPC server. InitHTTP and InitGRPC are called by the core package.\n\n```go\ntype CBService interface {\n    // InitHTTP initializes the HTTP server\n    // mux is the HTTP server mux to register the service.\n    // endpoint is the gRPC endpoint to connect.\n    // opts is the gRPC dial options used to connect to the endpoint.\n    InitHTTP(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error\n    // InitGRPC initializes the gRPC server\n    // server is the gRPC server to register the service.\n    InitGRPC(ctx context.Context, server *grpc.Server) error\n}\n```\n\n\u003ca name=\"CBStopper\"\u003e\u003c/a\u003e\n## type [CBStopper](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L36-L40\u003e)\n\nCBStopper is the interface that wraps the stop method.\n\n```go\ntype CBStopper interface {\n    // Stop stops the service.\n    // Stop is called by the core package.\n    Stop()\n}\n```\n\n\u003ca name=\"CBWorkerProvider\"\u003e\u003c/a\u003e\n## type [CBWorkerProvider](\u003chttps://github.com/go-coldbrew/core/blob/main/types.go#L47-L49\u003e)\n\nCBWorkerProvider is implemented by services that run background workers. Workers are started after initGRPC/initHTTP and stopped during graceful shutdown. Called once during Run\\(\\). Workers are managed by the go\\-coldbrew/workers package with automatic panic recovery, configurable restart, and structured shutdown via suture supervisor trees.\n\n```go\ntype CBWorkerProvider interface {\n    Workers() []*workers.Worker\n}\n```\n\n\u003ca name=\"OTLPConfig\"\u003e\u003c/a\u003e\n## type [OTLPConfig](\u003chttps://github.com/go-coldbrew/core/blob/main/initializers.go#L120-L148\u003e)\n\nOTLPConfig holds configuration for OpenTelemetry OTLP exporter\n\nThis struct provides a flexible way to configure OpenTelemetry tracing with any OTLP\\-compatible backend \\(e.g., Jaeger, Honeycomb, New Relic, etc.\\)\n\n```go\ntype OTLPConfig struct {\n    // Endpoint is the OTLP gRPC endpoint to send traces to\n    // Examples: \"localhost:4317\", \"otlp.nr-data.net:4317\", \"api.honeycomb.io:443\"\n    Endpoint string\n\n    // Headers are custom headers to send with each request\n    // Examples:\n    //   New Relic: {\"api-key\": \"your-license-key\"}\n    //   Honeycomb: {\"x-honeycomb-team\": \"your-api-key\"}\n    Headers map[string]string\n\n    // ServiceName is the name of the service sending traces\n    ServiceName string\n\n    // ServiceVersion is the version of the service\n    ServiceVersion string\n\n    // SamplingRatio is the ratio of traces to sample (0.0 to 1.0)\n    // 1.0 means sample all traces, 0.1 means sample 10% of traces\n    SamplingRatio float64\n\n    // Compression specifies the compression type (e.g., \"gzip\", \"none\")\n    // If empty, defaults to \"gzip\"\n    Compression string\n\n    // Insecure disables TLS verification for the connection\n    // Only use this for local development or testing\n    Insecure bool\n}\n```\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-coldbrew%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-coldbrew%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-coldbrew%2Fcore/lists"}