Skip to content

Commit

Permalink
S3UTILS-167: do not check error type in monitoring, cleanup file
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlardier committed Jun 12, 2024
1 parent f0aa2cd commit 7e6e5b6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions utils/monitoring.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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' });
Expand Down

0 comments on commit 7e6e5b6

Please sign in to comment.