-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy: added deployer_controller_failed_rollouts metrics
- Loading branch information
Showing
5 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
pkg/deploy/controller/deployer/deployer_controller.go
100755 → 100644
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package deployment | ||
package deployer | ||
|
||
import ( | ||
"fmt" | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package deployment | ||
package deployer | ||
|
||
import ( | ||
"fmt" | ||
|
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,35 @@ | ||
package deployer | ||
|
||
import ( | ||
deployutil "github.com/openshift/origin/pkg/deploy/util" | ||
"github.com/prometheus/client_golang/prometheus" | ||
"k8s.io/kubernetes/pkg/api/v1" | ||
) | ||
|
||
// DeployerControllerSubsystem is how this controller is represented in | ||
// prometheus metrics. | ||
const DeployerControllerSubsystem = "deployer_controller" | ||
|
||
var ( | ||
failedRolloutsCounter = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Subsystem: DeployerControllerSubsystem, | ||
Name: "failed_rollouts", | ||
Help: "Counts total failed rollouts", | ||
}, | ||
[]string{}, | ||
) | ||
) | ||
|
||
func init() { | ||
prometheus.MustRegister(failedRolloutsCounter) | ||
} | ||
|
||
func updateFailedRolloutsMetrics(oldRC, newRC *v1.ReplicationController) { | ||
if oldRC != nil && deployutil.IsFailedDeployment(oldRC) { | ||
return | ||
} | ||
if deployutil.IsFailedDeployment(newRC) { | ||
failedRolloutsCounter.WithLabelValues().Inc() | ||
} | ||
} |
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