Skip to content

CCM-12649 Get Status healthcheck endpoint#206

Merged
stevebux merged 17 commits intomainfrom
feature/CCM-12649
Nov 19, 2025
Merged

CCM-12649 Get Status healthcheck endpoint#206
stevebux merged 17 commits intomainfrom
feature/CCM-12649

Conversation

@stevebux
Copy link
Copy Markdown
Contributor

Description

Context

Healthcheck endpoint

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@stevebux stevebux requested review from a team as code owners October 23, 2025 14:09
@stevebux stevebux force-pushed the feature/CCM-12649 branch 3 times, most recently from 346deab to 0be7bd3 Compare October 24, 2025 07:46
Copy link
Copy Markdown
Contributor

@francisco-videira-nhs francisco-videira-nhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple points:

Response payload
I raised this this ticket originally thinking we'd only need to return 200 OK if pass and 400/500 if not, but looks like we need to do this like described in https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/158433407/_status+endpoint (payload links to the healthcheck RFC)?

I'm not aware if we can simplify it though... Any thoughts @masl2 ?

If we do need to return a payload like described in there it might prove tricky with the current error mapping logic involving mapToErrorResponse.

Proxygen
I wonder if we need to do something additional with proxygen too? Is it already supporting this? @nhsd-david-wass

OAS / Sandbox
Currently the _status endpoint inly has a 200 OK. We might want to build up on that depending on the answers above?

@stevebux
Copy link
Copy Markdown
Contributor Author

Proxygen I wonder if we need to do something additional with proxygen too? Is it already supporting this? @nhsd-david-wass

Am I right in thinking openapi.yaml is the proxygen configuration? If so, it's already configured:

x-nhsd-apim:
  temporary: true
  monitoring: false
  access: []
  target:
    type: hosted
    healthcheck: /_status

Copy link
Copy Markdown
Contributor

@masl2 masl2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So by the information in https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/158433407/_status+endpoint

The status response should always return 200 if the check is triggered and contain a response with a status content (looks like we're currently returning empty)

Also - the setup for running the health checks will use a manually created product to routinely poll the healthcheck (using apikey auth) in order to report the proxy status; so we can't attach the standard auth pattern for suppliers to the healthcheck

@stevebux
Copy link
Copy Markdown
Contributor Author

So by the information in https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/158433407/_status+endpoint

The status response should always return 200 if the check is triggered and contain a response with a status content (looks like we're currently returning empty)

According to @nhsd-david-wass, the status JSON described there will be created for us for free by a default proxy policy - all we have to do is return 200

@stevebux
Copy link
Copy Markdown
Contributor Author

Also - the setup for running the health checks will use a manually created product to routinely poll the healthcheck (using apikey auth) in order to report the proxy status; so we can't attach the standard auth pattern for suppliers to the healthcheck

Ah OK, I wasn't sure on that point. I can remove that. Can we get away with no authorisation at all in that case?

@stevebux stevebux requested a review from a team as a code owner November 17, 2025 14:35
Copy link
Copy Markdown
Contributor

@francisco-videira-nhs francisco-videira-nhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✔️

@stevebux stevebux merged commit c30a571 into main Nov 19, 2025
32 checks passed
@stevebux stevebux deleted the feature/CCM-12649 branch November 19, 2025 11:33
masl2 added a commit that referenced this pull request Jan 5, 2026
* CCM-12649 Get status healthcheck endpoint

* Address review comments

* Fix following merge with main

* Avoid leaking system details in 500 error message

* Tidy up @internal paths

* Update .gitleaksignore

added gitleaks ignore

* Fix logging in error mapper

* Address review comments

* Terraform fix

* Allow for no headers

* Change response shape

---------

Co-authored-by: Tim Ireland <tim.ireland@hscic.gov.uk>
Co-authored-by: Mark Slowey <113013138+masl2@users.noreply.github.com>
Co-authored-by: Francisco Videira <francisco.videira@nhs.net>
Signed-off-by: Mark Slowey <mark.slowey1@nhs.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants