
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@mojaloop/central-services-metrics
Advanced tools
npm install @mojaloop/central-services-metrics
Import Metrics library:
const Metrics = require('@mojaloop/central-services-metrics')
Set configuration options:
let config = {
"timeout": 5000, // Set the timeout in ms for the underlying prom-client library. Default is '5000'.
"prefix": "<PREFIX>", // Set prefix for all defined metrics names
"defaultLabels": { // Set default labels that will be applied to all metrics
"serviceName": "<NAME_OF_SERVICE>"
}
}
Initialise Metrics library:
Metrics.setup(config)
Example instrumentation:
const exampleFunction = async (error, message) => {
const histTimerEnd = Metrics.getHistogram( // Create a new Histogram instrumentation
'exampleFunctionMetric', // Name of metric. Note that this name will be concatenated after the prefix set in the config. i.e. '<PREFIX>_exampleFunctionMetric'
'Instrumentation for exampleFunction', // Description of metric
['success'] // Define a custom label 'success'
).startTimer() // Start instrumentation
try {
Logger.info('do something meaningful here')
histTimerEnd({success: true}) // End the instrumentation & set custom label 'success=true'
} catch (e) {
histTimerEnd({success: false}) // End the instrumentation & set custom label 'success=false'
}
}
We use npm-audit-resolver
along with npm audit
to check dependencies for vulnerabilities, and keep track of resolved dependencies with an audit-resolv.json
file.
To start a new resolution process, run:
npm run audit:resolve
You can then check to see if the CI will pass based on the current dependencies with:
npm run audit:check
And commit the changed audit-resolv.json
to ensure that CircleCI will build correctly.
FAQs
Shared code for metrics generation
The npm package @mojaloop/central-services-metrics receives a total of 96 weekly downloads. As such, @mojaloop/central-services-metrics popularity was classified as not popular.
We found that @mojaloop/central-services-metrics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.