mirror of
https://github.com/netbirdio/management-integrations.git
synced 2026-05-22 17:09:23 -07:00
add metrics to event store constructor (#25)
This commit is contained in:
@@ -7,6 +7,9 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
|
||||
"github.com/netbirdio/netbird/management/server/store"
|
||||
"github.com/netbirdio/netbird/management/server/telemetry"
|
||||
|
||||
"github.com/netbirdio/netbird/management/server/account"
|
||||
"github.com/netbirdio/netbird/management/server/activity"
|
||||
activitystore "github.com/netbirdio/netbird/management/server/activity/store"
|
||||
@@ -33,7 +36,7 @@ func RegisterHandlers(
|
||||
return router, nil
|
||||
}
|
||||
|
||||
func InitEventStore(ctx context.Context, dataDir string, key string) (activity.Store, string, error) {
|
||||
func InitEventStore(ctx context.Context, dataDir string, key string, _ Metrics) (activity.Store, string, error) {
|
||||
var err error
|
||||
if key == "" {
|
||||
log.Debugf("generate new activity store encryption key")
|
||||
@@ -49,3 +52,13 @@ func InitEventStore(ctx context.Context, dataDir string, key string) (activity.S
|
||||
func InitPermissionsManager(store store.Store) permissions.Manager {
|
||||
return permissions.NewManager(store)
|
||||
}
|
||||
|
||||
type Metrics struct {
|
||||
telemetry.AppMetrics
|
||||
}
|
||||
|
||||
func InitIntegrationMetrics(ctx context.Context, metrics telemetry.AppMetrics) (*Metrics, error) {
|
||||
return &Metrics{
|
||||
AppMetrics: metrics,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user