340
341
// emit metrics about how many shards are ready
342
>
a.MetricsHandler.Gauge(metrics.CatchUpReadyShardCountGauge.Name()).Record(
activities.go
343
>
float64(readyShardCount),
344
>
metrics.OperationTag(metrics.MigrationWorkflowScope),
345
>
metrics.NamespaceTag(waitRequest.Namespace),
346
>
metrics.TargetClusterTag(waitRequest.RemoteCluster))
347
>
348
>
// emit the not-ready shard count (namespace-tagged) so the catchup failure mode is
349
>
// observable per namespace during a failover.
350
>
a.MetricsHandler.Gauge(metrics.CatchUpNotReadyShardCountGauge.Name()).Record(
351
>
float64(notReadyShardCount),
352
>
metrics.OperationTag(metrics.MigrationWorkflowScope),
353
>
metrics.NamespaceTag(waitRequest.Namespace),
354
>
metrics.TargetClusterTag(waitRequest.RemoteCluster))
355
>
356
>
isReady := notReadyShardCount == 0
357
>
358
>
if !isReady {
359
>
a.Logger.Info("Wait catchup not ready",
360
>
tag.String("RemoteCluster", waitRequest.RemoteCluster),
361
>
tag.String("Namespace", waitRequest.Namespace),
362
>
tag.Int("TotalShards", len(localShards)),
363
>
tag.Int("ReadyShards", readyShardCount),
364
>
tag.Int("NotReadyShards", len(localShards)-readyShardCount),
365
>
tag.Int("NoWatermarkShards", noWatermarkShardCount),
366
>
tag.Duration("AllowedLagging", waitRequest.AllowedLagging),
367
>
tag.Int64("AllowedLaggingTasks", waitRequest.AllowedLaggingTasks),
368
>
tag.Int32("MaxLaggingTasksShardID", maxLaggingTasksShardID),
369
>
tag.Int64("MaxLaggingTasks", maxLaggingTasks),
370
>
tag.Int32("MaxTimeLagShardID", maxTimeLagShardID),
371
>
tag.Duration("MaxTimeLag", maxTimeLag),
372
>
)
373
>
}
374
376
}
377