@pawells/nestjs-prometheus 2.0.0-dev.f44b25c → 2.0.2-dev.1cd6218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![GitHub Release](https://img.shields.io/github/v/release/PhillipAWells/nestjs-common)](https://github.com/PhillipAWells/nestjs-common/releases)
4
4
  [![CI](https://github.com/PhillipAWells/nestjs-common/actions/workflows/ci.yml/badge.svg)](https://github.com/PhillipAWells/nestjs-common/actions/workflows/ci.yml)
5
5
  [![npm version](https://img.shields.io/npm/v/@pawells/nestjs-prometheus.svg?style=flat)](https://www.npmjs.com/package/@pawells/nestjs-prometheus)
6
- [![Node](https://img.shields.io/badge/node-%3E%3D24-brightgreen)](https://nodejs.org)
6
+ [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
8
8
  [![GitHub Sponsors](https://img.shields.io/github/sponsors/PhillipAWells?style=social)](https://github.com/sponsors/PhillipAWells)
9
9
 
@@ -17,7 +17,7 @@ yarn add @pawells/nestjs-prometheus prom-client
17
17
 
18
18
  ## Requirements
19
19
 
20
- - **Node.js**: >= 24.0.0
20
+ - **Node.js**: >= 22.0.0
21
21
  - **NestJS**: >= 10.0.0
22
22
  - **prom-client**: >= 15.0.0
23
23
  - **@pawells/nestjs-shared**: same version
@@ -42,7 +42,7 @@ import { Module } from '@nestjs/common';
42
42
  import { PrometheusModule } from '@pawells/nestjs-prometheus';
43
43
 
44
44
  @Module({
45
- imports: [PrometheusModule.forRoot()],
45
+ imports: [PrometheusModule.ForRoot()],
46
46
  })
47
47
  export class AppModule {}
48
48
  ```
@@ -153,7 +153,7 @@ import { PrometheusModule } from '@pawells/nestjs-prometheus';
153
153
  import { HTTPMetricsInterceptor } from '@pawells/nestjs-shared';
154
154
 
155
155
  @Module({
156
- imports: [PrometheusModule.forRoot()],
156
+ imports: [PrometheusModule.ForRoot()],
157
157
  providers: [
158
158
  {
159
159
  provide: APP_INTERCEPTOR,
@@ -168,17 +168,17 @@ This automatically tracks:
168
168
  - **Request count** by method and route
169
169
  - **Request duration** (histogram with default buckets)
170
170
  - **Response status codes**
171
- - **Path normalization** (dynamic segments like UUIDs are normalized to `:id`)
171
+ - **Path normalization** (dynamic segments like UUIDs, MongoDB ObjectIDs, and numeric IDs are normalized to `:id` — this is a security measure that prevents unbounded metric cardinality, which could exhaust Prometheus memory if high-entropy path segments were used as label values)
172
172
 
173
173
  ## Module API
174
174
 
175
- ### PrometheusModule.forRoot()
175
+ ### PrometheusModule.ForRoot()
176
176
 
177
177
  Returns a DynamicModule configured as global, enabling single import at the top level:
178
178
 
179
179
  ```typescript
180
180
  @Module({
181
- imports: [PrometheusModule.forRoot()],
181
+ imports: [PrometheusModule.ForRoot()],
182
182
  })
183
183
  export class AppModule {}
184
184
  ```
@@ -190,11 +190,11 @@ export class AppModule {}
190
190
  The main NestJS module. Implements `OnModuleInit` and `OnApplicationShutdown`.
191
191
 
192
192
  **Static Methods:**
193
- - `forRoot()` - Create global module with automatic registration
193
+ - `ForRoot()` - Create global module with automatic registration
194
194
 
195
195
  **Lifecycle Methods:**
196
196
  - `onModuleInit()` - Registers the exporter with InstrumentationRegistry
197
- - `onApplicationShutdown()` - Calls exporter.shutdown() to clean up resources
197
+ - `onApplicationShutdown()` - Calls `Exporter.Shutdown()` to clean up resources
198
198
 
199
199
  ### PrometheusExporter
200
200
 
@@ -205,10 +205,10 @@ Implements `IMetricsExporter` from `@pawells/nestjs-shared`.
205
205
  - `SupportsPull` - `true` (supports pull-based retrieval)
206
206
 
207
207
  **Methods:**
208
- - `onDescriptorRegistered(descriptor: MetricDescriptor)` - Called when a metric is registered; creates the appropriate prom-client instrument
209
- - `onMetricRecorded(value: MetricValue)` - Buffers a metric value to be flushed on next pull
210
- - `getMetrics(): Promise<string>` - Flushes pending values and returns metrics in Prometheus text format
211
- - `shutdown(): Promise<void>` - Clears registry and releases resources
208
+ - `OnDescriptorRegistered(descriptor: IMetricDescriptor)` - Called when a metric is registered; creates the appropriate prom-client instrument
209
+ - `OnMetricRecorded(value: IMetricValue)` - Buffers a metric value to be flushed on next pull
210
+ - `GetMetrics(): Promise<string>` - Flushes pending values and returns metrics in Prometheus text format
211
+ - `Shutdown(): Promise<void>` - Clears registry and releases resources
212
212
 
213
213
  **Internals:**
214
214
  - Maintains a prom-client `Registry` for instrument management
@@ -220,7 +220,7 @@ Implements `IMetricsExporter` from `@pawells/nestjs-shared`.
220
220
  HTTP controller with single endpoint.
221
221
 
222
222
  **Methods:**
223
- - `getMetrics(response: Response): Promise<void>` - GET /metrics, protected by MetricsGuard
223
+ - `GetMetrics(response: Response): Promise<void>` - GET /metrics, protected by MetricsGuard
224
224
 
225
225
  ## Advanced Patterns
226
226
 
package/build/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![GitHub Release](https://img.shields.io/github/v/release/PhillipAWells/nestjs-common)](https://github.com/PhillipAWells/nestjs-common/releases)
4
4
  [![CI](https://github.com/PhillipAWells/nestjs-common/actions/workflows/ci.yml/badge.svg)](https://github.com/PhillipAWells/nestjs-common/actions/workflows/ci.yml)
5
5
  [![npm version](https://img.shields.io/npm/v/@pawells/nestjs-prometheus.svg?style=flat)](https://www.npmjs.com/package/@pawells/nestjs-prometheus)
6
- [![Node](https://img.shields.io/badge/node-%3E%3D24-brightgreen)](https://nodejs.org)
6
+ [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
8
8
  [![GitHub Sponsors](https://img.shields.io/github/sponsors/PhillipAWells?style=social)](https://github.com/sponsors/PhillipAWells)
9
9
 
@@ -17,7 +17,7 @@ yarn add @pawells/nestjs-prometheus prom-client
17
17
 
18
18
  ## Requirements
19
19
 
20
- - **Node.js**: >= 24.0.0
20
+ - **Node.js**: >= 22.0.0
21
21
  - **NestJS**: >= 10.0.0
22
22
  - **prom-client**: >= 15.0.0
23
23
  - **@pawells/nestjs-shared**: same version
@@ -42,7 +42,7 @@ import { Module } from '@nestjs/common';
42
42
  import { PrometheusModule } from '@pawells/nestjs-prometheus';
43
43
 
44
44
  @Module({
45
- imports: [PrometheusModule.forRoot()],
45
+ imports: [PrometheusModule.ForRoot()],
46
46
  })
47
47
  export class AppModule {}
48
48
  ```
@@ -153,7 +153,7 @@ import { PrometheusModule } from '@pawells/nestjs-prometheus';
153
153
  import { HTTPMetricsInterceptor } from '@pawells/nestjs-shared';
154
154
 
155
155
  @Module({
156
- imports: [PrometheusModule.forRoot()],
156
+ imports: [PrometheusModule.ForRoot()],
157
157
  providers: [
158
158
  {
159
159
  provide: APP_INTERCEPTOR,
@@ -168,17 +168,17 @@ This automatically tracks:
168
168
  - **Request count** by method and route
169
169
  - **Request duration** (histogram with default buckets)
170
170
  - **Response status codes**
171
- - **Path normalization** (dynamic segments like UUIDs are normalized to `:id`)
171
+ - **Path normalization** (dynamic segments like UUIDs, MongoDB ObjectIDs, and numeric IDs are normalized to `:id` — this is a security measure that prevents unbounded metric cardinality, which could exhaust Prometheus memory if high-entropy path segments were used as label values)
172
172
 
173
173
  ## Module API
174
174
 
175
- ### PrometheusModule.forRoot()
175
+ ### PrometheusModule.ForRoot()
176
176
 
177
177
  Returns a DynamicModule configured as global, enabling single import at the top level:
178
178
 
179
179
  ```typescript
180
180
  @Module({
181
- imports: [PrometheusModule.forRoot()],
181
+ imports: [PrometheusModule.ForRoot()],
182
182
  })
183
183
  export class AppModule {}
184
184
  ```
@@ -190,11 +190,11 @@ export class AppModule {}
190
190
  The main NestJS module. Implements `OnModuleInit` and `OnApplicationShutdown`.
191
191
 
192
192
  **Static Methods:**
193
- - `forRoot()` - Create global module with automatic registration
193
+ - `ForRoot()` - Create global module with automatic registration
194
194
 
195
195
  **Lifecycle Methods:**
196
196
  - `onModuleInit()` - Registers the exporter with InstrumentationRegistry
197
- - `onApplicationShutdown()` - Calls exporter.shutdown() to clean up resources
197
+ - `onApplicationShutdown()` - Calls `Exporter.Shutdown()` to clean up resources
198
198
 
199
199
  ### PrometheusExporter
200
200
 
@@ -205,10 +205,10 @@ Implements `IMetricsExporter` from `@pawells/nestjs-shared`.
205
205
  - `SupportsPull` - `true` (supports pull-based retrieval)
206
206
 
207
207
  **Methods:**
208
- - `onDescriptorRegistered(descriptor: MetricDescriptor)` - Called when a metric is registered; creates the appropriate prom-client instrument
209
- - `onMetricRecorded(value: MetricValue)` - Buffers a metric value to be flushed on next pull
210
- - `getMetrics(): Promise<string>` - Flushes pending values and returns metrics in Prometheus text format
211
- - `shutdown(): Promise<void>` - Clears registry and releases resources
208
+ - `OnDescriptorRegistered(descriptor: IMetricDescriptor)` - Called when a metric is registered; creates the appropriate prom-client instrument
209
+ - `OnMetricRecorded(value: IMetricValue)` - Buffers a metric value to be flushed on next pull
210
+ - `GetMetrics(): Promise<string>` - Flushes pending values and returns metrics in Prometheus text format
211
+ - `Shutdown(): Promise<void>` - Clears registry and releases resources
212
212
 
213
213
  **Internals:**
214
214
  - Maintains a prom-client `Registry` for instrument management
@@ -220,7 +220,7 @@ Implements `IMetricsExporter` from `@pawells/nestjs-shared`.
220
220
  HTTP controller with single endpoint.
221
221
 
222
222
  **Methods:**
223
- - `getMetrics(response: Response): Promise<void>` - GET /metrics, protected by MetricsGuard
223
+ - `GetMetrics(response: Response): Promise<void>` - GET /metrics, protected by MetricsGuard
224
224
 
225
225
  ## Advanced Patterns
226
226
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pawells/nestjs-prometheus",
3
3
  "displayName": "@pawells/nestjs-prometheus",
4
- "version": "2.0.0-dev.f44b25c",
4
+ "version": "2.0.2-dev.1cd6218",
5
5
  "description": "NestJS Prometheus metrics module with endpoint controller",
6
6
  "type": "module",
7
7
  "main": "./build/index.js",
@@ -40,7 +40,7 @@
40
40
  "xss": ">=1.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@pawells/nestjs-shared": "2.0.0-dev.f44b25c"
43
+ "@pawells/nestjs-shared": "2.0.2-dev.1cd6218"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=22.0.0"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pawells/nestjs-prometheus",
3
3
  "displayName": "@pawells/nestjs-prometheus",
4
- "version": "2.0.0-dev.f44b25c",
4
+ "version": "2.0.2-dev.1cd6218",
5
5
  "description": "NestJS Prometheus metrics module with endpoint controller",
6
6
  "type": "module",
7
7
  "main": "./build/index.js",
@@ -40,7 +40,7 @@
40
40
  "xss": ">=1.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@pawells/nestjs-shared": "2.0.0-dev.f44b25c"
43
+ "@pawells/nestjs-shared": "2.0.2-dev.1cd6218"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@nestjs/common": "^11.1.17",