diff --git a/build/charts/laf-server/templates/rumtime-exporter.yaml b/build/charts/laf-server/templates/rumtime-exporter.yaml index d78fe63f15..a68f323a1a 100644 --- a/build/charts/laf-server/templates/rumtime-exporter.yaml +++ b/build/charts/laf-server/templates/rumtime-exporter.yaml @@ -68,6 +68,7 @@ spec: - interval: 60s path: "/runtime/metrics/{{ .Values.default_region.runtime_exporter_secret}}" scrapeTimeout: 10s + honorLabels: true namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/services/runtime-exporter/src/handler/get-runtime-metrics.ts b/services/runtime-exporter/src/handler/get-runtime-metrics.ts index e6980a4346..17c3ee41d2 100644 --- a/services/runtime-exporter/src/handler/get-runtime-metrics.ts +++ b/services/runtime-exporter/src/handler/get-runtime-metrics.ts @@ -62,6 +62,9 @@ const getRuntimeMetrics: RequestHandler = async (req, res) => { return res.status(403).send('forbidden') } + // Clear the metrics data generated by the last request + register.clear() + const runtimeMetrics = await ClusterService.getRuntimePodMetricsForAllNamespaces()