ClusterCockpit / cc-backend

Web frontend and API backend server for ClusterCockpit Monitoring Framework
https://www.clustercockpit.org
MIT License
14 stars 12 forks source link

Prometheus backend: omit metrics with empty series #195

Closed giesselmann closed 11 months ago

giesselmann commented 11 months ago

Hi,

I would like to merge a fix in the prometheus backend. In case of missing data from all hosts of some metric, the backend would so far return a jobMetric object with a Series of length zero. This causes the frontend to crash inside MetricPlot.svelte where some checks rely on series[0].data.length

This PR only adds scope/metric data if at least one host returned values and fixes the issue.