mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 03:09:33 -06:00
24 lines
540 B
Go
24 lines
540 B
Go
package tracing
|
|
|
|
import (
|
|
pkgtrace "github.com/owncloud/ocis/ocis-pkg/tracing"
|
|
"github.com/owncloud/ocis/web/pkg/config"
|
|
"go.opentelemetry.io/otel/trace"
|
|
)
|
|
|
|
var (
|
|
// TraceProvider is the global trace provider for the web 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, "web", cfg.Tracing.Type); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|