@nestjs-redisx/metrics
v1.1.1
Published
Prometheus metrics plugin for NestJS RedisX with custom metrics support
Maintainers
Readme
@nestjs-redisx/metrics
Prometheus metrics plugin for NestJS RedisX. Exposes Redis command latencies, connection pool stats, cache hit rates, and custom metrics via a /metrics endpoint. prom-client is bundled.
Installation
npm install @nestjs-redisx/core @nestjs-redisx/metrics ioredisQuick Example
import { RedisModule } from '@nestjs-redisx/core';
import { MetricsPlugin } from '@nestjs-redisx/metrics';
@Module({
imports: [
RedisModule.forRoot({
clients: { host: 'localhost', port: 6379 },
plugins: [
new MetricsPlugin({ prefix: 'redisx_', exposeEndpoint: true }),
],
}),
],
})
export class AppModule {}
// Scrape: curl http://localhost:3000/metricsDocumentation
Full documentation: nestjs-redisx.dev/en/reference/metrics/
License
MIT
