File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,19 @@ import { registerServerMetrics } from "./prometheus-metrics";
13
13
@injectable ( )
14
14
export class MonitoringEndpointsApp {
15
15
public create ( ) : express . Application {
16
- let registry = prometheusClient . register ;
16
+ const registry = prometheusClient . register ;
17
17
18
18
prometheusClient . collectDefaultMetrics ( { register : registry } ) ;
19
19
registerDBMetrics ( registry ) ;
20
20
registerServerMetrics ( registry ) ;
21
- registry = prometheusClient . Registry . merge ( [ registry , redisMetricsRegistry ( ) ] ) ;
21
+
22
+ // Append redis metrics to default registry
23
+ redisMetricsRegistry ( )
24
+ . getMetricsAsArray ( )
25
+ . then ( ( metrics ) => {
26
+ metrics . forEach ( ( metric ) => registry . registerMetric ( metric as any ) ) ;
27
+ } )
28
+ . catch ( console . error ) ;
22
29
23
30
const monApp = express ( ) ;
24
31
monApp . get ( "/metrics" , async ( req , res ) => {
You can’t perform that action at this time.
0 commit comments