https://github.com/prometheus/pushgateway/blob/master/README.md seems to be built for this:
The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to Prometheus. Since these kinds of jobs may not exist long enough to be scraped, they can instead push their metrics to a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.
I haven't seen this being used in the wild yet, so this issue is for collecting interest. Please reply or react if you find this useful.