Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Fixes occollector crash on exporter start failure #585 (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
asutoshpalai authored and songy23 committed Jun 27, 2019
1 parent b97678f commit 2fc6b54
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/occollector/app/collector/receivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ func createReceivers(v *viper.Viper, logger *zap.Logger, traceConsumers consumer
receivers := []struct {
runFn func(*zap.Logger, *viper.Viper, consumer.TraceConsumer, chan<- error) (receiver.TraceReceiver, error)
enabled bool
name string
}{
{jaegerreceiver.Start, builder.JaegerReceiverEnabled(v)},
{ocreceiver.Start, builder.OpenCensusReceiverEnabled(v)},
{zipkinreceiver.Start, builder.ZipkinReceiverEnabled(v)},
{zipkinscribereceiver.Start, builder.ZipkinScribeReceiverEnabled(v)},
{jaegerreceiver.Start, builder.JaegerReceiverEnabled(v), "Jaeger"},
{ocreceiver.Start, builder.OpenCensusReceiverEnabled(v), "OpenCensus"},
{zipkinreceiver.Start, builder.ZipkinReceiverEnabled(v), "Zipkin"},
{zipkinscribereceiver.Start, builder.ZipkinScribeReceiverEnabled(v), "Zipkin-Scribe"},
}

var startedTraceReceivers []receiver.TraceReceiver
Expand All @@ -51,7 +52,7 @@ func createReceivers(v *viper.Viper, logger *zap.Logger, traceConsumers consumer
for _, startedTraceReceiver := range startedTraceReceivers {
startedTraceReceiver.StopTraceReception(context.Background())
}
logger.Fatal("Cannot run receiver for "+rec.TraceSource(), zap.Error(err))
logger.Fatal("Cannot run receiver for "+receiver.name, zap.Error(err))
}
startedTraceReceivers = append(startedTraceReceivers, rec)
someReceiverEnabled = true
Expand Down

0 comments on commit 2fc6b54

Please sign in to comment.