# metrics for short lived cron job

**URL:** <https://community.dynatrace.com/t/metrics-for-short-lived-cron-job/39055>\
**Category:** Container platforms\
**Tags:** dynatrace-managed, kubernetes\
**Created:** [March 28, 2023, 3:41pm UTC](https://community.dynatrace.com/t/metrics-for-short-lived-cron-job/39055 "2023-03-28T15:41:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas\_nguyen](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nicolas_nguyen/32/28450_2.png) [@nicolas\_nguyen](https://community.dynatrace.com/u/nicolas_nguyen)\
**Post date:** [March 28, 2023, 3:41pm UTC](https://community.dynatrace.com/t/metrics-for-short-lived-cron-job/39055/1 "2023-03-28T15:41:17Z")

</div>

We are in the process to use Dynatrace and we are searching for a solution&nbsp; to continu to collect metrics even for our short-lived cron job.

With our current solution we use Prometheus Pushgateways to collect those metrics.

 ![nicolas_nguyen_0-1680017951073.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/e/8ed76a3f2d1da51f19b4d4851a27293595f30765.png)

> **[When to use the Pushgateway | Prometheus](https://prometheus.io/docs/practices/pushing/)**
>
> Prometheus project documentation for When to use the Pushgateway

Is there a solution to make it work with Dynatrace, or an alternative solution ?

in a perfect world we do not want to keep prometheus for metrics

thanks

---

<div class="post-metadata">

**Author:** ![mreider](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mreider/32/14971_2.png) [@mreider](https://community.dynatrace.com/u/mreider)\
**Post date:** [March 28, 2023, 5:12pm UTC](https://community.dynatrace.com/t/metrics-for-short-lived-cron-job/39055/2 "2023-03-28T17:12:26Z")

</div>

What sorts of metrics are these, and what sort of runtime are you using?

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [March 28, 2023, 6:17pm UTC](https://community.dynatrace.com/t/metrics-for-short-lived-cron-job/39055/3 "2023-03-28T18:17:28Z")

</div>

Hello.

You can try to push metrics directly to Dynatrace via API (Environment API v2 - /metrics/ingest)

Or you can try to push metrics via host - [documetation](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/post-ingest-metrics#expand--prefer-to-ingest-metrics-right-on-the-host).

[This is](https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/ingestion-methods/oneagent-pipe#metric-scripting-integration) another example how to achive this.

Regards,

Alex
