From 8a5d530d4484cf0e06190f77182c86d868c97fda Mon Sep 17 00:00:00 2001 From: DmitriyA Date: Mon, 14 Jul 2025 03:14:51 -0400 Subject: [PATCH] adding filter for metrics --- src/prometheus.service.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/prometheus.service.ts b/src/prometheus.service.ts index eb685a1..2932f56 100644 --- a/src/prometheus.service.ts +++ b/src/prometheus.service.ts @@ -224,11 +224,14 @@ export class PrometheusService { } async fetchAllMetricsWithValues(): Promise { - const metricNames = await this.fetchAllMetrics(); - const promises = metricNames.map(async (metric) => { - const data = await this.fetchMetrics(metric); - return { metric, data }; - }); - return Promise.all(promises); - } + const metricNames = await this.fetchAllMetrics(); + const zvksMetrics = metricNames.filter(metric => metric.startsWith('zvks')); + + const promises = zvksMetrics.map(async (metric) => { + const data = await this.fetchMetrics(metric); + return { metric, data }; + }); + + return Promise.all(promises); +} }