Skip to content

Commit

Permalink
fix(services): fix runtime exporter metrics data caching issue (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 authored Nov 9, 2023
1 parent 9e8ee08 commit c1f0cdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/runtime-exporter/src/handler/get-runtime-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ const getRuntimeMetrics: RequestHandler = async (req, res) => {
}

// Clear the metrics data generated by the last request
register.clear()
RUNTIME_CPU.reset()
RUNTIME_CPU_LIMIT.reset()
RUNTIME_MEMORY.reset()
RUNTIME_MEMORY_LIMIT.reset()

const runtimeMetrics =
await ClusterService.getRuntimePodMetricsForAllNamespaces()
Expand Down

0 comments on commit c1f0cdc

Please sign in to comment.