not init a tracing processor when not loaded

Signed-off-by: Joseph Sheng <jiajun.sheng@microfocus.com>
This commit is contained in:
Joseph Sheng 2022-10-17 17:45:31 +08:00
parent 8ee685662d
commit fc86be5011

View File

@ -160,7 +160,11 @@ func newTracer(ic *plugin.InitContext) (io.Closer, error) {
for id, pctx := range ls {
p, err := pctx.Instance()
if err != nil {
if plugin.IsSkipPlugin(err) {
log.G(ctx).WithError(err).Infof("skipping tracing processor initialization (no tracing plugin)")
} else {
log.G(ctx).WithError(err).Errorf("failed to initialize a tracing processor %q", id)
}
continue
}
proc := p.(sdktrace.SpanProcessor)