HealthPlugin(options?: HealthPluginOptions): IPlugin
Creates a health plugin.
Example 1
Example 1
app.register(HealthPlugin()); // Or with custom options app.register(HealthPlugin({ endpoints: { health: '/health', live: '/live', ready: '/ready', }, indicators: [ createHttpIndicator('external-api', { url: 'https://api.example.com/health' }), (services) => createDatabaseIndicator(services), ], }));
indicators accepts an instance or a RegistryFactory
((services: IServiceRegistry) => IHealthIndicator). A factory is resolved at
onInit — the first phase at which the registry holds every capability — and,
because HealthPlugin registers at priority 100, before the database and every
other ordinary capability plugin. Instance indicators keep their register() timing.
optional
options: HealthPluginOptions
Plugin configuration options