@spinajs/metrics 2.0.46 → 2.0.48

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
@@ -1,11 +1,11 @@
1
- # `@spinajs/intl`
2
-
3
- > TODO: description
4
-
5
- ## Usage
6
-
7
- ```
8
- const intl = require('@spinajs/intl');
9
-
10
- // TODO: DEMONSTRATE API
11
- ```
1
+ # `@spinajs/intl`
2
+
3
+ > TODO: description
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ const intl = require('@spinajs/intl');
9
+
10
+ // TODO: DEMONSTRATE API
11
+ ```
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/config/metrics.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  // import * as bundle from 'express-prom-bundle';
2
+ export {};
2
3
  // module.exports = {
3
4
  // http: {
4
5
  // middlewares: [],
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/config/metrics.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,qBAAqB;AACrB,YAAY;AACZ,uBAAuB;AACvB,OAAO;AACP,KAAK"}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/config/metrics.ts"],"names":[],"mappings":"AAAA,iDAAiD;;AAEjD,qBAAqB;AACrB,YAAY;AACZ,uBAAuB;AACvB,OAAO;AACP,KAAK"}
@@ -7,3 +7,4 @@ export declare const counter: typeof client.Counter;
7
7
  export declare class MetricsBootstrapper extends Bootstrapper {
8
8
  bootstrap(): void;
9
9
  }
10
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/controllers/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,KAAK,qBAAe,CAAC;AAClC,eAAO,MAAM,SAAS,yBAAmB,CAAC;AAC1C,eAAO,MAAM,OAAO,uBAAiB,CAAC;AACtC,eAAO,MAAM,OAAO,uBAAiB,CAAC;AACtC,qBACa,mBAAoB,SAAQ,YAAY;IAC5C,SAAS,IAAI,IAAI;CAKzB"}
@@ -1,42 +1,16 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
6
  };
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.MetricsBootstrapper = exports.counter = exports.summary = exports.histogram = exports.gauge = void 0;
33
- const di_1 = require("@spinajs/di");
34
- const client = __importStar(require("prom-client"));
35
- exports.gauge = client.Gauge;
36
- exports.histogram = client.Histogram;
37
- exports.summary = client.Summary;
38
- exports.counter = client.Counter;
39
- let MetricsBootstrapper = class MetricsBootstrapper extends di_1.Bootstrapper {
7
+ import { Injectable, Bootstrapper } from '@spinajs/di';
8
+ import * as client from 'prom-client';
9
+ export const gauge = client.Gauge;
10
+ export const histogram = client.Histogram;
11
+ export const summary = client.Summary;
12
+ export const counter = client.Counter;
13
+ let MetricsBootstrapper = class MetricsBootstrapper extends Bootstrapper {
40
14
  bootstrap() {
41
15
  client.collectDefaultMetrics({
42
16
  labels: { NODE_APP_INSTANCE: process.env.NODE_APP_INSTANCE },
@@ -44,7 +18,7 @@ let MetricsBootstrapper = class MetricsBootstrapper extends di_1.Bootstrapper {
44
18
  }
45
19
  };
46
20
  MetricsBootstrapper = __decorate([
47
- (0, di_1.Injectable)(di_1.Bootstrapper)
21
+ Injectable(Bootstrapper)
48
22
  ], MetricsBootstrapper);
49
- exports.MetricsBootstrapper = MetricsBootstrapper;
23
+ export { MetricsBootstrapper };
50
24
  //# sourceMappingURL=metrics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/controllers/metrics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAuD;AACvD,oDAAsC;AAEzB,QAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,QAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACzB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AAEtC,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,iBAAY;IAC5C,SAAS;QACd,MAAM,CAAC,qBAAqB,CAAC;YAC3B,MAAM,EAAE,EAAE,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;SAC7D,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AANY,mBAAmB;IAD/B,IAAA,eAAU,EAAC,iBAAY,CAAC;GACZ,mBAAmB,CAM/B;AANY,kDAAmB"}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/controllers/metrics.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AAE/B,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,YAAY;IAC5C,SAAS;QACd,MAAM,CAAC,qBAAqB,CAAC;YAC3B,MAAM,EAAE,EAAE,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;SAC7D,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AANY,mBAAmB;IAD/B,UAAU,CAAC,YAAY,CAAC;GACZ,mBAAmB,CAM/B;SANY,mBAAmB"}
package/lib/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export declare class Metrics extends BaseController {
8
8
  getMetrics(): Promise<PrometheusResponse>;
9
9
  }
10
10
  export {};
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,cAAM,kBAAmB,SAAQ,QAAQ;;IAK1B,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ;CAIlE;AAED,qBACa,OAAQ,SAAQ,cAAc;IAE5B,UAAU;CAGxB"}
package/lib/index.js CHANGED
@@ -1,41 +1,15 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
6
  };
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
31
7
  var __metadata = (this && this.__metadata) || function (k, v) {
32
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33
9
  };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.Metrics = void 0;
36
- const http_1 = require("@spinajs/http");
37
- const client = __importStar(require("prom-client"));
38
- class PrometheusResponse extends http_1.Response {
10
+ import { BasePath, BaseController, Get, Response } from '@spinajs/http';
11
+ import * as client from 'prom-client';
12
+ class PrometheusResponse extends Response {
39
13
  constructor() {
40
14
  super(null);
41
15
  }
@@ -44,19 +18,19 @@ class PrometheusResponse extends http_1.Response {
44
18
  res.end(client.register.metrics());
45
19
  }
46
20
  }
47
- let Metrics = class Metrics extends http_1.BaseController {
21
+ let Metrics = class Metrics extends BaseController {
48
22
  async getMetrics() {
49
23
  return new PrometheusResponse();
50
24
  }
51
25
  };
52
26
  __decorate([
53
- (0, http_1.Get)(),
27
+ Get(),
54
28
  __metadata("design:type", Function),
55
29
  __metadata("design:paramtypes", []),
56
30
  __metadata("design:returntype", Promise)
57
31
  ], Metrics.prototype, "getMetrics", null);
58
32
  Metrics = __decorate([
59
- (0, http_1.BasePath)('metrics')
33
+ BasePath('metrics')
60
34
  ], Metrics);
61
- exports.Metrics = Metrics;
35
+ export { Metrics };
62
36
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAwE;AACxE,oDAAsC;AAGtC,MAAM,kBAAmB,SAAQ,eAAQ;IACvC;QACE,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,GAAqB;QAC/D,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;CACF;AAGD,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,qBAAc;IAElC,KAAK,CAAC,UAAU;QACrB,OAAO,IAAI,kBAAkB,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAHC;IADC,IAAA,UAAG,GAAE;;;;yCAGL;AAJU,OAAO;IADnB,IAAA,eAAQ,EAAC,SAAS,CAAC;GACP,OAAO,CAKnB;AALY,0BAAO"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAGtC,MAAM,kBAAmB,SAAQ,QAAQ;IACvC;QACE,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAAqB,EAAE,GAAqB;QAC/D,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;CACF;AAGM,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,cAAc;IAE5B,AAAN,KAAK,CAAC,UAAU;QACrB,OAAO,IAAI,kBAAkB,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAHc;IADZ,GAAG,EAAE;;;;yCAGL;AAJU,OAAO;IADnB,QAAQ,CAAC,SAAS,CAAC;GACP,OAAO,CAKnB;SALY,OAAO"}
package/package.json CHANGED
@@ -1,48 +1,51 @@
1
- {
2
- "name": "@spinajs/metrics",
3
- "version": "2.0.46",
4
- "description": "metrics integration for spinajs using prometheus",
5
- "main": "lib/index.js",
6
- "private": false,
7
- "scripts": {
8
- "build": "npm run clean && npm run compile",
9
- "compile": "tsc -p tsconfig.build.json",
10
- "clean": "",
11
- "test": "ts-mocha -p tsconfig.json test/**/*.test.ts",
12
- "coverage": "nyc npm run test",
13
- "build-docs": "rimraf docs && typedoc --options typedoc.json src/",
14
- "prepare": "npm run build",
15
- "format": "prettier --write \"src/**/*.ts\"",
16
- "lint": "eslint -c .eslintrc.js --ext .ts src --fix",
17
- "prepublishOnly": "npm test && npm run lint",
18
- "preversion": "npm run lint",
19
- "version": "npm run format && git add -A src",
20
- "postversion": "git push && git push --tags"
21
- },
22
- "files": [
23
- "lib/**/*"
24
- ],
25
- "types": "lib",
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/spinajs/main.git"
29
- },
30
- "keywords": [
31
- "spinajs",
32
- "intl"
33
- ],
34
- "author": "SpinaJS <spinajs@coderush.pl> (https://github.com/spinajs/main)",
35
- "license": "MIT",
36
- "bugs": {
37
- "url": "https://github.com/spinajs/main/issues"
38
- },
39
- "homepage": "https://github.com/spinajs/main#readme",
40
- "dependencies": {
41
- "@spinajs/di": "^2.0.46",
42
- "@spinajs/exceptions": "^2.0.39",
43
- "@spinajs/http": "^2.0.46",
44
- "express-prom-bundle": "^6.6.0",
45
- "prom-client": "^14.1.0"
46
- },
47
- "gitHead": "bd560afd6c9a156071102cc6b4f36115b5498e9d"
48
- }
1
+ {
2
+ "name": "@spinajs/metrics",
3
+ "version": "2.0.48",
4
+ "description": "metrics integration for spinajs using prometheus",
5
+ "exports": "./lib/index.js",
6
+ "type": "module",
7
+ "private": false,
8
+ "engines": {
9
+ "node": ">=16.11"
10
+ },
11
+ "scripts": {
12
+ "build": "npm run clean && npm run compile",
13
+ "compile": "tsc -b tsconfig.json",
14
+ "rimraf": "./node_modules/rimraf/bin.js",
15
+ "clean": "rimraf lib/ && rimraf tsconfig.tsbuildinfo",
16
+ "test": "ts-mocha -p tsconfig.json test/**/*.test.ts",
17
+ "coverage": "nyc npm run test",
18
+ "build-docs": "rimraf docs && typedoc --options typedoc.json src/",
19
+ "format": "prettier --write \"src/**/*.ts\"",
20
+ "lint": "eslint -c .eslintrc.cjs --ext .ts src --fix",
21
+ "preversion": "npm run lint",
22
+ "version": "npm run format && git add -A src",
23
+ "postinstall": "npm run build"
24
+ },
25
+ "files": [
26
+ "lib/**/*"
27
+ ],
28
+ "types": "lib",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/spinajs/main.git"
32
+ },
33
+ "keywords": [
34
+ "spinajs",
35
+ "intl"
36
+ ],
37
+ "author": "SpinaJS <spinajs@coderush.pl> (https://github.com/spinajs/main)",
38
+ "license": "MIT",
39
+ "bugs": {
40
+ "url": "https://github.com/spinajs/main/issues"
41
+ },
42
+ "homepage": "https://github.com/spinajs/main#readme",
43
+ "dependencies": {
44
+ "@spinajs/di": "^2.0.46",
45
+ "@spinajs/exceptions": "^2.0.39",
46
+ "@spinajs/http": "^2.0.46",
47
+ "express-prom-bundle": "^6.6.0",
48
+ "prom-client": "^14.1.1"
49
+ },
50
+ "gitHead": "b7a2a772723957f74e97698aae2610c22c7c803e"
51
+ }