Skip to content

Commit

Permalink
blobstore: Add metrics_tag config field
Browse files Browse the repository at this point in the history
WIP; more description to come
  • Loading branch information
minor-fixes committed May 13, 2024
1 parent a9d0937 commit e8ef171
Show file tree
Hide file tree
Showing 5 changed files with 441 additions and 725 deletions.
315 changes: 4 additions & 311 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pkg/blobstore/configuration/new_blob_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,10 @@ func (nc *simpleNestedBlobAccessCreator) NewNestedBlobAccess(configuration *pb.B
}).NewNestedBlobAccess(config.Backend, creator)
case *pb.BlobAccessConfiguration_Label:
if labelBackend, ok := nc.labels[backend.Label]; ok {
return labelBackend, nil
return BlobAccessInfo{
BlobAccess: blobstore.NewMetricsBlobAccess(labelBackend.BlobAccess, clock.SystemClock, creator.GetStorageTypeName(), "label", configuration.GetMetricsTag()),
DigestKeyFormat: labelBackend.DigestKeyFormat,
}, nil
}
return BlobAccessInfo{}, status.Errorf(codes.InvalidArgument, "Label %#v not declared", backend.Label)
}
Expand All @@ -555,7 +558,7 @@ func (nc *simpleNestedBlobAccessCreator) NewNestedBlobAccess(configuration *pb.B
return BlobAccessInfo{}, err
}
return BlobAccessInfo{
BlobAccess: blobstore.NewMetricsBlobAccess(backend.BlobAccess, clock.SystemClock, creator.GetStorageTypeName(), backendType),
BlobAccess: blobstore.NewMetricsBlobAccess(backend.BlobAccess, clock.SystemClock, creator.GetStorageTypeName(), backendType, configuration.GetMetricsTag()),
DigestKeyFormat: backend.DigestKeyFormat,
}, nil
}
Expand Down
Loading

0 comments on commit e8ef171

Please sign in to comment.