Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ async fn fetch_server_metrics(
}}
[5m]
)
[3h]
[3h:]
)
)
)
Expand Down Expand Up @@ -518,7 +518,7 @@ async fn fetch_server_metrics(
device=~"(eth0|eth1)"
}}[1m]
)
) [3h])
) [3h:])
)
)
# Convert from B/s to Kb/s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ pub async fn pegboard_client_usage_get(ctx: &OperationCtx, input: &Input) -> Glo
)
.to_string(),
)
.await?;
.await;

// Gracefully handle prometheus failure, fallback to no data
let prom_res = match prom_res {
Ok(x) => x,
Err(err) => {
tracing::error!(?err, "failed to fetch pegboard prometheus metrics");

Default::default()
},
};

let mut stats_by_client_id = HashMap::new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ async fn calculate_diff(
}),
)?;

if !topology_res.prometheus_fetched {
tracing::error!("prometheus could not be fetched, not scaling");

return Ok(CalculateDiffOutput {
actions: Vec::new(),
});
}

let dc = unwrap!(datacenter_res.datacenters.first());

// Build hashmap from topos for sorting
Expand Down
Loading