@promster/metrics 15.4.4 → 15.4.5

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.
@@ -123,7 +123,7 @@ const getMetrics$1 = options => ({
123
123
  return new Prometheus__namespace.Histogram({
124
124
  name: `${options.metricPrefix}${nameOfGraphQlParseDuration}`,
125
125
  help: 'The GraphQL request parse time in seconds.',
126
- labelNames: defaultLabels$1.concat(options.labels).sort(),
126
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
127
127
  buckets: ((_options$metricPercen = options.metricPercentiles) === null || _options$metricPercen === void 0 ? void 0 : _options$metricPercen.graphQlParseDuration) || defaultGraphQlPercentiles
128
128
  });
129
129
  }) : undefined,
@@ -132,7 +132,7 @@ const getMetrics$1 = options => ({
132
132
  return new Prometheus__namespace.Histogram({
133
133
  name: `${options.metricPrefix}${nameOfGraphQlValidationDuration}`,
134
134
  help: 'The GraphQL request validation time in seconds.',
135
- labelNames: defaultLabels$1.concat(options.labels).sort(),
135
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
136
136
  buckets: ((_options$metricPercen2 = options.metricPercentiles) === null || _options$metricPercen2 === void 0 ? void 0 : _options$metricPercen2.graphQlValidationDuration) || defaultGraphQlPercentiles
137
137
  });
138
138
  }) : undefined,
@@ -141,7 +141,7 @@ const getMetrics$1 = options => ({
141
141
  return new Prometheus__namespace.Histogram({
142
142
  name: `${options.metricPrefix}${nameOfGraphQlResolveFieldDuration}`,
143
143
  help: 'The GraphQL field resolving time in seconds.',
144
- labelNames: defaultLabels$1.concat(['field_name']).concat(options.labels).sort(),
144
+ labelNames: defaultLabels$1.concat(['field_name']).concat(options.labels).toSorted(),
145
145
  buckets: ((_options$metricPercen3 = options.metricPercentiles) === null || _options$metricPercen3 === void 0 ? void 0 : _options$metricPercen3.graphQlResolveFieldDuration) || defaultGraphQlPercentiles
146
146
  });
147
147
  }) : undefined,
@@ -150,14 +150,14 @@ const getMetrics$1 = options => ({
150
150
  return new Prometheus__namespace.Histogram({
151
151
  name: `${options.metricPrefix}${nameOfGraphQlRequestDuration}`,
152
152
  help: 'The GraphQL request duration time in seconds.',
153
- labelNames: defaultLabels$1.concat(options.labels).sort(),
153
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
154
154
  buckets: ((_options$metricPercen4 = options.metricPercentiles) === null || _options$metricPercen4 === void 0 ? void 0 : _options$metricPercen4.graphQlRequestDuration) || defaultGraphQlPercentiles
155
155
  });
156
156
  }) : undefined,
157
157
  graphQlErrorsTotal: shouldObserveGraphQlErrorsTotalAsCounter(options) ? asArray$1(options.metricNames.graphQlErrorsTotal).map(nameOfGraphQlErrorsCount => new Prometheus__namespace.Counter({
158
158
  name: `${options.metricPrefix}${nameOfGraphQlErrorsCount}`,
159
159
  help: 'Count of errors while parsing, validating, or executing a GraphQL operation.',
160
- labelNames: defaultLabels$1.concat(['phase']).concat(options.labels).sort()
160
+ labelNames: defaultLabels$1.concat(['phase']).concat(options.labels).toSorted()
161
161
  })) : undefined
162
162
  });
