mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-25 16:18:49 +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 {
|
if !disableMetrics {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
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()
|
go metricsWorker.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ type ConnManager interface {
|
|||||||
type Worker struct {
|
type Worker struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
id string
|
id string
|
||||||
|
idpManager string
|
||||||
dataSource DataSource
|
dataSource DataSource
|
||||||
connManager ConnManager
|
connManager ConnManager
|
||||||
startupTime time.Time
|
startupTime time.Time
|
||||||
@ -66,11 +67,12 @@ type Worker struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewWorker returns a metrics worker
|
// 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()
|
currentTime := time.Now()
|
||||||
return &Worker{
|
return &Worker{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
id: id,
|
id: id,
|
||||||
|
idpManager: idpManager,
|
||||||
dataSource: dataSource,
|
dataSource: dataSource,
|
||||||
connManager: connManager,
|
connManager: connManager,
|
||||||
startupTime: currentTime,
|
startupTime: currentTime,
|
||||||
@ -277,6 +279,7 @@ func (w *Worker) generateProperties() properties {
|
|||||||
metricsProperties["min_active_peer_version"] = minActivePeerVersion
|
metricsProperties["min_active_peer_version"] = minActivePeerVersion
|
||||||
metricsProperties["max_active_peer_version"] = maxActivePeerVersion
|
metricsProperties["max_active_peer_version"] = maxActivePeerVersion
|
||||||
metricsProperties["ui_clients"] = uiClient
|
metricsProperties["ui_clients"] = uiClient
|
||||||
|
metricsProperties["idp_manager"] = w.idpManager
|
||||||
|
|
||||||
for protocol, count := range rulesProtocol {
|
for protocol, count := range rulesProtocol {
|
||||||
metricsProperties["rules_protocol_"+protocol] = count
|
metricsProperties["rules_protocol_"+protocol] = count
|
||||||
|
Loading…
Reference in New Issue
Block a user