Add missing tracing initialization for graph service (#6988)

* Convert webdav to service trace provider

* graph: Add missing tracing initialization to graph service
This commit is contained in:
Daniel Swärd
2023-08-08 13:14:45 +02:00
committed by GitHub
parent 62ffe1e18f
commit fc3dce05f4
10 changed files with 64 additions and 63 deletions
+15 -6
View File
@@ -7,6 +7,7 @@ import (
"github.com/owncloud/ocis/v2/services/webdav/pkg/config"
"github.com/owncloud/ocis/v2/services/webdav/pkg/metrics"
"github.com/urfave/cli/v2"
"go.opentelemetry.io/otel/trace"
)
// Option defines a single option function.
@@ -14,12 +15,13 @@ type Option func(o *Options)
// Options defines the available options for this package.
type Options struct {
Namespace string
Logger log.Logger
Context context.Context
Config *config.Config
Metrics *metrics.Metrics
Flags []cli.Flag
Namespace string
Logger log.Logger
Context context.Context
Config *config.Config
Metrics *metrics.Metrics
Flags []cli.Flag
TraceProvider trace.TracerProvider
}
// newOptions initializes the available default options.
@@ -74,3 +76,10 @@ func Namespace(val string) Option {
o.Namespace = val
}
}
// TraceProvider provides a function to set the TraceProvider option.
func TraceProvider(val trace.TracerProvider) Option {
return func(o *Options) {
o.TraceProvider = val
}
}