File

lib/health-indicators/microservice/microservice.health.ts

Description

The MicroserviceHealthIndicator is a health indicators which is used for health checks related to microservices

Extends

HealthIndicator

Example

Index

Methods

Constructor

constructor()

Initializes the health indicator

Methods

Async pingCheck
pingCheck(key: string, options: MicroserviceHealthIndicatorOptions)

Checks if the given microservice is up

Parameters :
Name Type Optional Description
key string No

The key which will be used for the result object

options MicroserviceHealthIndicatorOptions No

The options of the microservice

Example :
microservice.pingCheck('tcp', {
transport: Transport.TCP,
options: { host: 'localhost', port: 3001 },
})
Protected getStatus
getStatus(key: string, isHealthy: boolean, data?: literal type)

Generates the health indicator result object

Parameters :
Name Type Optional Description
key string No

The key which will be used as key for the result object

isHealthy boolean No

Whether the health indicator is healthy

data literal type Yes

Additional data which will get appended to the result object

result-matching ""

    No results matching ""