Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Jun 18, 2024
1 parent da81b34 commit 4a6fa2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/probes/PrometheusClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ export class PrometheusClient {
// res.result is an any[]
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const series: InstantResult[] = res.result;
log.info('series', { series });
if (series.length == 0) {
log.warn('no series found');
return null;
}

log.info('instant query result', { result: series[0] });
log.info('instant query value', { value: series[0].value.value });
return series[0].value.value;
} catch (error: unknown) {
log.error('unable to query prometheus', { error });
Expand Down

0 comments on commit 4a6fa2c

Please sign in to comment.