@promster/metrics 15.5.1 → 15.6.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/dist/index.cjs +411 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +154 -0
- package/dist/index.d.ts +154 -0
- package/dist/index.js +358 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -10
- package/dist/declarations/src/client/client.d.ts +0 -9
- package/dist/declarations/src/client/index.d.ts +0 -2
- package/dist/declarations/src/create-gc-metrics/create-gc-metrics.d.ts +0 -14
- package/dist/declarations/src/create-gc-metrics/index.d.ts +0 -2
- package/dist/declarations/src/create-gc-observer/create-gc-observer.d.ts +0 -3
- package/dist/declarations/src/create-gc-observer/index.d.ts +0 -2
- package/dist/declarations/src/create-graphql-metrics/create-graphql-metrics.d.ts +0 -25
- package/dist/declarations/src/create-graphql-metrics/index.d.ts +0 -2
- package/dist/declarations/src/create-http-metrics/create-http-metrics.d.ts +0 -26
- package/dist/declarations/src/create-http-metrics/index.d.ts +0 -2
- package/dist/declarations/src/create-request-recorder/create-request-recorder.d.ts +0 -16
- package/dist/declarations/src/create-request-recorder/index.d.ts +0 -3
- package/dist/declarations/src/end-measurement-from/end-measurement-from.d.ts +0 -4
- package/dist/declarations/src/end-measurement-from/index.d.ts +0 -2
- package/dist/declarations/src/environment/index.d.ts +0 -3
- package/dist/declarations/src/environment/kubernetes.d.ts +0 -2
- package/dist/declarations/src/environment/skip-metrics-in-environment.d.ts +0 -6
- package/dist/declarations/src/index.d.ts +0 -16
- package/dist/declarations/src/normalizers/index.d.ts +0 -9
- package/dist/declarations/src/normalizers/method/index.d.ts +0 -2
- package/dist/declarations/src/normalizers/method/method.d.ts +0 -2
- package/dist/declarations/src/normalizers/path/index.d.ts +0 -2
- package/dist/declarations/src/normalizers/path/path.d.ts +0 -2
- package/dist/declarations/src/normalizers/status-code/index.d.ts +0 -2
- package/dist/declarations/src/normalizers/status-code/status-code.d.ts +0 -2
- package/dist/declarations/src/sort-labels/index.d.ts +0 -2
- package/dist/declarations/src/sort-labels/sort-labels.d.ts +0 -3
- package/dist/declarations/src/summary/index.d.ts +0 -2
- package/dist/declarations/src/summary/summary.d.ts +0 -3
- package/dist/declarations/src/timing/index.d.ts +0 -2
- package/dist/declarations/src/timing/timing.d.ts +0 -17
- package/dist/promster-metrics.cjs.d.ts +0 -2
- package/dist/promster-metrics.cjs.dev.js +0 -409
- package/dist/promster-metrics.cjs.js +0 -7
- package/dist/promster-metrics.cjs.prod.js +0 -409
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PrometheusContentType } from 'prom-client';
|
|
2
|
-
import * as Prometheus from 'prom-client';
|
|
3
|
-
declare const defaultRegister: Prometheus.Registry<"text/plain; version=0.0.4; charset=utf-8">;
|
|
4
|
-
interface TClientOptions extends Prometheus.DefaultMetricsCollectorConfiguration<PrometheusContentType> {
|
|
5
|
-
detectKubernetes?: boolean;
|
|
6
|
-
prefix?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const configure: (options: TClientOptions) => void;
|
|
9
|
-
export { Prometheus, defaultRegister, configure };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TDefaultedPromsterOptions, TGcMetrics } from '@promster/types';
|
|
2
|
-
declare const createGcMetrics: {
|
|
3
|
-
(options: TDefaultedPromsterOptions): TGcMetrics;
|
|
4
|
-
defaultOptions: {
|
|
5
|
-
getLabelValues: () => {};
|
|
6
|
-
labels: never[];
|
|
7
|
-
metricPrefix: string;
|
|
8
|
-
metricNames: {
|
|
9
|
-
up: string[];
|
|
10
|
-
};
|
|
11
|
-
gcCollectionInterval: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export { createGcMetrics };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { TDefaultedPromsterOptions, TGraphQlMetrics } from '@promster/types';
|
|
2
|
-
declare const createGraphQlMetrics: {
|
|
3
|
-
(options: TDefaultedPromsterOptions): TGraphQlMetrics;
|
|
4
|
-
defaultOptions: {
|
|
5
|
-
getLabelValues: () => {};
|
|
6
|
-
labels: never[];
|
|
7
|
-
metricPrefix: string;
|
|
8
|
-
metricTypes: string[];
|
|
9
|
-
metricNames: {
|
|
10
|
-
graphQlParseDuration: string[];
|
|
11
|
-
graphQlValidationDuration: string[];
|
|
12
|
-
graphQlResolveFieldDuration: string[];
|
|
13
|
-
graphQlRequestDuration: string[];
|
|
14
|
-
graphQlErrorsTotal: string[];
|
|
15
|
-
};
|
|
16
|
-
metricPercentiles: {
|
|
17
|
-
graphQlParseDuration: number[];
|
|
18
|
-
graphQlValidationDuration: number[];
|
|
19
|
-
graphQlResolveFieldDuration: number[];
|
|
20
|
-
graphQlRequestDuration: number[];
|
|
21
|
-
graphQlErrorsTotal: number[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export { createGraphQlMetrics };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { TDefaultedPromsterOptions, THttpMetrics } from '@promster/types';
|
|
2
|
-
declare const createHttpMetrics: {
|
|
3
|
-
(options: TDefaultedPromsterOptions): THttpMetrics;
|
|
4
|
-
defaultOptions: {
|
|
5
|
-
getLabelValues: () => {};
|
|
6
|
-
labels: never[];
|
|
7
|
-
metricPrefix: string;
|
|
8
|
-
metricTypes: string[];
|
|
9
|
-
metricNames: {
|
|
10
|
-
httpRequestsTotal: string[];
|
|
11
|
-
httpRequestDurationPerPercentileInSeconds: string[];
|
|
12
|
-
httpRequestDurationInSeconds: string[];
|
|
13
|
-
httpRequestContentLengthInBytes: string[];
|
|
14
|
-
httpResponseContentLengthInBytes: string[];
|
|
15
|
-
};
|
|
16
|
-
metricBuckets: {
|
|
17
|
-
httpRequestContentLengthInBytes: number[];
|
|
18
|
-
httpRequestDurationInSeconds: number[];
|
|
19
|
-
};
|
|
20
|
-
metricPercentiles: {
|
|
21
|
-
httpRequestDurationPerPercentileInSeconds: number[];
|
|
22
|
-
httpResponseContentLengthInBytes: number[];
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export { createHttpMetrics };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { THttpMetrics, TLabelValues, TOptionalPromsterOptions } from '@promster/types';
|
|
2
|
-
import { endMeasurementFrom } from "../end-measurement-from/index.js";
|
|
3
|
-
import { sortLabels } from "../sort-labels/index.js";
|
|
4
|
-
import type { Timing } from "../timing/index.js";
|
|
5
|
-
type TRecordingOptions = {
|
|
6
|
-
labels: TLabelValues;
|
|
7
|
-
requestContentLength?: number;
|
|
8
|
-
responseContentLength?: number;
|
|
9
|
-
};
|
|
10
|
-
type TLegacyTiming = [number, number];
|
|
11
|
-
export type TRequestRecorder = (_timing: Timing | TLegacyTiming, _recordingOptions: TRecordingOptions) => void;
|
|
12
|
-
declare const createRequestRecorder: {
|
|
13
|
-
(metrics: THttpMetrics, options?: TOptionalPromsterOptions): TRequestRecorder;
|
|
14
|
-
defaultOptions: TOptionalPromsterOptions;
|
|
15
|
-
};
|
|
16
|
-
export { createRequestRecorder, sortLabels, endMeasurementFrom };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TOptionalPromsterOptions } from '@promster/types';
|
|
2
|
-
type TSkipMetricsInEnvironmentOptions = {
|
|
3
|
-
detectKubernetes?: TOptionalPromsterOptions['detectKubernetes'];
|
|
4
|
-
};
|
|
5
|
-
declare const skipMetricsInEnvironment: (options: TSkipMetricsInEnvironmentOptions) => boolean;
|
|
6
|
-
export { skipMetricsInEnvironment };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defaultRegister, Prometheus } from "./client/index.js";
|
|
2
|
-
import { createGcMetrics } from "./create-gc-metrics/index.js";
|
|
3
|
-
import { createGcObserver } from "./create-gc-observer/index.js";
|
|
4
|
-
import { createGraphQlMetrics } from "./create-graphql-metrics/index.js";
|
|
5
|
-
import { createHttpMetrics } from "./create-http-metrics/index.js";
|
|
6
|
-
import { createRequestRecorder } from "./create-request-recorder/index.js";
|
|
7
|
-
import { endMeasurementFrom } from "./end-measurement-from/index.js";
|
|
8
|
-
import { isRunningInKubernetes, skipMetricsInEnvironment } from "./environment/index.js";
|
|
9
|
-
import { defaultNormalizers, normalizeMethod, normalizePath, normalizeStatusCode } from "./normalizers/index.js";
|
|
10
|
-
import { sortLabels } from "./sort-labels/index.js";
|
|
11
|
-
import { getContentType, getSummary } from "./summary/index.js";
|
|
12
|
-
import { timing } from "./timing/index.js";
|
|
13
|
-
export type { TRequestRecorder } from "./create-request-recorder/index.js";
|
|
14
|
-
export type { Timing as TPromsterTiming } from "./timing/index.js";
|
|
15
|
-
export { Prometheus, defaultRegister, createHttpMetrics, createGraphQlMetrics, createGcMetrics, getSummary, getContentType, createRequestRecorder, createGcObserver, defaultNormalizers, normalizeStatusCode, normalizePath, normalizeMethod, isRunningInKubernetes, skipMetricsInEnvironment, endMeasurementFrom, sortLabels, timing, };
|
|
16
|
-
export type * from '@promster/types';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { normalizeMethod } from "./method/index.js";
|
|
2
|
-
import { normalizePath } from "./path/index.js";
|
|
3
|
-
import { normalizeStatusCode } from "./status-code/index.js";
|
|
4
|
-
declare const defaultNormalizers: {
|
|
5
|
-
normalizeStatusCode: (statusCode: number) => number;
|
|
6
|
-
normalizePath: (path: string) => string;
|
|
7
|
-
normalizeMethod: (method: string) => string;
|
|
8
|
-
};
|
|
9
|
-
export { normalizeStatusCode, normalizePath, normalizeMethod, defaultNormalizers, };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare class Timing {
|
|
2
|
-
#private;
|
|
3
|
-
static NS_PER_SEC: bigint;
|
|
4
|
-
constructor();
|
|
5
|
-
value(): {
|
|
6
|
-
seconds: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
seconds: number;
|
|
9
|
-
};
|
|
10
|
-
reset(): this;
|
|
11
|
-
end(): this;
|
|
12
|
-
}
|
|
13
|
-
declare const timing: {
|
|
14
|
-
start(): Timing;
|
|
15
|
-
};
|
|
16
|
-
export default timing;
|
|
17
|
-
export { Timing };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export * from "./declarations/src/index.js";
|
|
2
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvbXN0ZXItbWV0cmljcy5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|