Skip to content

Commit

Permalink
Set is_master metric to 0 for when starting up. (#920)
Browse files Browse the repository at this point in the history
Without this, no metric is exported if the goroutine never gets elected,
so the alerting for "no leader" doesn't work correctly.
  • Loading branch information
pav-kv authored May 4, 2022
1 parent 242386d commit ae7d4b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions trillian/migrillian/core/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func (c *Controller) RunWhenMaster(ctx context.Context) error {
if err != nil {
return err
}
metrics.isMaster.Set(0, c.label)
defer func(ctx context.Context) {
metrics.isMaster.Set(0, c.label)
if err := el.Close(ctx); err != nil {
Expand Down

0 comments on commit ae7d4b7

Please sign in to comment.