Dubbo-go filters are interceptor-style extensions around RPC invocation. They are typically used to add cross-cutting behavior such as authentication, rate limiting, logging, tracing, metrics, generic invocation adaptation, and graceful shutdown handling.
The recommended approach is to import only the filters your application needs.
package demo
import _ "dubbo.apache.org/dubbo-go/v3/filter/echo"
import _ "dubbo.apache.org/dubbo-go/v3/filter/generic"
If you prefer the legacy all-in-one import, you can still use:
package demo
import _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
Dubbo-go distinguishes between two filter chains:
service.filter: provider-side filtersreference.filter: consumer-side filtersThe built-in defaults are defined in common/constant/default.go.
echo: echo health check supportgeneric: consumer-side generic invocation filtergeneric_service: provider-side generic service filtergraceful_shutdown: graceful shutdown behavior for provider and consumer pathsactive: active request countingexec_limit: provider-side execute concurrency limitingtps: TPS limitingadaptivesvc: adaptive service filterpolaris/limit: Polaris rate limitingsentinel: Sentinel integration for provider and consumer traffic protectiontoken: token-based request validationauth: request signing and authenticationseata: Seata distributed transaction propagationaccesslog: invocation access loggingmetrics: metrics collectiontracing: tracing integrationotel/trace: OpenTelemetry tracing integrationhystrix: moved to dubbo-go-extensionsIn practice, filters are usually enabled through application config instead of being called directly from business code. Typical examples:
service.filterreference.filterextension.SetFilter(...)common/constant/key.go.otel/trace and polaris/limit are still ordinary Dubbo-go filters; the subdirectory just reflects feature grouping.