163
163
  const createGraphQlMetrics = options => {
@@ -206,7 +206,7 @@ const getMetrics = options => ({
206
206
  return new Prometheus__namespace.Histogram({
207
207
  name: `${options.metricPrefix}${nameOfHttpContentLengthMetric}`,
208
208
  help: 'The HTTP request content length in bytes.',
209
- labelNames: defaultLabels.concat(options.labels).sort(),
209
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
210
210
  buckets: ((_options$metricBucket = options.metricBuckets) === null || _options$metricBucket === void 0 ? void 0 : _options$metricBucket.httpRequestContentLengthInBytes) || defaultHttpContentLengthInBytes
211
211
  });
212
212
  }) : undefined,
@@ -215,7 +215,7 @@ const getMetrics = options => ({
215
215
  return new Prometheus__namespace.Histogram({
216
216
  name: `${options.metricPrefix}${nameOfHttpContentLengthMetric}`,
217
217
  help: 'The HTTP response content length in bytes.',
218
- labelNames: defaultLabels.concat(options.labels).sort(),
218
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
219
219
  buckets: ((_options$metricBucket2 = options.metricBuckets) === null || _options$metricBucket2 === void 0 ? void 0 : _options$metricBucket2.httpResponseContentLengthInBytes) || defaultHttpContentLengthInBytes
220
220
  });
221
221
  }) : undefined
@@ -226,7 +226,7 @@ const getHttpRequestLatencyMetricsInSeconds = options => ({
226
226
  return new Prometheus__namespace.Summary({
227
227
  name: `${options.metricPrefix}${nameOfHttpRequestDurationPerPercentileInSeconds}`,
228
228
  help: 'The HTTP request latencies in seconds.',
229
- labelNames: defaultLabels.concat(options.labels).sort(),
229
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
230
230
  percentiles: ((_options$metricPercen = options.metricPercentiles) === null || _options$metricPercen === void 0 ? void 0 : _options$metricPercen.httpRequestDurationPerPercentileInSeconds) || defaultHttpRequestDurationPercentileInSeconds
231
231
  });
232
232
  }) : undefined,
@@ -235,7 +235,7 @@ const getHttpRequestLatencyMetricsInSeconds = options => ({
235
235
  return new Prometheus__namespace.Histogram({
236
236
  name: `${options.metricPrefix}${nameOfHttpRequestDurationInSecondsMetric}`,
237
237
  help: 'The HTTP request latencies in seconds.',
238
- labelNames: defaultLabels.concat(options.labels).sort(),
238
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
239
239
  buckets: ((_options$metricBucket3 = options.metricBuckets) === null || _options$metricBucket3 === void 0 ? void 0 : _options$metricBucket3.httpRequestDurationInSeconds) || defaultHttpRequestDurationInSeconds
240
240
  });
241
241
  }) : undefined
@@ -244,7 +244,7 @@ const getHttpRequestCounterMetric = options => ({
244
244
  httpRequestsTotal: shouldObserveHttpRequestsAsCounter(options) ? asArray(options.metricNames.httpRequestsTotal).map(nameOfHttpRequestsTotalMetric => new Prometheus__namespace.Counter({
245
245
  name: `${options.metricPrefix}${nameOfHttpRequestsTotalMetric}`,
246
246
  help: 'The total HTTP requests.',
247
- labelNames: defaultLabels.concat(options.labels).sort()
247
+ labelNames: defaultLabels.concat(options.labels).toSorted()
248
248
  })) : undefined
249
249
  });
250
250
  const createHttpMetrics = options => {
@@ -268,7 +268,7 @@ function endMeasurementFrom(start) {
268
268
  }
269
269
 
270
270
  function sortLabels(unsortedLabels) {
271
- return Object.keys(unsortedLabels).sort((a, b) => {
271
+ return Object.keys(unsortedLabels).toSorted((a, b) => {
272
272
  if (a < b) {
273
273
  return -1;
274
274
  }
@@ -123,7 +123,7 @@ const getMetrics$1 = options => ({
123
123
  return new Prometheus__namespace.Histogram({
124
124
  name: `${options.metricPrefix}${nameOfGraphQlParseDuration}`,
125
125
  help: 'The GraphQL request parse time in seconds.',
126
- labelNames: defaultLabels$1.concat(options.labels).sort(),
126
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
127
127
  buckets: ((_options$metricPercen = options.metricPercentiles) === null || _options$metricPercen === void 0 ? void 0 : _options$metricPercen.graphQlParseDuration) || defaultGraphQlPercentiles
128
128
  });
129
129
  }) : undefined,
@@ -132,7 +132,7 @@ const getMetrics$1 = options => ({
132
132
  return new Prometheus__namespace.Histogram({
133
133
  name: `${options.metricPrefix}${nameOfGraphQlValidationDuration}`,
134
134
  help: 'The GraphQL request validation time in seconds.',
135
- labelNames: defaultLabels$1.concat(options.labels).sort(),
135
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
136
136
  buckets: ((_options$metricPercen2 = options.metricPercentiles) === null || _options$metricPercen2 === void 0 ? void 0 : _options$metricPercen2.graphQlValidationDuration) || defaultGraphQlPercentiles
137
137
  });
138
138
  }) : undefined,
@@ -141,7 +141,7 @@ const getMetrics$1 = options => ({
141
141
  return new Prometheus__namespace.Histogram({
142
142
  name: `${options.metricPrefix}${nameOfGraphQlResolveFieldDuration}`,
143
143
  help: 'The GraphQL field resolving time in seconds.',
144
- labelNames: defaultLabels$1.concat(['field_name']).concat(options.labels).sort(),
144
+ labelNames: defaultLabels$1.concat(['field_name']).concat(options.labels).toSorted(),
145
145
  buckets: ((_options$metricPercen3 = options.metricPercentiles) === null || _options$metricPercen3 === void 0 ? void 0 : _options$metricPercen3.graphQlResolveFieldDuration) || defaultGraphQlPercentiles
146
146
  });
147
147
  }) : undefined,
@@ -150,14 +150,14 @@ const getMetrics$1 = options => ({
150
150
  return new Prometheus__namespace.Histogram({
151
151
  name: `${options.metricPrefix}${nameOfGraphQlRequestDuration}`,
152
152
  help: 'The GraphQL request duration time in seconds.',
153
- labelNames: defaultLabels$1.concat(options.labels).sort(),
153
+ labelNames: defaultLabels$1.concat(options.labels).toSorted(),
154
154
  buckets: ((_options$metricPercen4 = options.metricPercentiles) === null || _options$metricPercen4 === void 0 ? void 0 : _options$metricPercen4.graphQlRequestDuration) || defaultGraphQlPercentiles
155
155
  });
156
156
  }) : undefined,
157
157
  graphQlErrorsTotal: shouldObserveGraphQlErrorsTotalAsCounter(options) ? asArray$1(options.metricNames.graphQlErrorsTotal).map(nameOfGraphQlErrorsCount => new Prometheus__namespace.Counter({
158
158
  name: `${options.metricPrefix}${nameOfGraphQlErrorsCount}`,
159
159
  help: 'Count of errors while parsing, validating, or executing a GraphQL operation.',
160
- labelNames: defaultLabels$1.concat(['phase']).concat(options.labels).sort()
160
+ labelNames: defaultLabels$1.concat(['phase']).concat(options.labels).toSorted()
161
161
  })) : undefined
162
162
  });
163
163
  const createGraphQlMetrics = options => {
@@ -206,7 +206,7 @@ const getMetrics = options => ({
206
206
  return new Prometheus__namespace.Histogram({
207
207
  name: `${options.metricPrefix}${nameOfHttpContentLengthMetric}`,
208
208
  help: 'The HTTP request content length in bytes.',
209
- labelNames: defaultLabels.concat(options.labels).sort(),
209
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
210
210
  buckets: ((_options$metricBucket = options.metricBuckets) === null || _options$metricBucket === void 0 ? void 0 : _options$metricBucket.httpRequestContentLengthInBytes) || defaultHttpContentLengthInBytes
211
211
  });
212
212
  }) : undefined,
@@ -215,7 +215,7 @@ const getMetrics = options => ({
215
215
  return new Prometheus__namespace.Histogram({
216
216
  name: `${options.metricPrefix}${nameOfHttpContentLengthMetric}`,
217
217
  help: 'The HTTP response content length in bytes.',
218
- labelNames: defaultLabels.concat(options.labels).sort(),
218
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
219
219
  buckets: ((_options$metricBucket2 = options.metricBuckets) === null || _options$metricBucket2 === void 0 ? void 0 : _options$metricBucket2.httpResponseContentLengthInBytes) || defaultHttpContentLengthInBytes
220
220
  });
221
221
  }) : undefined
@@ -226,7 +226,7 @@ const getHttpRequestLatencyMetricsInSeconds = options => ({
226
226
  return new Prometheus__namespace.Summary({
227
227
  name: `${options.metricPrefix}${nameOfHttpRequestDurationPerPercentileInSeconds}`,
228
228
  help: 'The HTTP request latencies in seconds.',
229
- labelNames: defaultLabels.concat(options.labels).sort(),
229
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
230
230
  percentiles: ((_options$metricPercen = options.metricPercentiles) === null || _options$metricPercen === void 0 ? void 0 : _options$metricPercen.httpRequestDurationPerPercentileInSeconds) || defaultHttpRequestDurationPercentileInSeconds
231
231
  });
232
232
  }) : undefined,
@@ -235,7 +235,7 @@ const getHttpRequestLatencyMetricsInSeconds = options => ({
235
235
  return new Prometheus__namespace.Histogram({
236
236
  name: `${options.metricPrefix}${nameOfHttpRequestDurationInSecondsMetric}`,
237
237
  help: 'The HTTP request latencies in seconds.',
238
- labelNames: defaultLabels.concat(options.labels).sort(),
238
+ labelNames: defaultLabels.concat(options.labels).toSorted(),
239
239
  buckets: ((_options$metricBucket3 = options.metricBuckets) === null || _options$metricBucket3 === void 0 ? void 0 : _options$metricBucket3.httpRequestDurationInSeconds) || defaultHttpRequestDurationInSeconds
240
240
  });
241
241
  }) : undefined
@@ -244,7 +244,7 @@ const getHttpRequestCounterMetric = options => ({
244
244
  httpRequestsTotal: shouldObserveHttpRequestsAsCounter(options) ? asArray(options.metricNames.httpRequestsTotal).map(nameOfHttpRequestsTotalMetric => new Prometheus__namespace.Counter({
245
245
  name: `${options.metricPrefix}${nameOfHttpRequestsTotalMetric}`,
246
246
  help: 'The total HTTP requests.',
247
- labelNames: defaultLabels.concat(options.labels).sort()
247
+ labelNames: defaultLabels.concat(options.labels).toSorted()
248
248
  })) : undefined
249
249
  });
250
250
  const createHttpMetrics = options => {
@@ -268,7 +268,7 @@ function endMeasurementFrom(start) {
268
268
  }
269
269
 
270
270
  function sortLabels(unsortedLabels) {
271
- return Object.keys(unsortedLabels).sort((a, b) => {
271
+ return Object.keys(unsortedLabels).toSorted((a, b) => {
272
272
  if (a < b) {
273
273
  return -1;
274
274
  }
package/package.json CHANGED
@@ -1,10 +1,23 @@
1
1
  {
2
2
  "name": "@promster/metrics",
3
- "version": "15.4.4",
3
+ "version": "15.4.5",
4
4
  "description": "Metrics utilities used by all other server integrations",
5
- "main": "dist/promster-metrics.cjs.js",
6
- "typings": "dist/promster-metrics.cjs.d.ts",
7
- "types": "dist/promster-metrics.cjs.d.ts",
5
+ "keywords": [
6
+ "continousdelivery",
7
+ "metrics",
8
+ "prometheus"
9
+ ],
10
+ "homepage": "https://github.com/tdeekens/promster#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/tdeekens/promster/issues"
13
+ },
14
+ "license": "MIT",
15
+ "author": "Tobias Deekens <nerd@tdeekens.name>",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/tdeekens/promster.git",
19
+ "directory": "packages/metrics"
20
+ },
8
21
  "files": [
9
22
  "readme.md",
10
23
  "package.json",
@@ -12,34 +25,17 @@
12
25
  "dist/**",
13
26
  "modules/**"
14
27
  ],
28
+ "main": "dist/promster-metrics.cjs.js",
29
+ "types": "dist/promster-metrics.cjs.d.ts",
30
+ "typings": "dist/promster-metrics.cjs.d.ts",
15
31
  "publishConfig": {
16
32
  "access": "public"
17
33
  },
18
- "engines": {
19
- "node": ">=20",
20
- "npm": ">=8"
21
- },
22
- "repository": {
23
- "type": "git",
24
- "url": "https://github.com/tdeekens/promster.git",
25
- "directory": "packages/metrics"
26
- },
27
- "author": "Tobias Deekens <nerd@tdeekens.name>",
28
- "license": "MIT",
29
- "bugs": {
30
- "url": "https://github.com/tdeekens/promster/issues"
31
- },
32
- "homepage": "https://github.com/tdeekens/promster#readme",
33
- "keywords": [
34
- "metrics",
35
- "continousdelivery",
36
- "prometheus"
37
- ],
38
34
  "dependencies": {
35
+ "@chainsafe/prometheus-gc-stats": "1.0.2",
39
36
  "lodash.memoize": "4.1.2",
40
37
  "lodash.once": "4.1.1",
41
38
  "merge-options": "3.0.4",
42
- "@chainsafe/prometheus-gc-stats": "1.0.2",
43
39
  "tslib": "2.8.1",
44
40
  "url-value-parser": "2.2.0"
45
41
  },
@@ -48,9 +44,13 @@
48
44
  "@types/node": "24.10.13",
49
45
  "prom-client": "15.1.3",
50
46
  "typescript": "5.9.3",
51
- "@promster/types": "15.4.4"
47
+ "@promster/types": "15.4.5"
52
48
  },
53
49
  "peerDependencies": {
54
50
  "prom-client": "13.x.x || 14.x || 15.x"
51
+ },
52
+ "engines": {
53
+ "node": ">=20",
54
+ "npm": ">=8"
55
55
  }
56
56
  }