# Questions regarding using Prometheus push gateway as a generic platfor

**URL:** <https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487>\
**Category:** Exporters and Metrics\
**Created:** [February 24, 2023, 2:18pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487 "2023-02-24T14:18:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![avinashmeda](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@avinashmeda](https://discuss.prometheus.io/u/avinashmeda)\
**Post date:** [February 24, 2023, 2:18pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/1 "2023-02-24T14:18:42Z")

</div>

I am trying to have a generic platform where the teams who wish not to expose the metrics directly , want to push the metrics to a generic processor from whom the metrics will be scraped . Push gateway is exactly doing that , however it says that its recommended for only short lived jobs like batch jobs etc .

Now the questions i have are :

1. Can I use the push gateway for the purpose I mentioned ? Are there any shortcomings ?
2. All my workloads run on Kubernetes . Can push gateway scale beyond a single pod ?
3. Does it internally aggregate any metrics ?

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [February 24, 2023, 4:24pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/2 "2023-02-24T16:24:55Z")

</div>

Push Gateway is designed for short lived jobs as you mention, such as scheduled tasks (cron).

From what you are saying it sounds like something like Grafana Agent Operator or Prometheus in agent mode might be what you are wanting.

Fundamentally Prometheus is designed to be a pull based system, so the expectation is that applications expose metrics to be scraped.

---

<div class="post-metadata">

**Author:** ![avinashmeda](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@avinashmeda](https://discuss.prometheus.io/u/avinashmeda)\
**Post date:** [February 27, 2023, 5:05am UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/3 "2023-02-27T05:05:14Z")

</div>

Thanks for replying @stuart . The idea is for applications who are not willing to expose the metrics , instead are ok to push the metrics to an end point or a message broker. Will the push gateway in that case solve the problem ? Any downsides ?

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [February 27, 2023, 1:46pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/4 "2023-02-27T13:46:04Z")

</div>

That is actively against the ideas behind Prometheus.

You would lose the use of the “up” metric, which means you won’t be able to detect some form of failures as easily. It also means things like scrape intervals need to be carefully matched with the application as it is no longer the Prometheus server(s) which are in sole control of metric fetching. You also have additional failure/error modes as the gateway failing or being misconfigured could prevent metrics flowing.

---

<div class="post-metadata">

**Author:** ![avinashmeda](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@avinashmeda](https://discuss.prometheus.io/u/avinashmeda)\
**Post date:** [February 28, 2023, 1:59pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/5 "2023-02-28T13:59:52Z")

</div>

Agree with you . However, Since my workloads are k8s based we have alternate means for the uptime metric . In general , can the push gateway scale beyond a single pod and still write the results correctly ? , Any suggestions of a push based model ? I know its against the theory of prometheus . But we are limited with the choice .

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 29, 2023, 8:59pm UTC](https://discuss.prometheus.io/t/questions-regarding-using-prometheus-push-gateway-as-a-generic-platfor/1487/6 "2023-03-29T20:59:33Z")

</div>

Split this topic on March 29, 2023, 8:59pm UTC

A post was split to a new topic: [Use of Push Gateway](https://discuss.prometheus.io/t/use-of-push-gateway/1559)
