Get the FIRST value of each day and plot it in a graph?

Hi,

I have a Grafana dashboard over Prometheus monitoring our customer account credits.

What I want to do, is to create a graph of the FIRST value of each day of each account, over the last 30 days.

This is because at 9am each day we have a job to recalculate account credits and this is considered the closing balance of the previous day. And throughout the day the credit goes up & down but we only care about the closing balance.

Prometheus scrapes the exporter every 60s.

The time series looks like this -

account_credit{account_name="abc"}  123.45

How should I go about creating such a graph?

With other reporting tools, I’d bucket the data by day, and then apply a FIRST aggregate function over the bucket. But I don’t see a way to do so in Grafana nor Prometheus.

Any ideas?

Thanks.