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:
Daniël Franke
2023-08-25 10:39:47 +02:00
parent 0eb4b5dc56
commit 7a1e8f1f11
4 changed files with 96 additions and 89 deletions
+9
View File
@@ -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
}
}