{"id":21951876,"url":"https://github.com/go-coldbrew/interceptors","last_synced_at":"2026-04-11T10:11:01.894Z","repository":{"id":45221271,"uuid":"328137529","full_name":"go-coldbrew/interceptors","owner":"go-coldbrew","description":"Chained gRPC interceptors for logging, tracing, Prometheus metrics, circuit breaking, and retries","archived":false,"fork":false,"pushed_at":"2026-03-28T09:11:56.000Z","size":357,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T13:43:17.332Z","etag":null,"topics":["coldbrew","go","golang","grpc","interceptor","interceptors","microservice","middleware","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":"2021-01-09T11:17:46.000Z","updated_at":"2026-03-28T09:08:18.000Z","dependencies_parsed_at":"2025-03-22T18:11:36.688Z","dependency_job_id":"99b289e8-12f7-4fa8-930c-7cff1865632d","html_url":"https://github.com/go-coldbrew/interceptors","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/go-coldbrew/interceptors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Finterceptors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Finterceptors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Finterceptors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Finterceptors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-coldbrew","download_url":"https://codeload.github.com/go-coldbrew/interceptors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-coldbrew%2Finterceptors/sbom","scorecard":{"id":431550,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-coldbrew/interceptors","commit":"a64aa1650122bc27154d73d261d31f95c022d7bc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"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":"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":"Code-Review","score":1,"reason":"Found 4/22 approved changesets -- score normalized to 1","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":"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/interceptors/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/interceptors/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":"Maintained","score":0,"reason":"1 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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 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"}}]},"last_synced_at":"2025-08-19T03:28:05.676Z","repository_id":45221271,"created_at":"2025-08-19T03:28:05.676Z","updated_at":"2025-08-19T03:28:05.676Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","go","golang","grpc","interceptor","interceptors","microservice","middleware","observability","opentelemetry","prometheus"],"created_at":"2024-11-29T06:18:01.587Z","updated_at":"2026-04-11T10:11:01.887Z","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[![CI](https://github.com/go-coldbrew/interceptors/actions/workflows/go.yml/badge.svg)](https://github.com/go-coldbrew/interceptors/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-coldbrew/interceptors)](https://goreportcard.com/report/github.com/go-coldbrew/interceptors)\n[![GoDoc](https://pkg.go.dev/badge/github.com/go-coldbrew/interceptors.svg)](https://pkg.go.dev/github.com/go-coldbrew/interceptors)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n\n# interceptors\n\n```go\nimport \"github.com/go-coldbrew/interceptors\"\n```\n\nPackage interceptors provides gRPC server and client interceptors for the ColdBrew framework.\n\nInterceptor configuration functions \\(AddUnaryServerInterceptor, SetFilterFunc, etc.\\) must be called during program initialization, before the gRPC server starts. They are not safe for concurrent use.\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n- [Variables](\u003c#variables\u003e)\n- [func AddStreamClientInterceptor\\(ctx context.Context, i ...grpc.StreamClientInterceptor\\)](\u003c#AddStreamClientInterceptor\u003e)\n- [func AddStreamServerInterceptor\\(ctx context.Context, i ...grpc.StreamServerInterceptor\\)](\u003c#AddStreamServerInterceptor\u003e)\n- [func AddUnaryClientInterceptor\\(ctx context.Context, i ...grpc.UnaryClientInterceptor\\)](\u003c#AddUnaryClientInterceptor\u003e)\n- [func AddUnaryServerInterceptor\\(ctx context.Context, i ...grpc.UnaryServerInterceptor\\)](\u003c#AddUnaryServerInterceptor\u003e)\n- [func DebugLogInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#DebugLogInterceptor\u003e)\n- [func DebugLoggingInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#DebugLoggingInterceptor\u003e)\n- [func DefaultClientInterceptor\\(defaultOpts ...any\\) grpc.UnaryClientInterceptor](\u003c#DefaultClientInterceptor\u003e)\n- [func DefaultClientInterceptors\\(defaultOpts ...any\\) \\[\\]grpc.UnaryClientInterceptor](\u003c#DefaultClientInterceptors\u003e)\n- [func DefaultClientStreamInterceptor\\(defaultOpts ...any\\) grpc.StreamClientInterceptor](\u003c#DefaultClientStreamInterceptor\u003e)\n- [func DefaultClientStreamInterceptors\\(defaultOpts ...any\\) \\[\\]grpc.StreamClientInterceptor](\u003c#DefaultClientStreamInterceptors\u003e)\n- [func DefaultInterceptors\\(\\) \\[\\]grpc.UnaryServerInterceptor](\u003c#DefaultInterceptors\u003e)\n- [func DefaultStreamInterceptors\\(\\) \\[\\]grpc.StreamServerInterceptor](\u003c#DefaultStreamInterceptors\u003e)\n- [func DefaultTimeoutInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#DefaultTimeoutInterceptor\u003e)\n- [func DoHTTPtoGRPC\\(ctx context.Context, svr any, handler func\\(ctx context.Context, req any\\) \\(any, error\\), in any\\) \\(any, error\\)](\u003c#DoHTTPtoGRPC\u003e)\n- [func FilterMethodsFunc\\(ctx context.Context, fullMethodName string\\) bool](\u003c#FilterMethodsFunc\u003e)\n- [func GRPCClientInterceptor\\(\\_ ...any\\) grpc.UnaryClientInterceptor](\u003c#GRPCClientInterceptor\u003e)\n- [func GetDebugLogHeaderName\\(\\) string](\u003c#GetDebugLogHeaderName\u003e)\n- [func HystrixClientInterceptor\\(defaultOpts ...grpc.CallOption\\) grpc.UnaryClientInterceptor](\u003c#HystrixClientInterceptor\u003e)\n- [func NRHttpTracer\\(pattern string, h http.HandlerFunc\\) \\(string, http.HandlerFunc\\)](\u003c#NRHttpTracer\u003e)\n- [func NewRelicClientInterceptor\\(\\) grpc.UnaryClientInterceptor](\u003c#NewRelicClientInterceptor\u003e)\n- [func NewRelicInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#NewRelicInterceptor\u003e)\n- [func OptionsInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#OptionsInterceptor\u003e)\n- [func PanicRecoveryInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#PanicRecoveryInterceptor\u003e)\n- [func PanicRecoveryStreamInterceptor\\(\\) grpc.StreamServerInterceptor](\u003c#PanicRecoveryStreamInterceptor\u003e)\n- [func ProtoValidateInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#ProtoValidateInterceptor\u003e)\n- [func ProtoValidateStreamInterceptor\\(\\) grpc.StreamServerInterceptor](\u003c#ProtoValidateStreamInterceptor\u003e)\n- [func ResponseTimeLoggingInterceptor\\(ff FilterFunc\\) grpc.UnaryServerInterceptor](\u003c#ResponseTimeLoggingInterceptor\u003e)\n- [func ResponseTimeLoggingStreamInterceptor\\(\\) grpc.StreamServerInterceptor](\u003c#ResponseTimeLoggingStreamInterceptor\u003e)\n- [func ServerErrorInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#ServerErrorInterceptor\u003e)\n- [func ServerErrorStreamInterceptor\\(\\) grpc.StreamServerInterceptor](\u003c#ServerErrorStreamInterceptor\u003e)\n- [func SetClientMetricsOptions\\(opts ...grpcprom.ClientMetricsOption\\)](\u003c#SetClientMetricsOptions\u003e)\n- [func SetDebugLogHeaderName\\(name string\\)](\u003c#SetDebugLogHeaderName\u003e)\n- [func SetDefaultRateLimit\\(rps float64, burst int\\)](\u003c#SetDefaultRateLimit\u003e)\n- [func SetDefaultTimeout\\(d time.Duration\\)](\u003c#SetDefaultTimeout\u003e)\n- [func SetDisableDebugLogInterceptor\\(disable bool\\)](\u003c#SetDisableDebugLogInterceptor\u003e)\n- [func SetDisableProtoValidate\\(disable bool\\)](\u003c#SetDisableProtoValidate\u003e)\n- [func SetDisableRateLimit\\(disable bool\\)](\u003c#SetDisableRateLimit\u003e)\n- [func SetFilterFunc\\(ctx context.Context, ff FilterFunc\\)](\u003c#SetFilterFunc\u003e)\n- [func SetFilterMethods\\(ctx context.Context, methods \\[\\]string\\)](\u003c#SetFilterMethods\u003e)\n- [func SetProtoValidateOptions\\(opts ...protovalidate.ValidatorOption\\)](\u003c#SetProtoValidateOptions\u003e)\n- [func SetRateLimiter\\(limiter ratelimit\\_middleware.Limiter\\)](\u003c#SetRateLimiter\u003e)\n- [func SetResponseTimeLogErrorOnly\\(errorOnly bool\\)](\u003c#SetResponseTimeLogErrorOnly\u003e)\n- [func SetResponseTimeLogLevel\\(ctx context.Context, level loggers.Level\\)](\u003c#SetResponseTimeLogLevel\u003e)\n- [func SetServerMetricsOptions\\(opts ...grpcprom.ServerMetricsOption\\)](\u003c#SetServerMetricsOptions\u003e)\n- [func TraceIdInterceptor\\(\\) grpc.UnaryServerInterceptor](\u003c#TraceIdInterceptor\u003e)\n- [func UseColdBrewClientInterceptors\\(ctx context.Context, flag bool\\)](\u003c#UseColdBrewClientInterceptors\u003e)\n- [func UseColdBrewServerInterceptors\\(ctx context.Context, flag bool\\)](\u003c#UseColdBrewServerInterceptors\u003e)\n- [type FilterFunc](\u003c#FilterFunc\u003e)\n\n\n## Constants\n\n\u003ca name=\"SupportPackageIsVersion1\"\u003e\u003c/a\u003eSupportPackageIsVersion1 is a compile\\-time assertion constant. Downstream packages \\(e.g. core\\) reference this constant to enforce version compatibility. When interceptors makes a breaking change, export a new constant and remove this one to force coordinated updates.\n\n```go\nconst SupportPackageIsVersion1 = true\n```\n\n## Variables\n\n\u003ca name=\"FilterMethods\"\u003e\u003c/a\u003e\n\n```go\nvar (\n    // Deprecated: FilterMethods is the list of methods that are filtered by default.\n    // Use SetFilterMethods instead. Only some direct mutations (replacing the slice\n    // or changing the first element) are detected by internal change detection;\n    // other in-place changes may not invalidate caches correctly.\n    FilterMethods = []string{\"healthcheck\", \"readycheck\", \"serverreflectioninfo\"}\n)\n```\n\n\u003ca name=\"AddStreamClientInterceptor\"\u003e\u003c/a\u003e\n## func [AddStreamClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L122\u003e)\n\n```go\nfunc AddStreamClientInterceptor(ctx context.Context, i ...grpc.StreamClientInterceptor)\n```\n\nAddStreamClientInterceptor adds a client stream interceptor to default client stream interceptors. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.\n\n\u003ca name=\"AddStreamServerInterceptor\"\u003e\u003c/a\u003e\n## func [AddStreamServerInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L103\u003e)\n\n```go\nfunc AddStreamServerInterceptor(ctx context.Context, i ...grpc.StreamServerInterceptor)\n```\n\nAddStreamServerInterceptor adds a server interceptor to default server interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"AddUnaryClientInterceptor\"\u003e\u003c/a\u003e\n## func [AddUnaryClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L116\u003e)\n\n```go\nfunc AddUnaryClientInterceptor(ctx context.Context, i ...grpc.UnaryClientInterceptor)\n```\n\nAddUnaryClientInterceptor adds a client interceptor to default client interceptors. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.\n\n\u003ca name=\"AddUnaryServerInterceptor\"\u003e\u003c/a\u003e\n## func [AddUnaryServerInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L97\u003e)\n\n```go\nfunc AddUnaryServerInterceptor(ctx context.Context, i ...grpc.UnaryServerInterceptor)\n```\n\nAddUnaryServerInterceptor adds a server interceptor to default server interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"DebugLogInterceptor\"\u003e\u003c/a\u003e\n## func [DebugLogInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L320\u003e)\n\n```go\nfunc DebugLogInterceptor() grpc.UnaryServerInterceptor\n```\n\nDebugLogInterceptor enables per\\-request log level override based on a proto field or gRPC metadata header. It checks \\(in order\\):\n\n1. Proto field: GetDebug\\(\\) bool or GetEnableDebug\\(\\) bool — always sets DebugLevel\n2. Metadata header: configurable via SetDebugLogHeaderName \\(default \"x\\-debug\\-log\\-level\"\\) — the header value is parsed as a log level, allowing any valid level \\(debug, info, warn, error\\)\n\nCombined with ColdBrew's trace ID propagation, this allows enabling debug logging for a single request and following it across services via trace ID.\n\n\u003ca name=\"DebugLoggingInterceptor\"\u003e\u003c/a\u003e\n## func [DebugLoggingInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L346\u003e)\n\n```go\nfunc DebugLoggingInterceptor() grpc.UnaryServerInterceptor\n```\n\nDebugLoggingInterceptor is the interceptor that logs all request/response from a handler\n\n\u003ca name=\"DefaultClientInterceptor\"\u003e\u003c/a\u003e\n## func [DefaultClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L62\u003e)\n\n```go\nfunc DefaultClientInterceptor(defaultOpts ...any) grpc.UnaryClientInterceptor\n```\n\nDefaultClientInterceptor are the set of default interceptors that should be applied to all client calls\n\n\u003ca name=\"DefaultClientInterceptors\"\u003e\u003c/a\u003e\n## func [DefaultClientInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L21\u003e)\n\n```go\nfunc DefaultClientInterceptors(defaultOpts ...any) []grpc.UnaryClientInterceptor\n```\n\nDefaultClientInterceptors are the set of default interceptors that should be applied to all client calls\n\n\u003ca name=\"DefaultClientStreamInterceptor\"\u003e\u003c/a\u003e\n## func [DefaultClientStreamInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L67\u003e)\n\n```go\nfunc DefaultClientStreamInterceptor(defaultOpts ...any) grpc.StreamClientInterceptor\n```\n\nDefaultClientStreamInterceptor are the set of default interceptors that should be applied to all stream client calls\n\n\u003ca name=\"DefaultClientStreamInterceptors\"\u003e\u003c/a\u003e\n## func [DefaultClientStreamInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L47\u003e)\n\n```go\nfunc DefaultClientStreamInterceptors(defaultOpts ...any) []grpc.StreamClientInterceptor\n```\n\nDefaultClientStreamInterceptors are the set of default interceptors that should be applied to all stream client calls\n\n\u003ca name=\"DefaultInterceptors\"\u003e\u003c/a\u003e\n## func [DefaultInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L64\u003e)\n\n```go\nfunc DefaultInterceptors() []grpc.UnaryServerInterceptor\n```\n\nDefaultInterceptors are the set of default interceptors that are applied to all coldbrew methods\n\n\u003ca name=\"DefaultStreamInterceptors\"\u003e\u003c/a\u003e\n## func [DefaultStreamInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L97\u003e)\n\n```go\nfunc DefaultStreamInterceptors() []grpc.StreamServerInterceptor\n```\n\nDefaultStreamInterceptors are the set of default interceptors that should be applied to all coldbrew streams\n\n\u003ca name=\"DefaultTimeoutInterceptor\"\u003e\u003c/a\u003e\n## func [DefaultTimeoutInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L127\u003e)\n\n```go\nfunc DefaultTimeoutInterceptor() grpc.UnaryServerInterceptor\n```\n\nDefaultTimeoutInterceptor returns a unary server interceptor that applies a default deadline to incoming requests that have no deadline set. If the incoming context already has a deadline \\(regardless of duration\\), it is left unchanged. When defaultTimeout is \\\u003c= 0, the interceptor is a no\\-op pass\\-through.\n\n\u003ca name=\"DoHTTPtoGRPC\"\u003e\u003c/a\u003e\n## func [DoHTTPtoGRPC](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/http.go#L47\u003e)\n\n```go\nfunc DoHTTPtoGRPC(ctx context.Context, svr any, handler func(ctx context.Context, req any) (any, error), in any) (any, error)\n```\n\nDoHTTPtoGRPC allows calling the interceptors when you use the Register\\\u003csvc\\-name\\\u003eHandlerServer in grpc\\-gateway. This enables in\\-process HTTP\\-to\\-gRPC calls with the full interceptor chain \\(logging, tracing, metrics, panic recovery\\) without a network hop — the fastest option for gateway performance. The interceptor chain is cached on first invocation. All interceptor configuration \\(AddUnaryServerInterceptor, SetFilterFunc, etc.\\) must be finalized before the first call. See example below for reference.\n\n```\nfunc (s *svc) Echo(ctx context.Context, req *proto.EchoRequest) (*proto.EchoResponse, error) {\n    handler := func(ctx context.Context, req interface{}) (interface{}, error) {\n        return s.echo(ctx, req.(*proto.EchoRequest))\n    }\n    r, err := DoHTTPtoGRPC(ctx, s, handler, req)\n    if err != nil {\n        return nil, err\n    }\n    return r.(*proto.EchoResponse), nil\n}\n\nfunc (s *svc) echo(ctx context.Context, req *proto.EchoRequest) (*proto.EchoResponse, error) {\n       .... implementation ....\n}\n```\n\n\u003ca name=\"FilterMethodsFunc\"\u003e\u003c/a\u003e\n## func [FilterMethodsFunc](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/filter.go#L89\u003e)\n\n```go\nfunc FilterMethodsFunc(ctx context.Context, fullMethodName string) bool\n```\n\nFilterMethodsFunc is the default implementation of Filter function\n\n\u003ca name=\"GRPCClientInterceptor\"\u003e\u003c/a\u003e\n## func [GRPCClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L94\u003e)\n\n```go\nfunc GRPCClientInterceptor(_ ...any) grpc.UnaryClientInterceptor\n```\n\nDeprecated: GRPCClientInterceptor is no longer needed. gRPC tracing is now handled by google.golang.org/grpc/stats/opentelemetry, configured via opentelemetry.DialOption\\(\\) at the client level. This function is retained for backwards compatibility but returns a no\\-op interceptor.\n\n\u003ca name=\"GetDebugLogHeaderName\"\u003e\u003c/a\u003e\n## func [GetDebugLogHeaderName](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L177\u003e)\n\n```go\nfunc GetDebugLogHeaderName() string\n```\n\nGetDebugLogHeaderName returns the current debug log header name.\n\n\u003ca name=\"HystrixClientInterceptor\"\u003e\u003c/a\u003e\n## func [HystrixClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L108\u003e)\n\n```go\nfunc HystrixClientInterceptor(defaultOpts ...grpc.CallOption) grpc.UnaryClientInterceptor\n```\n\nHystrixClientInterceptor returns a unary client interceptor that executes the RPC inside a Hystrix command.\n\nNote: This interceptor wraps github.com/afex/hystrix\\-go which has been unmaintained since 2018. Consider migrating to github.com/failsafe\\-go/failsafe\\-go for circuit breaker functionality.\n\nThe interceptor applies provided default and per\\-call client options to configure Hystrix behavior \\(for example the command name, disabled flag, excluded errors, and excluded gRPC status codes\\). If Hystrix is disabled via options, the RPC is invoked directly. If the underlying RPC returns an error that matches any configured excluded error or whose gRPC status code matches any configured excluded code, Hystrix fallback is skipped and the RPC error is returned. Panics raised during the RPC invocation are captured and reported to the notifier before being converted into an error. If the RPC itself returns an error, that error is returned; otherwise any error produced by Hystrix is returned.\n\n\u003ca name=\"NRHttpTracer\"\u003e\u003c/a\u003e\n## func [NRHttpTracer](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/http.go#L61\u003e)\n\n```go\nfunc NRHttpTracer(pattern string, h http.HandlerFunc) (string, http.HandlerFunc)\n```\n\nNRHttpTracer adds newrelic tracing to this http function\n\n\u003ca name=\"NewRelicClientInterceptor\"\u003e\u003c/a\u003e\n## func [NewRelicClientInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/client.go#L74\u003e)\n\n```go\nfunc NewRelicClientInterceptor() grpc.UnaryClientInterceptor\n```\n\nNewRelicClientInterceptor intercepts all client actions and reports them to newrelic. When NewRelic app is nil \\(no license key configured\\), returns a pass\\-through interceptor to avoid overhead.\n\n\u003ca name=\"NewRelicInterceptor\"\u003e\u003c/a\u003e\n## func [NewRelicInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L193\u003e)\n\n```go\nfunc NewRelicInterceptor() grpc.UnaryServerInterceptor\n```\n\nNewRelicInterceptor intercepts all server actions and reports them to newrelic. When NewRelic app is nil \\(no license key configured\\), returns a pass\\-through interceptor to avoid overhead.\n\n\u003ca name=\"OptionsInterceptor\"\u003e\u003c/a\u003e\n## func [OptionsInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L183\u003e)\n\n```go\nfunc OptionsInterceptor() grpc.UnaryServerInterceptor\n```\n\n\n\n\u003ca name=\"PanicRecoveryInterceptor\"\u003e\u003c/a\u003e\n## func [PanicRecoveryInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L253\u003e)\n\n```go\nfunc PanicRecoveryInterceptor() grpc.UnaryServerInterceptor\n```\n\n\n\n\u003ca name=\"PanicRecoveryStreamInterceptor\"\u003e\u003c/a\u003e\n## func [PanicRecoveryStreamInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L277\u003e)\n\n```go\nfunc PanicRecoveryStreamInterceptor() grpc.StreamServerInterceptor\n```\n\nPanicRecoveryStreamInterceptor recovers from panics in stream handlers, logs the panic and stack trace, and reports it to the error notifier.\n\n\u003ca name=\"ProtoValidateInterceptor\"\u003e\u003c/a\u003e\n## func [ProtoValidateInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L53\u003e)\n\n```go\nfunc ProtoValidateInterceptor() grpc.UnaryServerInterceptor\n```\n\nProtoValidateInterceptor returns a unary server interceptor that validates incoming messages using protovalidate annotations. Returns InvalidArgument on validation failure. Uses GlobalValidator by default; if custom options are set via SetProtoValidateOptions, creates a new validator with those options.\n\n\u003ca name=\"ProtoValidateStreamInterceptor\"\u003e\u003c/a\u003e\n## func [ProtoValidateStreamInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L59\u003e)\n\n```go\nfunc ProtoValidateStreamInterceptor() grpc.StreamServerInterceptor\n```\n\nProtoValidateStreamInterceptor returns a stream server interceptor that validates incoming messages using protovalidate annotations.\n\n\u003ca name=\"ResponseTimeLoggingInterceptor\"\u003e\u003c/a\u003e\n## func [ResponseTimeLoggingInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L142\u003e)\n\n```go\nfunc ResponseTimeLoggingInterceptor(ff FilterFunc) grpc.UnaryServerInterceptor\n```\n\nResponseTimeLoggingInterceptor logs response time for each request on server\n\n\u003ca name=\"ResponseTimeLoggingStreamInterceptor\"\u003e\u003c/a\u003e\n## func [ResponseTimeLoggingStreamInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L165\u003e)\n\n```go\nfunc ResponseTimeLoggingStreamInterceptor() grpc.StreamServerInterceptor\n```\n\nResponseTimeLoggingStreamInterceptor logs response time for stream RPCs.\n\n\u003ca name=\"ServerErrorInterceptor\"\u003e\u003c/a\u003e\n## func [ServerErrorInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L211\u003e)\n\n```go\nfunc ServerErrorInterceptor() grpc.UnaryServerInterceptor\n```\n\nServerErrorInterceptor intercepts all server actions and reports them to error notifier\n\n\u003ca name=\"ServerErrorStreamInterceptor\"\u003e\u003c/a\u003e\n## func [ServerErrorStreamInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L237\u003e)\n\n```go\nfunc ServerErrorStreamInterceptor() grpc.StreamServerInterceptor\n```\n\nServerErrorStreamInterceptor intercepts server errors for stream RPCs and reports them to the error notifier.\n\n\u003ca name=\"SetClientMetricsOptions\"\u003e\u003c/a\u003e\n## func [SetClientMetricsOptions](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L141\u003e)\n\n```go\nfunc SetClientMetricsOptions(opts ...grpcprom.ClientMetricsOption)\n```\n\nSetClientMetricsOptions appends gRPC client metrics options. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.\n\n\u003ca name=\"SetDebugLogHeaderName\"\u003e\u003c/a\u003e\n## func [SetDebugLogHeaderName](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L168\u003e)\n\n```go\nfunc SetDebugLogHeaderName(name string)\n```\n\nSetDebugLogHeaderName sets the gRPC metadata header name that triggers per\\-request log level override. Default is \"x\\-debug\\-log\\-level\". The header value should be a valid log level \\(e.g., \"debug\"\\). Empty names are ignored. Must be called during initialization.\n\n\u003ca name=\"SetDefaultRateLimit\"\u003e\u003c/a\u003e\n## func [SetDefaultRateLimit](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L199\u003e)\n\n```go\nfunc SetDefaultRateLimit(rps float64, burst int)\n```\n\nSetDefaultRateLimit configures the built\\-in token bucket rate limiter. rps is requests per second, burst is the maximum burst size. This is a per\\-pod in\\-memory limit — with N pods, the effective cluster\\-wide limit is N × rps. For distributed rate limiting, use SetRateLimiter\\(\\) with a custom implementation \\(e.g., Redis\\-backed\\). Must be called during initialization.\n\n\u003ca name=\"SetDefaultTimeout\"\u003e\u003c/a\u003e\n## func [SetDefaultTimeout](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L83\u003e)\n\n```go\nfunc SetDefaultTimeout(d time.Duration)\n```\n\nSetDefaultTimeout sets the default timeout applied to incoming unary RPCs that arrive without a deadline. When set to \\\u003c= 0, the timeout interceptor is disabled \\(pass\\-through\\). Default is 60s. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"SetDisableDebugLogInterceptor\"\u003e\u003c/a\u003e\n## func [SetDisableDebugLogInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L160\u003e)\n\n```go\nfunc SetDisableDebugLogInterceptor(disable bool)\n```\n\nSetDisableDebugLogInterceptor disables the DebugLogInterceptor in the default interceptor chain. Must be called during initialization, before the server starts.\n\n\u003ca name=\"SetDisableProtoValidate\"\u003e\u003c/a\u003e\n## func [SetDisableProtoValidate](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L154\u003e)\n\n```go\nfunc SetDisableProtoValidate(disable bool)\n```\n\nSetDisableProtoValidate disables the protovalidate interceptor in the default chain. Must be called during init\\(\\) — not safe for concurrent use.\n\n\u003ca name=\"SetDisableRateLimit\"\u003e\u003c/a\u003e\n## func [SetDisableRateLimit](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L183\u003e)\n\n```go\nfunc SetDisableRateLimit(disable bool)\n```\n\nSetDisableRateLimit disables the rate limiting interceptor in the default interceptor chain. Must be called during initialization.\n\n\u003ca name=\"SetFilterFunc\"\u003e\u003c/a\u003e\n## func [SetFilterFunc](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L89\u003e)\n\n```go\nfunc SetFilterFunc(ctx context.Context, ff FilterFunc)\n```\n\nSetFilterFunc sets the default filter function to be used by interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"SetFilterMethods\"\u003e\u003c/a\u003e\n## func [SetFilterMethods](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/filter.go#L69\u003e)\n\n```go\nfunc SetFilterMethods(ctx context.Context, methods []string)\n```\n\nSetFilterMethods sets the list of method substrings to exclude from tracing/logging. It rebuilds the internal cache. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"SetProtoValidateOptions\"\u003e\u003c/a\u003e\n## func [SetProtoValidateOptions](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L148\u003e)\n\n```go\nfunc SetProtoValidateOptions(opts ...protovalidate.ValidatorOption)\n```\n\nSetProtoValidateOptions configures custom protovalidate options \\(e.g., custom constraints\\). Must be called during init\\(\\) — not safe for concurrent use. Follows ColdBrew's init\\-only config pattern.\n\n\u003ca name=\"SetRateLimiter\"\u003e\u003c/a\u003e\n## func [SetRateLimiter](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L189\u003e)\n\n```go\nfunc SetRateLimiter(limiter ratelimit_middleware.Limiter)\n```\n\nSetRateLimiter sets a custom rate limiter implementation. This overrides the built\\-in token bucket limiter. Must be called during initialization.\n\n\u003ca name=\"SetResponseTimeLogErrorOnly\"\u003e\u003c/a\u003e\n## func [SetResponseTimeLogErrorOnly](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L75\u003e)\n\n```go\nfunc SetResponseTimeLogErrorOnly(errorOnly bool)\n```\n\nSetResponseTimeLogErrorOnly when set to true, only logs response time when the request returns an error. Successful requests are not logged. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"SetResponseTimeLogLevel\"\u003e\u003c/a\u003e\n## func [SetResponseTimeLogLevel](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L68\u003e)\n\n```go\nfunc SetResponseTimeLogLevel(ctx context.Context, level loggers.Level)\n```\n\nSetResponseTimeLogLevel sets the log level for response time logging. Default is InfoLevel. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"SetServerMetricsOptions\"\u003e\u003c/a\u003e\n## func [SetServerMetricsOptions](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L135\u003e)\n\n```go\nfunc SetServerMetricsOptions(opts ...grpcprom.ServerMetricsOption)\n```\n\nSetServerMetricsOptions appends gRPC server metrics options \\(histogram, labels, namespace, etc.\\). Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"TraceIdInterceptor\"\u003e\u003c/a\u003e\n## func [TraceIdInterceptor](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/server.go#L298\u003e)\n\n```go\nfunc TraceIdInterceptor() grpc.UnaryServerInterceptor\n```\n\nTraceIdInterceptor allows injecting trace id from request objects\n\n\u003ca name=\"UseColdBrewClientInterceptors\"\u003e\u003c/a\u003e\n## func [UseColdBrewClientInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L129\u003e)\n\n```go\nfunc UseColdBrewClientInterceptors(ctx context.Context, flag bool)\n```\n\nUseColdBrewClientInterceptors allows enabling/disabling coldbrew client interceptors. When set to false, the coldbrew client interceptors will not be used. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.\n\n\u003ca name=\"UseColdBrewServerInterceptors\"\u003e\u003c/a\u003e\n## func [UseColdBrewServerInterceptors](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/config.go#L110\u003e)\n\n```go\nfunc UseColdBrewServerInterceptors(ctx context.Context, flag bool)\n```\n\nUseColdBrewServerInterceptors allows enabling/disabling coldbrew server interceptors. When set to false, the coldbrew server interceptors will not be used. Must be called during initialization, before the server starts. Not safe for concurrent use.\n\n\u003ca name=\"FilterFunc\"\u003e\u003c/a\u003e\n## type [FilterFunc](\u003chttps://github.com/go-coldbrew/interceptors/blob/main/filter.go#L13\u003e)\n\nIf it returns false, the given request will not be traced.\n\n```go\ntype FilterFunc func(ctx context.Context, fullMethodName string) bool\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%2Finterceptors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-coldbrew%2Finterceptors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-coldbrew%2Finterceptors/lists"}