Scrape short living sync pods

Hi,

i am running rclone sync as a daily cronjob in kubernetes. Now i want to scrape metrics from the Job. The problem is that the sync finishes so fast that prometheus has no time to scrape the metrics from the pod. My idea was to use prometheus pushgateway, but how does the push gateway gets the metrics? As far as i know there is no flag to save the metrics to a file after the syncing is done.

This is the command i am running right now:

rclone sync <target> <destination> --rc-web-gui --rc-web-gui-no-open-browser --rc-enable-metrics --rc-no-auth --rc-addr :5572

The workaround i am thinking of would be: Have a long running rclone rc instance running that emits the metrics and create a cronjob that triggers the syncing via the api of the rc pod. But i want to do it purely with cronjob and no extra instance. Is that possible?

You are correct, such a flag doesn't exist yet.

I'm sure it could be implemented though - want to have a go? I can give hints if you do.

Having a long running rclone rcd will be more efficient in terms of API transactions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.