@promster/types 3.2.3 → 3.2.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.
- package/dist/declarations/src/index.d.ts +25 -25
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DeepRequired } from 'ts-essentials';
|
|
2
|
-
import { Gauge, Counter, Summary, Histogram } from 'prom-client';
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
import type { Gauge, Counter, Summary, Histogram } from 'prom-client';
|
|
3
|
+
export type TLabelValues = Record<string, string | number>;
|
|
4
|
+
type TContext<Q, S> = {
|
|
5
5
|
req: Q;
|
|
6
6
|
res: S;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type TPromsterOptions = {
|
|
9
9
|
labels?: string[];
|
|
10
10
|
metricPrefix?: string;
|
|
11
11
|
metricTypes?: string[];
|
|
@@ -15,31 +15,31 @@ export declare type TPromsterOptions = {
|
|
|
15
15
|
normalizeMethod?: <Q, S>(method: string, context: TContext<Q, S>) => string;
|
|
16
16
|
getLabelValues?: <Q, S>(request: Q, response: S) => TLabelValues;
|
|
17
17
|
detectKubernetes?: boolean;
|
|
18
|
-
buckets?: [
|
|
19
|
-
percentiles?: [
|
|
18
|
+
buckets?: number[];
|
|
19
|
+
percentiles?: number[];
|
|
20
20
|
skip?: <Q, S>(request: Q, response: S, labels: TLabelValues) => boolean;
|
|
21
21
|
disableGcMetrics?: boolean;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
httpRequestDurationPerPercentileInSeconds?:
|
|
26
|
-
httpRequestDurationInSeconds?:
|
|
27
|
-
httpRequestsTotal?:
|
|
28
|
-
httpRequestContentLengthInBytes?:
|
|
29
|
-
httpResponseContentLengthInBytes?:
|
|
23
|
+
export type TDefaultedPromsterOptions = DeepRequired<TPromsterOptions>;
|
|
24
|
+
export type THttpMetrics = {
|
|
25
|
+
httpRequestDurationPerPercentileInSeconds?: Summary[];
|
|
26
|
+
httpRequestDurationInSeconds?: Histogram[];
|
|
27
|
+
httpRequestsTotal?: Counter[];
|
|
28
|
+
httpRequestContentLengthInBytes?: Histogram[];
|
|
29
|
+
httpResponseContentLengthInBytes?: Histogram[];
|
|
30
30
|
};
|
|
31
|
-
export
|
|
32
|
-
up:
|
|
33
|
-
countOfGcs:
|
|
34
|
-
durationOfGc:
|
|
35
|
-
reclaimedInGc:
|
|
31
|
+
export type TGcMetrics = {
|
|
32
|
+
up: Gauge[];
|
|
33
|
+
countOfGcs: Counter[];
|
|
34
|
+
durationOfGc: Counter[];
|
|
35
|
+
reclaimedInGc: Counter[];
|
|
36
36
|
};
|
|
37
|
-
export
|
|
38
|
-
graphQlParseDuration?:
|
|
39
|
-
graphQlValidationDuration?:
|
|
40
|
-
graphQlResolveFieldDuration?:
|
|
41
|
-
graphQlRequestDuration?:
|
|
42
|
-
graphQlErrorsTotal?:
|
|
37
|
+
export type TGraphQlMetrics = {
|
|
38
|
+
graphQlParseDuration?: Histogram[];
|
|
39
|
+
graphQlValidationDuration?: Histogram[];
|
|
40
|
+
graphQlResolveFieldDuration?: Histogram[];
|
|
41
|
+
graphQlRequestDuration?: Histogram[];
|
|
42
|
+
graphQlErrorsTotal?: Counter[];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type TValueOf<T> = T[keyof T];
|
|
45
45
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promster/types",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "Shared types of promster",
|
|
5
5
|
"main": "dist/promster-types.cjs.js",
|
|
6
6
|
"typings": "dist/promster-types.cjs.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prometheus"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"prom-client": "14.0
|
|
38
|
+
"prom-client": "14.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"prom-client": "13.x.x || 14.x"
|