github nestjs/terminus 12.2.0
Release 12.2.0

44 minutes ago

12.2.0 (2026-11-16)

Features

  • http: add FetchHealthIndicator (8f0a72c)
  • accept duration and size strings like '2s' and '150mb' (9bfcc20)
  • add degradedAfter() and degradedOnFailure() (ef957dd), closes #2794
  • add withData(), withSuccessData() and withFailureData() to attempts (3bf4cc9)
  • register a named swagger schema for health check results (41081e5), closes #2070, @kimseongchan0914
  • export the HealthIndicatorStatus and HealthCheckStatus objects (79829bc)
@Get('ready')
@HealthCheck()
ready() {
  return this.health.check([
    () => this.db.pingCheck('database').degradedAfter('300ms').withTimeout('2s'),
    () => this.http.pingCheck('payments', 'https://payments.example.com/health').withData({ owner: 'team-payments' }),
    () => this.disk.checkStorage('storage', { path: '/', threshold: '250gb' }).cacheFor('30s'),
  ]);
}

Bug Fixes

Deprecations

  • HttpHealthIndicator is deprecated. Use FetchHealthIndicator, which needs no additional package.
  • The value returned by the attempt() function is still added to the result, but the next major version ignores it. Use withSuccessData() to choose the data.

Good to know

  • The results of the memory and disk checks now include responseTime.
  • A disk check on a path that does not exist is down (503). Before, it was an error (500).
  • @HealthCheck({ noCache: true }) no longer turns off the Swagger documentation, and @HealthCheck({ swaggerDocumentation: false }) no longer turns off the Cache-Control header.
  • A missing optional package is now reported when the application starts (app.init() or app.listen()), and only for the indicators you inject.
  • The Swagger document uses the schemas TerminusHealthCheckResult and TerminusHealthIndicatorResult. Generated API clients get new model names.

Don't miss a new terminus release

NewReleases is sending notifications on new releases.