Design metrics to be reliable and maintainable by following these key principles:

  1. Initialize metrics with zero values to ensure consistent existence:
    labelValues := []string{keyspace, shard, tabletType}
    metrics.vstreamsEndedWithErrors.Add(labelValues, 0)
    
  2. Choose appropriate metric granularity:
  3. Select stable label dimensions:
  4. Handle metric lifecycle properly:

These practices ensure metrics remain useful for debugging production issues while staying maintainable over time.