@pawells/nestjs-prometheus 2.0.2 → 2.1.0
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 +4 -4
- package/build/README.md +4 -4
- package/build/errors/prometheus.errors.d.ts +30 -0
- package/build/errors/prometheus.errors.d.ts.map +1 -0
- package/build/errors/prometheus.errors.js +32 -0
- package/build/errors/prometheus.errors.js.map +1 -0
- package/build/package.json +2 -2
- package/build/prometheus.exporter.d.ts +3 -1
- package/build/prometheus.exporter.d.ts.map +1 -1
- package/build/prometheus.exporter.js +7 -2
- package/build/prometheus.exporter.js.map +1 -1
- package/build/prometheus.module.d.ts +1 -1
- package/build/prometheus.module.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -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.
|
|
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.
|
|
156
|
+
imports: [PrometheusModule.forRoot()],
|
|
157
157
|
providers: [
|
|
158
158
|
{
|
|
159
159
|
provide: APP_INTERCEPTOR,
|
|
@@ -172,13 +172,13 @@ This automatically tracks:
|
|
|
172
172
|
|
|
173
173
|
## Module API
|
|
174
174
|
|
|
175
|
-
### PrometheusModule.
|
|
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.
|
|
181
|
+
imports: [PrometheusModule.forRoot()],
|
|
182
182
|
})
|
|
183
183
|
export class AppModule {}
|
|
184
184
|
```
|
package/build/README.md
CHANGED
|
@@ -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.
|
|
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.
|
|
156
|
+
imports: [PrometheusModule.forRoot()],
|
|
157
157
|
providers: [
|
|
158
158
|
{
|
|
159
159
|
provide: APP_INTERCEPTOR,
|
|
@@ -172,13 +172,13 @@ This automatically tracks:
|
|
|
172
172
|
|
|
173
173
|
## Module API
|
|
174
174
|
|
|
175
|
-
### PrometheusModule.
|
|
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.
|
|
181
|
+
imports: [PrometheusModule.forRoot()],
|
|
182
182
|
})
|
|
183
183
|
export class AppModule {}
|
|
184
184
|
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when a Prometheus exporter operation fails.
|
|
3
|
+
*/
|
|
4
|
+
export declare class PrometheusExportError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Error code for programmatic identification.
|
|
7
|
+
*/
|
|
8
|
+
readonly Code: string;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new PrometheusExportError instance.
|
|
11
|
+
*
|
|
12
|
+
* @param message - The error message
|
|
13
|
+
* @param options - Configuration options
|
|
14
|
+
* @param options.code - Error code (default: 'PROMETHEUS_EXPORT_FAILED')
|
|
15
|
+
* @param options.cause - Original error that caused this error
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* throw new PrometheusExportError('Failed to export metrics', {
|
|
20
|
+
* code: 'PROMETHEUS_DESCRIPTOR_ERROR',
|
|
21
|
+
* cause: originalError,
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
constructor(message: string, options?: {
|
|
26
|
+
code?: string;
|
|
27
|
+
cause?: Error;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=prometheus.errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prometheus.errors.d.ts","sourceRoot":"","sources":["../../src/errors/prometheus.errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;;;;;;OAeG;gBAEF,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;KACT;CAOP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when a Prometheus exporter operation fails.
|
|
3
|
+
*/
|
|
4
|
+
export class PrometheusExportError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Error code for programmatic identification.
|
|
7
|
+
*/
|
|
8
|
+
Code;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new PrometheusExportError instance.
|
|
11
|
+
*
|
|
12
|
+
* @param message - The error message
|
|
13
|
+
* @param options - Configuration options
|
|
14
|
+
* @param options.code - Error code (default: 'PROMETHEUS_EXPORT_FAILED')
|
|
15
|
+
* @param options.cause - Original error that caused this error
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* throw new PrometheusExportError('Failed to export metrics', {
|
|
20
|
+
* code: 'PROMETHEUS_DESCRIPTOR_ERROR',
|
|
21
|
+
* cause: originalError,
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
constructor(message, options = {}) {
|
|
26
|
+
const { code = 'PROMETHEUS_EXPORT_FAILED', cause } = options;
|
|
27
|
+
super(message, cause !== undefined ? { cause } : undefined);
|
|
28
|
+
this.name = 'PrometheusExportError';
|
|
29
|
+
this.Code = code;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=prometheus.errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prometheus.errors.js","sourceRoot":"","sources":["../../src/errors/prometheus.errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC/C;;OAEG;IACa,IAAI,CAAS;IAE7B;;;;;;;;;;;;;;;OAeG;IACH,YACC,OAAe,EACf,UAGI,EAAE;QAEN,MAAM,EAAE,IAAI,GAAG,0BAA0B,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAC7D,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD"}
|
package/build/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
|
|
4
|
+
"version": "2.1.0",
|
|
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
|
|
43
|
+
"@pawells/nestjs-shared": "2.1.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=22.0.0"
|
|
@@ -96,6 +96,7 @@ export declare class PrometheusExporter implements IMetricsExporter {
|
|
|
96
96
|
* - `gauge` or `updown_counter` → Gauge (set via set())
|
|
97
97
|
*
|
|
98
98
|
* @param descriptor - The metric descriptor being registered
|
|
99
|
+
* @returns void
|
|
99
100
|
* @throws Error if descriptor type is not supported
|
|
100
101
|
*
|
|
101
102
|
* @example
|
|
@@ -122,6 +123,7 @@ export declare class PrometheusExporter implements IMetricsExporter {
|
|
|
122
123
|
* - If the metric descriptor was not registered first, a warning is logged and value is dropped
|
|
123
124
|
*
|
|
124
125
|
* @param value - The metric value to buffer
|
|
126
|
+
* @returns void
|
|
125
127
|
*
|
|
126
128
|
* @example
|
|
127
129
|
* ```typescript
|
|
@@ -175,7 +177,7 @@ export declare class PrometheusExporter implements IMetricsExporter {
|
|
|
175
177
|
*
|
|
176
178
|
* Called by PrometheusModule during application shutdown (onApplicationShutdown).
|
|
177
179
|
*
|
|
178
|
-
* @returns
|
|
180
|
+
* @returns void
|
|
179
181
|
*
|
|
180
182
|
* @example
|
|
181
183
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.exporter.d.ts","sourceRoot":"","sources":["../src/prometheus.exporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"prometheus.exporter.d.ts","sourceRoot":"","sources":["../src/prometheus.exporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBACa,kBAAmB,YAAW,gBAAgB;IAC1D;;;OAGG;IACH,SAAgB,kBAAkB,QAAQ;IAE1C;;OAEG;IACH,SAAgB,YAAY,QAAQ;IAEpC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IAEpC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmE;IAE/F;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IAEtD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmC;IAE/D;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAQ;IAEtD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEnC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAKhC;;;;;OAKG;;IAYH;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAkElE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAiBlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACU,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAqG1C;;;;;;;;;;;;;;;;OAgBG;IAEU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAMtC"}
|
|
@@ -11,6 +11,7 @@ var PrometheusExporter_1;
|
|
|
11
11
|
import { Injectable } from '@nestjs/common';
|
|
12
12
|
import { Counter, Gauge, Histogram, Registry, collectDefaultMetrics } from 'prom-client';
|
|
13
13
|
import { AppLogger, getErrorMessage } from '@pawells/nestjs-shared/common';
|
|
14
|
+
import { PrometheusExportError } from './errors/prometheus.errors.js';
|
|
14
15
|
/**
|
|
15
16
|
* Prometheus metrics exporter implementation
|
|
16
17
|
*
|
|
@@ -121,6 +122,7 @@ let PrometheusExporter = class PrometheusExporter {
|
|
|
121
122
|
* - `gauge` or `updown_counter` → Gauge (set via set())
|
|
122
123
|
*
|
|
123
124
|
* @param descriptor - The metric descriptor being registered
|
|
125
|
+
* @returns void
|
|
124
126
|
* @throws Error if descriptor type is not supported
|
|
125
127
|
*
|
|
126
128
|
* @example
|
|
@@ -183,7 +185,9 @@ let PrometheusExporter = class PrometheusExporter {
|
|
|
183
185
|
}
|
|
184
186
|
break;
|
|
185
187
|
default:
|
|
186
|
-
throw new
|
|
188
|
+
throw new PrometheusExportError(`Unsupported metric type "${type}" for descriptor "${name}"`, {
|
|
189
|
+
code: 'PROMETHEUS_UNSUPPORTED_TYPE',
|
|
190
|
+
});
|
|
187
191
|
}
|
|
188
192
|
this.Instruments.set(name, Instrument);
|
|
189
193
|
this.Pending.set(name, []);
|
|
@@ -200,6 +204,7 @@ let PrometheusExporter = class PrometheusExporter {
|
|
|
200
204
|
* - If the metric descriptor was not registered first, a warning is logged and value is dropped
|
|
201
205
|
*
|
|
202
206
|
* @param value - The metric value to buffer
|
|
207
|
+
* @returns void
|
|
203
208
|
*
|
|
204
209
|
* @example
|
|
205
210
|
* ```typescript
|
|
@@ -357,7 +362,7 @@ let PrometheusExporter = class PrometheusExporter {
|
|
|
357
362
|
*
|
|
358
363
|
* Called by PrometheusModule during application shutdown (onApplicationShutdown).
|
|
359
364
|
*
|
|
360
|
-
* @returns
|
|
365
|
+
* @returns void
|
|
361
366
|
*
|
|
362
367
|
* @example
|
|
363
368
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.exporter.js","sourceRoot":"","sources":["../src/prometheus.exporter.ts"],"names":[],"mapp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;IACH,yCAAyC;IAClC,KAAK,CAAC,QAAQ;QACpB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;;AA9WW,kBAAkB;IAD9B,UAAU,EAAE;;GACA,kBAAkB,CA+W9B"}
|
|
@@ -53,7 +53,7 @@ export declare class PrometheusModule implements OnModuleInit, OnApplicationShut
|
|
|
53
53
|
* export class AppModule {}
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
static
|
|
56
|
+
static forRoot(): DynamicModule;
|
|
57
57
|
constructor(exporter: PrometheusExporter, registry: InstrumentationRegistry);
|
|
58
58
|
/**
|
|
59
59
|
* Initialize the module and register the Prometheus exporter
|
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
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "NestJS Prometheus metrics module with endpoint controller",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./build/index.js",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"xss": ">=1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@pawells/nestjs-shared": "2.0
|
|
43
|
+
"@pawells/nestjs-shared": "2.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@nestjs/common": "^11.1.
|
|
47
|
-
"@nestjs/config": "^4.0.
|
|
48
|
-
"@nestjs/core": "^11.1.
|
|
46
|
+
"@nestjs/common": "^11.1.19",
|
|
47
|
+
"@nestjs/config": "^4.0.4",
|
|
48
|
+
"@nestjs/core": "^11.1.19",
|
|
49
49
|
"@nestjs/throttler": "^6.5.0",
|
|
50
50
|
"@opentelemetry/api": "^1.9.1",
|
|
51
51
|
"class-transformer": "^0.5.1",
|