Merge pull request #2237 from coreos-inc/metrics-labels

Don't record size in chunk upload metrics
This commit is contained in:
Brad Ison 2016-12-15 14:20:34 -05:00 committed by GitHub
commit 2730c26b2e
2 changed files with 8 additions and 2 deletions

View file

@ -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)

View file

@ -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',