Set up the metric extraction sink in server creation
This ties all the changes together: Now metrics from SSF spans flow
directly (via go channels) into the metric worker, without having to
traverse any network at all!
@@ -221,6 +221,14 @@ func NewFromConfig(conf Config) (*Server, error) {
ret.EventWorker = NewEventWorker(ret.Statsd)
+ // Set up a span sink that extracts metrics from SSF spans and
+ // reports them via the metric workers:
+ metricSink, err := NewMetricExtractionSink(ret.Workers, ret.indicatorSpanTimerName)
+ if err != nil {
+ return ret, err
+ }
+ ret.spanSinks = append(ret.spanSinks, metricSink)
+
for _, addrStr := range conf.StatsdListenAddresses {
addr, err := protocol.ResolveAddr(addrStr)
if err != nil {
