dubbo-go
dubbo-go copied to clipboard
[Triple] Add XXX filter automatically when XXX is enabled
Problem description
In the process of configuring and starting otel.tracing, set it according to the following configuration:
ins, err := dubbo.NewInstance(
dubbo.WithName("dubbo_sample_tracing"),
dubbo.WithProtocol(
protocol.WithTriple(),
protocol.WithPort(20000),
),
dubbo.WithRegistry(
registry.WithZookeeper(),
registry.WithAddress("127.0.0.1:2181"),
),
dubbo.WithTracing(
trace.WithEnabled(),
trace.WithStdoutExporter(),
trace.WithW3cPropagator(),
trace.WithRatioMode(),
trace.WithRatio(0.5),
),
)
But the otel tracing filter is not append to service.filter slice. So as the trace.WithEnabled() is correctly set by user, the otel.Tracing module is not working as expected.
Todo
During the startup process, if a module is enabled, the corresponding filter will be automatically added, allowing users to configure module enable logic easily.
https://github.com/apache/dubbo-go/pull/2502/files#diff-b8e2faeaf9d21ca32900a5616241d1e40d00e9701e0fae6c7c8181475aba2e8dR358
https://github.com/apache/dubbo-go/pull/2502/files#diff-4b2d153eca0e1d0add2be01cf328e62cd52a019e95c3901edf55bfcbfdf1ce53R361