| Index: common/tsmon/metric/standard_metrics.go
|
| diff --git a/common/tsmon/metric/standard_metrics.go b/common/tsmon/metric/standard_metrics.go
|
| index b98c3d3b8b68a7561c7d840603c0eb9c8b822a26..5dd2b3bc740816bf3ebf43e54948138379d99b75 100644
|
| --- a/common/tsmon/metric/standard_metrics.go
|
| +++ b/common/tsmon/metric/standard_metrics.go
|
| @@ -10,6 +10,7 @@ import (
|
|
|
| "golang.org/x/net/context"
|
|
|
| + "github.com/luci/luci-go/common/tsmon"
|
| "github.com/luci/luci-go/common/tsmon/distribution"
|
| "github.com/luci/luci-go/common/tsmon/field"
|
| "github.com/luci/luci-go/common/tsmon/types"
|
| @@ -101,9 +102,14 @@ var (
|
|
|
| )
|
|
|
| -// UpdatePresenceMetrics sets the presence/up metric.
|
| -func UpdatePresenceMetrics(ctx context.Context) {
|
| - presenceMetric.Set(ctx, true)
|
| +func init() {
|
| + registerCallbacks(context.Background())
|
| +}
|
| +
|
| +func registerCallbacks(ctx context.Context) {
|
| + tsmon.RegisterCallbackIn(ctx, func(ctx context.Context) {
|
| + presenceMetric.Set(ctx, true)
|
| + })
|
| }
|
|
|
| const (
|
|
|