-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metrics for SyncSet and SelectorSyncSets
- Loading branch information
1 parent
e079d17
commit 8d1a6e9
Showing
16 changed files
with
837 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package cluster | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the Apache License 2.0. | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
func (mon *Monitor) emitSyncSetStatus(ctx context.Context) error { | ||
cs, error := mon.hiveClusterManager.GetClusterSyncforClusterDeployment(ctx, mon.doc) | ||
if error != nil { | ||
return nil | ||
} | ||
if cs.Status.SyncSets != nil { | ||
mon.emitGauge("syncsets.count", int64(len(cs.Status.SyncSets)), nil) | ||
|
||
for _, s := range cs.Status.SyncSets { | ||
mon.emitGauge("hive.syncsets", 1, map[string]string{ | ||
"name": s.Name, | ||
"result": string(s.Result), | ||
"firstSuccessTime": s.FirstSuccessTime.String(), | ||
"lastTransitionTime": s.LastTransitionTime.String(), | ||
"failureMessage": s.FailureMessage, | ||
}) | ||
} | ||
} | ||
|
||
if cs.Status.SelectorSyncSets != nil { | ||
mon.emitGauge("selectorsyncsets.count", int64(len(cs.Status.SelectorSyncSets)), nil) | ||
|
||
for _, s := range cs.Status.SelectorSyncSets { | ||
mon.emitGauge("hive.selectorsyncsets", 1, map[string]string{ | ||
"name": s.Name, | ||
"result": string(s.Result), | ||
"firstSuccessTime": s.FirstSuccessTime.String(), | ||
"lastTransitionTime": s.LastTransitionTime.String(), | ||
"failureMessage": s.FailureMessage, | ||
}) | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.