@tryghost/prometheus-metrics 4.1.14 → 5.0.1

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
@@ -8,6 +8,21 @@ Prometheus metrics integration for exposing Ghost runtime counters, gauges, and
8
8
 
9
9
  ## Usage
10
10
 
11
+ Import the metrics client from the package root:
12
+
13
+ ```ts
14
+ import { PrometheusClient } from '@tryghost/prometheus-metrics';
15
+ ```
16
+
17
+ The standalone server is available separately:
18
+
19
+ ```ts
20
+ import { MetricsServer } from '@tryghost/prometheus-metrics/server';
21
+ ```
22
+
23
+ Install Express 4 or 5 in your application when using `MetricsServer`. Express is
24
+ an optional peer dependency and is not loaded by the package root.
25
+
11
26
  ## Develop
12
27
 
13
28
  This is a monorepo package.
@@ -1,4 +1,4 @@
1
- import { Request, Response } from 'express';
1
+ import type { Request, Response } from 'express';
2
2
  import client from 'prom-client';
3
3
  import type { Metric, MetricObjectWithValues, MetricValue } from 'prom-client';
4
4
  import type { Knex } from 'knex';
package/build/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export * from './MetricsServer';
2
1
  export * from './PrometheusClient';
package/build/index.js CHANGED
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./MetricsServer"), exports);
18
17
  __exportStar(require("./PrometheusClient"), exports);
@@ -0,0 +1 @@
1
+ export * from './MetricsServer';
@@ -0,0 +1,17 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MetricsServer"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/prometheus-metrics",
3
- "version": "4.1.14",
3
+ "version": "5.0.1",
4
4
  "author": "Ghost Foundation",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,28 +12,53 @@
12
12
  ],
13
13
  "main": "build/index.js",
14
14
  "types": "build/index.d.ts",
15
+ "typesVersions": {
16
+ "*": {
17
+ "server": [
18
+ "build/server.d.ts"
19
+ ]
20
+ }
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "types": "./build/index.d.ts",
25
+ "default": "./build/index.js"
26
+ },
27
+ "./server": {
28
+ "types": "./build/server.d.ts",
29
+ "default": "./build/server.js"
30
+ }
31
+ },
15
32
  "publishConfig": {
16
33
  "access": "public"
17
34
  },
18
35
  "dependencies": {
19
- "@tryghost/debug": "^2.3.13",
20
- "@tryghost/logging": "^5.4.4",
21
- "express": "^5.2.1",
36
+ "@tryghost/debug": "^2.3.15",
37
+ "@tryghost/logging": "^5.4.6",
22
38
  "prom-client": "^15.1.3",
23
39
  "stoppable": "^1.1.0"
24
40
  },
25
41
  "devDependencies": {
26
42
  "@types/express": "5.0.6",
27
- "@types/node": "24.13.3",
43
+ "@types/node": "24.19.0",
28
44
  "@types/sinon": "22.0.0",
29
45
  "@types/stoppable": "1.1.3",
30
46
  "@types/supertest": "7.2.1",
47
+ "express": "5.2.1",
31
48
  "knex": "3.3.0",
32
49
  "nock": "14.0.17",
33
50
  "sinon": "22.1.0",
34
- "supertest": "7.2.2",
51
+ "supertest": "7.3.0",
35
52
  "typescript": "7.0.2"
36
53
  },
54
+ "peerDependencies": {
55
+ "express": "^4.0.0 || ^5.0.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "express": {
59
+ "optional": true
60
+ }
61
+ },
37
62
  "scripts": {
38
63
  "dev": "tsc --watch --preserveWatchOutput --sourceMap",
39
64
  "build": "pnpm run build:ts",