Skip to content

Health Checks

For any API your module is using, you should have a health check endpoint that can be called to determine if the API is healthy.

If the API is not healthy:

  • the module should not be displayed to the user.
  • the module should display a message to the user that the data is not available.

Implementation

Platform Health Check

If your module is accessing data from the platform, you can use the /HealthzChecks/ping endpoint to determine if the platform API is healthy.

E.g. for the Hv.ModuleApi you can trigger a GET request to:

  • https://app-hv-c-moduleapi-tes-weu-001.azurewebsites.net/HealthzChecks/ping

which should return a 200 status code and a response with the string pong if the API is healthy.

SeasonAdmin Health Check

The Hv.SeasonAdmin API provides a health check endpoint that can be used to determine if the database of a specific organization is healthy:

  • https://app-hv-c-seasonadmin-tes-weu-001.azurewebsites.net/api/v1.0/SeasonAdminDBHealth/{orgId}

If the database is healthy, the endpoint will return a 200 status code and the boolean value true in the response body.

SensorAdmin Health Check

The Hv.SensorAdmin API provides two health check endpoints that can be used to determine for a specific organization if

1) the database is healthy:

  • https://app-hv-c-sensoradmin-tes-weu-001.azurewebsites.net/api/v1.0/SensorAdminDBHealth/{orgId}

2) the IoT services are healthy:

  • https://app-hv-c-sensoradmin-tes-weu-001.azurewebsites.net/api/v1.0/SensorAdminHealth/{orgId}

If the database and IoT services are healthy, the endpoints will return a 200 status code and the boolean value true in the response body.

Health Check Feedback Screens

In the HortiView shared components npm package you can find the HealthCheckFailed screen. It can be used if the check for database health, iot health or HV platform health fails. Please use the following title and subtitle for each type to ensure a consistent user experience:

Platform Health Check Failed

alt text

<HealthCheckFailed
  title="The platform data used by this module cannot be retrieved currently."
  subtitle="Please wait or come back later."
  type="platform"
/>

Database Health Check Failed

alt text

<HealthCheckFailed
  title="The data for this module is loading!"
  subtitle="Please wait or come back later."
  type="database"
/>

IoT Health Check Failed

alt text

<HealthCheckFailed
  title="The data of your devices cannot be retrieved currently."
  subtitle="The problem is being addressed by our technical team. Please come back later."
  type="iot"
/>

Generic Errors

Set the type to other to catch generic errors. Again, please use the title and subtitle as listed here to ensure a consistent user experience:

alt text

<HealthCheckFailed
  title="Sorry, something went wrong!"
  subtitle="The problem is being addressed by our technical team. Please come back later."
  type="other"
/>

You can also control if the card is outlined or not, depending on the position in the UI. The card has a default outline. For design consistency, this prop should only be set to false if the card is embedded, e.g. in a table or any other parent that already has a border:

<ParentWithVisibleBorders>
  <HealthCheckFailed
    title="Sorry, something went wrong!"
    subtitle="The problem is being addressed by our technical team. Please come back later."
    type="other"
    isOutlined={false}
  />
</ParentWithVisibleBorders>