Add tracing to more places in userlog.
This passes the treaceprovider to more places where it belongs and also adds tracing to the event processing.
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0"
|
||||
"github.com/owncloud/ocis/v2/services/userlog/pkg/config"
|
||||
"go-micro.dev/v4/store"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// Option for the userlog service
|
||||
@@ -27,6 +28,7 @@ type Options struct {
|
||||
ValueClient settingssvc.ValueService
|
||||
RoleClient settingssvc.RoleService
|
||||
RegisteredEvents []events.Unmarshaller
|
||||
TraceProvider trace.TracerProvider
|
||||
}
|
||||
|
||||
// Logger configures a logger for the userlog service
|
||||
@@ -98,3 +100,10 @@ func RoleClient(rs settingssvc.RoleService) Option {
|
||||
o.RoleClient = rs
|
||||
}
|
||||
}
|
||||
|
||||
// TraceProvider adds a tracer provider for the userlog service
|
||||
func TraceProvider(tp trace.TracerProvider) Option {
|
||||
return func(o *Options) {
|
||||
o.TraceProvider = tp
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user