-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistry.ts
32 lines (20 loc) · 1.04 KB
/
registry.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
//require prom-client: prometheus for node.js that supports historgram, summaries, gauges and counters
//works with nice-grpc-prometheus
// import promClient from 'prom-client';
//globalRegistry is assinged to an instance of Registery
// const globalRegistry= promClient.register;
//Registry is the class in prom-client (lambda Registry)
const {Registry} = promClient;
// export default globalRegistry;
//console.log(`globalRegistry: ${globalRegistry}, Registry: ${Registry}`)
//require nice-grpc-prometheus
// import niceGrpcClient from 'nice-grpc-prometheus';
// const niceGrpcRegistry = niceGrpcClient.registry;
//merge niceGrpcRegistry with global (use await to export all metrics)
// export const mergedRegistry = Registry.merge([globalRegistry, niceGrpcRegistry]);
//export
import * as promClient from 'prom-client';
import { registry as niceGrpcRegistry } from 'nice-grpc-prometheus';
const globalRegistry = promClient.register;
const mergedRegistry = promClient.Registry.merge([globalRegistry, niceGrpcRegistry]);
export default mergedRegistry;