mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-24 15:48:52 +01:00
Record idp manager type (#1027)
This allows to define priority on support different managers
This commit is contained in:
parent
6c2ed4b4f2
commit
76db4f801a
@ -218,7 +218,11 @@ var (
|
||||
if !disableMetrics {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
metricsWorker := metrics.NewWorker(ctx, installationID, store, peersUpdateManager)
|
||||
idpManager := "disabled"
|
||||
if config.IdpManagerConfig != nil && config.IdpManagerConfig.ManagerType != "" {
|
||||
idpManager = config.IdpManagerConfig.ManagerType
|
||||
}
|
||||
metricsWorker := metrics.NewWorker(ctx, installationID, store, peersUpdateManager, idpManager)
|
||||
go metricsWorker.Run()
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ type ConnManager interface {
|
||||
type Worker struct {
|
||||
ctx context.Context
|
||||
id string
|
||||
idpManager string
|
||||
dataSource DataSource
|
||||
connManager ConnManager
|
||||
startupTime time.Time
|
||||
@ -66,11 +67,12 @@ type Worker struct {
|
||||
}
|
||||
|
||||
// NewWorker returns a metrics worker
|
||||
func NewWorker(ctx context.Context, id string, dataSource DataSource, connManager ConnManager) *Worker {
|
||||
func NewWorker(ctx context.Context, id string, dataSource DataSource, connManager ConnManager, idpManager string) *Worker {
|
||||
currentTime := time.Now()
|
||||
return &Worker{
|
||||
ctx: ctx,
|
||||
id: id,
|
||||
idpManager: idpManager,
|
||||
dataSource: dataSource,
|
||||
connManager: connManager,
|
||||
startupTime: currentTime,
|
||||
@ -277,6 +279,7 @@ func (w *Worker) generateProperties() properties {
|
||||
metricsProperties["min_active_peer_version"] = minActivePeerVersion
|
||||
metricsProperties["max_active_peer_version"] = maxActivePeerVersion
|
||||
metricsProperties["ui_clients"] = uiClient
|
||||
metricsProperties["idp_manager"] = w.idpManager
|
||||
|
||||
for protocol, count := range rulesProtocol {
|
||||
metricsProperties["rules_protocol_"+protocol] = count
|
||||
|
Loading…
Reference in New Issue
Block a user