Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit additional metrics on replicate blobs and refresh blobs #226

Merged

Conversation

kevinye202
Copy link
Contributor

This pr adds several more metrics to replicate blobs and refresh blobs, specifically batch size and blob size in bytes as well as latency, which would provide more insight in the event of slowness in findMissing and replication.

Copy link
Member

@EdSchouten EdSchouten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Really appreciated!

pkg/blobstore/local/flat_blob_access.go Outdated Show resolved Hide resolved
pkg/blobstore/local/flat_blob_access.go Show resolved Hide resolved
pkg/blobstore/local/flat_blob_access.go Outdated Show resolved Hide resolved
pkg/blobstore/local/flat_blob_access.go Outdated Show resolved Hide resolved
pkg/blobstore/replication/metrics_blob_replicator.go Outdated Show resolved Hide resolved

// NewMetricsBlobReplicator creates a wrapper around BlobReplicator that adds
// Prometheus metrics for monitoring replication operations.
func NewMetricsBlobReplicator(replicator BlobReplicator, clock clock.Clock) BlobReplicator {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now these metrics aren't broken down by backend/storage type. Is that intentional? If not, maybe we can simply use the backend type of the BlobAccess that they are used in conjunction with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added storage type, I didn't see a good way to extract backendType from blobAccess though.

cmd/bb_replicator/main.go Outdated Show resolved Hide resolved
@@ -27,7 +27,7 @@ func NewCASBlobReplicatorCreator(grpcClientFactory grpc.ClientFactory) BlobRepli
func (brc *casBlobReplicatorCreator) NewCustomBlobReplicator(configuration *pb.BlobReplicatorConfiguration, source blobstore.BlobAccess, sink BlobAccessInfo) (replication.BlobReplicator, error) {
switch mode := configuration.Mode.(type) {
case *pb.BlobReplicatorConfiguration_Deduplicating:
base, err := NewBlobReplicatorFromConfiguration(mode.Deduplicating, source, sink, brc)
base, err := NewBlobReplicatorFromConfiguration(mode.Deduplicating, source, sink, brc, "cas")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better if we move GetStorageTypeName() to implementations of BlobReplicatorCreator? Because then we can call that function from here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, moved it there.

pkg/blobstore/local/flat_blob_access.go Show resolved Hide resolved
pkg/blobstore/local/flat_blob_access.go Outdated Show resolved Hide resolved
@EdSchouten EdSchouten merged commit f5a181e into buildbarn:master Nov 21, 2024
1 check passed
@EdSchouten
Copy link
Member

Thanks a lot, @kevinye202. You're a rockstar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants