diff --git a/metrics/metrics.go b/metrics/metrics.go index b52f24392..149195faf 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -50,6 +50,9 @@ var ( StorageID, _ = tag.NewKey("storage_id") SectorState, _ = tag.NewKey("sector_state") + PathSeal, _ = tag.NewKey("path_seal") + PathStorage, _ = tag.NewKey("path_storage") + // rcmgr ServiceID, _ = tag.NewKey("svc") ProtocolID, _ = tag.NewKey("proto") @@ -389,52 +392,52 @@ var ( StorageFSAvailableView = &view.View{ Measure: StorageFSAvailable, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageAvailableView = &view.View{ Measure: StorageAvailable, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageReservedView = &view.View{ Measure: StorageReserved, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageLimitUsedView = &view.View{ Measure: StorageLimitUsed, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageCapacityBytesView = &view.View{ Measure: StorageCapacityBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageFSAvailableBytesView = &view.View{ Measure: StorageFSAvailableBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageAvailableBytesView = &view.View{ Measure: StorageAvailableBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageReservedBytesView = &view.View{ Measure: StorageReservedBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageLimitUsedBytesView = &view.View{ Measure: StorageLimitUsedBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } StorageLimitMaxBytesView = &view.View{ Measure: StorageLimitMaxBytes, Aggregation: view.LastValue(), - TagKeys: []tag.Key{StorageID}, + TagKeys: []tag.Key{StorageID, PathStorage, PathSeal}, } SchedAssignerCycleDurationView = &view.View{ diff --git a/storage/paths/index.go b/storage/paths/index.go index ba387a3f7..ce11eec9c 100644 --- a/storage/paths/index.go +++ b/storage/paths/index.go @@ -324,7 +324,11 @@ func (i *Index) StorageReportHealth(ctx context.Context, id storiface.ID, report ent.lastHeartbeat = time.Now() if report.Stat.Capacity > 0 { - ctx, _ = tag.New(ctx, tag.Upsert(metrics.StorageID, string(id))) + ctx, _ = tag.New(ctx, + tag.Upsert(metrics.StorageID, string(id)), + tag.Upsert(metrics.PathStorage, fmt.Sprint(ent.info.CanStore)), + tag.Upsert(metrics.PathSeal, fmt.Sprint(ent.info.CanSeal)), + ) stats.Record(ctx, metrics.StorageFSAvailable.M(float64(report.Stat.FSAvailable)/float64(report.Stat.Capacity))) stats.Record(ctx, metrics.StorageAvailable.M(float64(report.Stat.Available)/float64(report.Stat.Capacity)))