@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.
Files changed (42) hide show
  1. package/dist/index.cjs +411 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +154 -0
  4. package/dist/index.d.ts +154 -0
  5. package/dist/index.js +358 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +32 -10
  8. package/dist/declarations/src/client/client.d.ts +0 -9
  9. package/dist/declarations/src/client/index.d.ts +0 -2
  10. package/dist/declarations/src/create-gc-metrics/create-gc-metrics.d.ts +0 -14
  11. package/dist/declarations/src/create-gc-metrics/index.d.ts +0 -2
  12. package/dist/declarations/src/create-gc-observer/create-gc-observer.d.ts +0 -3
  13. package/dist/declarations/src/create-gc-observer/index.d.ts +0 -2
  14. package/dist/declarations/src/create-graphql-metrics/create-graphql-metrics.d.ts +0 -25
  15. package/dist/declarations/src/create-graphql-metrics/index.d.ts +0 -2
  16. package/dist/declarations/src/create-http-metrics/create-http-metrics.d.ts +0 -26
  17. package/dist/declarations/src/create-http-metrics/index.d.ts +0 -2
  18. package/dist/declarations/src/create-request-recorder/create-request-recorder.d.ts +0 -16
  19. package/dist/declarations/src/create-request-recorder/index.d.ts +0 -3
  20. package/dist/declarations/src/end-measurement-from/end-measurement-from.d.ts +0 -4
  21. package/dist/declarations/src/end-measurement-from/index.d.ts +0 -2
  22. package/dist/declarations/src/environment/index.d.ts +0 -3
  23. package/dist/declarations/src/environment/kubernetes.d.ts +0 -2
  24. package/dist/declarations/src/environment/skip-metrics-in-environment.d.ts +0 -6
  25. package/dist/declarations/src/index.d.ts +0 -16
  26. package/dist/declarations/src/normalizers/index.d.ts +0 -9
  27. package/dist/declarations/src/normalizers/method/index.d.ts +0 -2
  28. package/dist/declarations/src/normalizers/method/method.d.ts +0 -2
  29. package/dist/declarations/src/normalizers/path/index.d.ts +0 -2
  30. package/dist/declarations/src/normalizers/path/path.d.ts +0 -2
  31. package/dist/declarations/src/normalizers/status-code/index.d.ts +0 -2
  32. package/dist/declarations/src/normalizers/status-code/status-code.d.ts +0 -2
  33. package/dist/declarations/src/sort-labels/index.d.ts +0 -2
  34. package/dist/declarations/src/sort-labels/sort-labels.d.ts +0 -3
  35. package/dist/declarations/src/summary/index.d.ts +0 -2
  36. package/dist/declarations/src/summary/summary.d.ts +0 -3
  37. package/dist/declarations/src/timing/index.d.ts +0 -2
  38. package/dist/declarations/src/timing/timing.d.ts +0 -17
  39. package/dist/promster-metrics.cjs.d.ts +0 -2
  40. package/dist/promster-metrics.cjs.dev.js +0 -409
  41. package/dist/promster-metrics.cjs.js +0 -7
  42. 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,2 +0,0 @@
1
- import { configure, defaultRegister, Prometheus } from "./client.js";
2
- 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,2 +0,0 @@
1
- import { createGcMetrics } from "./create-gc-metrics.js";
2
- export { createGcMetrics };
@@ -1,3 +0,0 @@
1
- import type { TDefaultedPromsterOptions, TGcMetrics } from '@promster/types';
2
- declare const createGcObserver: (_metrics: TGcMetrics, options: TDefaultedPromsterOptions) => () => void;
3
- export { createGcObserver };
@@ -1,2 +0,0 @@
1
- import { createGcObserver } from "./create-gc-observer.js";
2
- export { createGcObserver };
@@ -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,2 +0,0 @@
1
- import { createGraphQlMetrics } from "./create-graphql-metrics.js";
2
- 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,2 +0,0 @@
1
- import { createHttpMetrics } from "./create-http-metrics.js";
2
- 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,3 +0,0 @@
1
- import { createRequestRecorder } from "./create-request-recorder.js";
2
- export type { TRequestRecorder } from "./create-request-recorder.js";
3
- export { createRequestRecorder };
@@ -1,4 +0,0 @@
1
- declare function endMeasurementFrom(start: [number, number]): {
2
- durationS: number;
3
- };
4
- export { endMeasurementFrom };
@@ -1,2 +0,0 @@
1
- import { endMeasurementFrom } from "./end-measurement-from.js";
2
- export { endMeasurementFrom };
@@ -1,3 +0,0 @@
1
- import { isRunningInKubernetes } from "./kubernetes.js";
2
- import { skipMetricsInEnvironment } from "./skip-metrics-in-environment.js";
3
- export { isRunningInKubernetes, skipMetricsInEnvironment };
@@ -1,2 +0,0 @@
1
- declare const isRunningInKubernetes: () => boolean;
2
- export { isRunningInKubernetes };
@@ -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,2 +0,0 @@
1
- import { normalizeMethod } from "./method.js";
2
- export { normalizeMethod };
@@ -1,2 +0,0 @@
1
- declare const normalizeMethod: (method: string) => string;
2
- export { normalizeMethod };
@@ -1,2 +0,0 @@
1
- import { normalizePath } from "./path.js";
2
- export { normalizePath };
@@ -1,2 +0,0 @@
1
- declare const normalizePath: (path: string) => string;
2
- export { normalizePath };
@@ -1,2 +0,0 @@
1
- import { normalizeStatusCode } from "./status-code.js";
2
- export { normalizeStatusCode };
@@ -1,2 +0,0 @@
1
- declare const normalizeStatusCode: (statusCode: number) => number;
2
- export { normalizeStatusCode };
@@ -1,2 +0,0 @@
1
- import { sortLabels } from "./sort-labels.js";
2
- export { sortLabels };
@@ -1,3 +0,0 @@
1
- import type { TLabelValues } from '@promster/types';
2
- declare function sortLabels(unsortedLabels: TLabelValues): TLabelValues;
3
- export { sortLabels };
@@ -1,2 +0,0 @@
1
- import { getContentType, getSummary } from "./summary.js";
2
- export { getSummary, getContentType };
@@ -1,3 +0,0 @@
1
- declare const getSummary: () => Promise<string>;
2
- declare const getContentType: () => "text/plain; version=0.0.4; charset=utf-8";
3
- export { getSummary, getContentType };
@@ -1,2 +0,0 @@
1
- import timing, { Timing } from "./timing.js";
2
- export { timing, Timing };
@@ -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=