-
Notifications
You must be signed in to change notification settings - Fork 1
/
prometheus-consumer.d.ts
37 lines (32 loc) · 1.17 KB
/
prometheus-consumer.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Writable } from 'readable-stream';
import { AbstractLogger } from 'abslog';
import * as PrometheusClient from 'prom-client';
declare class PrometheusConsumer extends Writable {
constructor(options: PrometheusConsumer.PrometheusConsumerOptions);
override(
metric: string,
config: PrometheusConsumer.PrometheusConsumerOverrideConfig,
): void;
readonly registry: PrometheusClient.Registry;
metrics(): ReturnType<PrometheusClient.Registry['metrics']>;
contentType(): PrometheusClient.Registry['contentType'];
}
declare namespace PrometheusConsumer {
export type PrometheusConsumerOptions = {
client: typeof PrometheusClient;
logger?: AbstractLogger;
bucketStepFactor?: number;
bucketStepCount?: number;
bucketStepStart?: number;
};
export type PrometheusConsumerOverrideConfig = {
type: 'histogram' | 'summary' | 'counter' | 'gauge';
labels: Array<'url' | 'method' | 'status' | 'layout' | 'podlet'>;
buckets: {
bucketStepFactor?: number;
bucketStepCount?: number;
bucketStepStart?: number;
};
};
}
export = PrometheusConsumer;