Skip to content

Commit

Permalink
fix(fix/csi-1130): metrics and test coverage fixes (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Jan 28, 2025
1 parent ff17a96 commit 590d83f
Show file tree
Hide file tree
Showing 17 changed files with 793 additions and 190 deletions.
158 changes: 37 additions & 121 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@
"@hapi/hapi": "21.3.12",
"@hapi/inert": "7.1.0",
"@hapi/vision": "7.0.3",
"@mojaloop/central-services-error-handling": "13.0.3",
"@mojaloop/central-services-error-handling": "13.0.4",
"@mojaloop/central-services-health": "15.0.2",
"@mojaloop/central-services-logger": "11.5.2",
"@mojaloop/central-services-metrics": "12.4.3",
"@mojaloop/central-services-shared": "18.15.2",
"@mojaloop/central-services-stream": "11.4.2",
"@mojaloop/event-sdk": "14.1.2",
"@mojaloop/central-services-logger": "11.5.4",
"@mojaloop/central-services-metrics": "12.4.4",
"@mojaloop/central-services-shared": "18.16.2",
"@mojaloop/central-services-stream": "11.4.3",
"@mojaloop/event-sdk": "14.1.3",
"@mojaloop/inter-scheme-proxy-cache-lib": "2.3.1",
"@mojaloop/ml-number": "11.2.5",
"@mojaloop/ml-number": "11.2.6",
"@mojaloop/ml-schema-transformer-lib": "^2.5.1",
"@mojaloop/sdk-standard-components": "^19.6.3",
"@mojaloop/sdk-standard-components": "^19.6.4",
"ajv": "8.17.1",
"ajv-keywords": "5.1.0",
"axios": "1.7.9",
Expand Down Expand Up @@ -149,7 +149,6 @@
"npm-check-updates": "17.1.14",
"nyc": "17.1.0",
"pre-commit": "1.2.2",
"proxyquire": "2.1.3",
"replace": "^1.2.2",
"sinon": "19.0.2",
"standard": "17.1.2",
Expand Down
10 changes: 7 additions & 3 deletions src/api/bulkQuotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@
const Metrics = require('@mojaloop/central-services-metrics')
const { Producer } = require('@mojaloop/central-services-stream').Util
const { Http, Events } = require('@mojaloop/central-services-shared').Enum
const { reformatFSPIOPError } = require('@mojaloop/central-services-error-handling').Factory

const util = require('../lib/util')
const Config = require('../lib/config')
const dto = require('../lib/dto')

const { kafkaConfig } = new Config()

/**
* Operations on /bulkQuotes
*/
Expand All @@ -62,6 +61,8 @@ module.exports = {
).startTimer()
let step

const { kafkaConfig, instrumentationMetricsDisabled } = new Config()

try {
await util.auditSpan(request)

Expand All @@ -80,7 +81,10 @@ module.exports = {
return h.response().code(Http.ReturnCodes.ACCEPTED.CODE)
} catch (err) {
histTimerEnd({ success: false })
util.rethrowAndCountFspiopError(err, { operation: 'postBulkQuotes', step })
if (!instrumentationMetricsDisabled) {
util.rethrowAndCountFspiopError(err, { operation: 'postBulkQuotes', step })
}
throw reformatFSPIOPError(err)
}
}
}
Loading

0 comments on commit 590d83f

Please sign in to comment.