
Company News
Socket Named to Rising in Cyber 2026 List of Top Cybersecurity Startups
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.
@ministryofjustice/hmpps-monitoring
Advanced tools
Retrieve and display health and status information from external services and internal components
This package aims to standardise the set of endpoints a frontend application must implement to allow us to monitor it.
It includes:
/ping - a lightweight endpoint that can be called to determine if the application is responsive. Required by kubernetes liveness and readiness probes./info - an endpoint that returns information about the application including it's name, version, productId, and other metadata about the service/health - an endpoint that will return the current state of the application. This will include information about whether it's downstream services are responsive or not.This library is currently: ready to adopt.
Teams are encouraged to use this library. Please provide feedback via slack to the #typescript channel.
Usage is best demonstrated by the HMPPS typescript template as it is already included. New projects based on this template will automatically adopt this package.
The package will self install by running via npx:
npx @ministryofjustice/hmpps-monitoring
How successful this will be is dependent on how similar the codebase is to the current HEAD of the template project.
The final step of the installation script prints instructions on how to manually apply a few changes:
config.ts to add healthPath declarations to each api definition.
/health/ping but this may vary and you will need to check this for each api.The generated changes will need to be reviewed carefully!
The template project was migrated as part of pull request 479, so you can either manually adopt changes from it or cherry-pick the squashed commit.
Essentially, the move to adopt this endpoint is to:
npm install --save-dev @ministryofjustice/hmpps-monitoringhealthPath keys to each API config in config.tssetupHealthChecks.ts to hook up new middleware (see below)app.ts adds the healthChecks middlewareTo configure the middleware it needs to be initialised with ApplicationInfo:
ApplicationInfo type that comes with recent versions of the template project.productId is now mandatory and should be configured - reach out to #ask-hmpps-sre-team about this on slack.It also requires an array of HealthComponents which represent dependencies that this service relies on.
Reflecting dependency health via the /health endpoint will ensure that pingdom and the health monitor correctly record when your application is unhealthy.
The library provides an implementation of HealthComponent, EndpointHealthComponent, which is used to track the health of APIs that this service relies on.
EndpointHealthComponent reuses @ministryofjustice/hmpps-rest-client for outbound HTTP transport, so applications
that already standardise on that client do not have to maintain a separate health-check HTTP stack.
These require:
EndpointHealthComponentOptionsDepending on how your API configuration is organised in config.ts it might be possible to automatically map this to the correct form required by the endpointHealthComponent as demonstrated below:
const apis: Array<[name: string, config: EndpointHealthComponentOptions]> = ...
const middleware = monitoringMiddleware({
applicationInfo,
healthComponents: apis.map(([name, config]) => endpointHealthComponent(logger, name, config)),
})
Once the middleware component is instantiated, then individual endpoints can be registered:
router.get('/health', middleware.health)
router.get('/info', middleware.info)
router.get('/ping', middleware.ping)
Custom health components can be implemented by implementing the HealthComponent interface and passing an instance of this when hooking up the middleware.
This module uses rollup, to build:
npm run clean && npm run build && npm run lint && npm run test
cd to this directory and then pack this library to home directory: npm pack --pack-destination ~
Inside the project of choice then:
npm uninstall @ministryofjustice/hmpps-monitoringnpm install ~/ministryofjustice-hmpps-monitoring-<some-version>.tgzFAQs
Retrieve and display health and status information from external services and internal components
We found that @ministryofjustice/hmpps-monitoring demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 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.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.

Research
Socket detected 84 compromised TanStack npm package artifacts modified with suspected CI credential-stealing malware.

Security News
A dispute over fsnotify maintainer access set off supply chain alarms around one of Go’s most widely used filesystem libraries.