From 7e6e5b637d56c1584099442f4f6d3737e1ba24b8 Mon Sep 17 00:00:00 2001 From: williamlardier Date: Wed, 12 Jun 2024 14:53:12 +0200 Subject: [PATCH] S3UTILS-167: do not check error type in monitoring, cleanup file --- utils/monitoring.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils/monitoring.js b/utils/monitoring.js index be086635..fa33098d 100644 --- a/utils/monitoring.js +++ b/utils/monitoring.js @@ -1,13 +1,10 @@ const { errors } = require('arsenal'); const promClient = require('prom-client'); -const { Registry } = require('prom-client'); const { http } = require('httpagent'); -const CountMaster = require('../CountItems/CountMaster'); const aggregatorRegistry = new promClient.AggregatorRegistry(); const { collectDefaultMetrics } = promClient; - // Histogram of the bucket processing duration, by the utilization service. const bucketProcessingDuration = new promClient.Histogram({ name: 's3_countitems_bucket_listing_duration_seconds', @@ -40,7 +37,7 @@ const objectsCount = new promClient.Counter({ */ function _writeResponse(res, error) { let statusCode = 500; - if (error instanceof errors.ArsenalError && Number.isInteger(error.code)) { + if (error && Number.isInteger(error.code)) { statusCode = error.code; } res.writeHead(statusCode, { 'Content-Type': 'application/json' });