diff --git a/endpoints/v1/registry.py b/endpoints/v1/registry.py index 543a8f4c2..f0bcc11b8 100644 --- a/endpoints/v1/registry.py +++ b/endpoints/v1/registry.py @@ -199,8 +199,10 @@ def put_image_layer(namespace, repository, image_id): try: start_time = time() store.stream_write(locations, path, sr) + metric_queue.chunk_size.Observe(size_info.compressed_size, + labelvalues=[list(locations)[0]]) metric_queue.chunk_upload_time.Observe(time() - start_time, - labelvalues=[size_info.compressed_size, list(locations)[0]]) + labelvalues=[list(locations)[0]]) except IOError: logger.exception('Exception when writing image data') abort(520, 'Image %(image_id)s could not be written. Please try again.', image_id=image_id) diff --git a/util/metrics/metricqueue.py b/util/metrics/metricqueue.py index caf065ea5..5dba0ea97 100644 --- a/util/metrics/metricqueue.py +++ b/util/metrics/metricqueue.py @@ -73,9 +73,13 @@ class MetricQueue(object): labelnames=['namespace', 'repo_name', 'status', 'executor']) + self.chunk_size = prom.create_histogram('chunk_size', + 'Registry blob chunk size', + labelnames=['storage_region']) + self.chunk_upload_time = prom.create_histogram('chunk_upload_time', 'Registry blob chunk upload time', - labelnames=['chunk_size', 'storage_region']) + labelnames=['storage_region']) self.authentication_count = prom.create_counter('authenication_count', 'Authentication count',