Files
opencloud/extensions/thumbnails/pkg/tracing/tracing.go
Christian Richter a919195f34 refactor thumbnails
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-04-13 17:04:38 +02:00

24 lines
576 B
Go

package tracing
import (
"github.com/owncloud/ocis/extensions/thumbnails/pkg/config"
pkgtrace "github.com/owncloud/ocis/ocis-pkg/tracing"
"go.opentelemetry.io/otel/trace"
)
var (
// TraceProvider is the global trace provider for the thumbnails service.
TraceProvider = trace.NewNoopTracerProvider()
)
func Configure(cfg *config.Config) error {
var err error
if cfg.Tracing.Enabled {
if TraceProvider, err = pkgtrace.GetTraceProvider(cfg.Tracing.Endpoint, cfg.Tracing.Collector, cfg.Service.Name, cfg.Tracing.Type); err != nil {
return err
}
}
return nil
}