Add tracing to settings service.
This adds tracing to the settings service. It uses the otelchi package and passes the tracing provider to the grpc and http servers.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/settings/pkg/metrics"
|
||||
svc "github.com/owncloud/ocis/v2/services/settings/pkg/service/v0"
|
||||
"github.com/urfave/cli/v2"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// Option defines a single option function.
|
||||
@@ -22,6 +23,7 @@ type Options struct {
|
||||
Metrics *metrics.Metrics
|
||||
ServiceHandler svc.Service
|
||||
Flags []cli.Flag
|
||||
TraceProvider trace.TracerProvider
|
||||
}
|
||||
|
||||
// newOptions initializes the available default options.
|
||||
@@ -83,3 +85,10 @@ func ServiceHandler(val svc.Service) Option {
|
||||
o.ServiceHandler = val
|
||||
}
|
||||
}
|
||||
|
||||
// TraceProvider provides a function to set the TraceProvider option
|
||||
func TraceProvider(val trace.TracerProvider) Option {
|
||||
return func(o *Options) {
|
||||
o.TraceProvider = val
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user