# Ingesting test results

**URL:** <https://discuss.prometheus.io/t/ingesting-test-results/964>\
**Category:** Exporters and Metrics\
**Created:** [May 9, 2022, 12:08am UTC](https://discuss.prometheus.io/t/ingesting-test-results/964 "2022-05-09T00:08:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![allisonw](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@allisonw](https://discuss.prometheus.io/u/allisonw)\
**Post date:** [May 9, 2022, 12:08am UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/1 "2022-05-09T00:08:22Z")

</div>

I’d like to read test results into Prometheus as metrics. Other systems generally seem to do this via JUnit formatted XML, which I can generate, but I haven’t figured out how to get that data into Prometheus. I feel like maybe a pushgateway would be required, since these are short lived test containers? But beyond that I’m a bit stuck. Anyone have any suggestions on this or any other ways to track test results short of rewriting everything to

Thank you!

---

<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:** [May 9, 2022, 10:26am UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/2 "2022-05-09T10:26:02Z")

</div>

You need to be very careful about what type of data it is and what you are trying to achieve.

Prometheus is a metrics system rather than an event store, so it might be that you need a different solution.

Could you give a bit more detail about what you are trying to achieve?

---

<div class="post-metadata">

**Author:** ![allisonw](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@allisonw](https://discuss.prometheus.io/u/allisonw)\
**Post date:** [May 9, 2022, 3:18pm UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/3 "2022-05-09T15:18:37Z")

</div>

I’d like to keep metrics on how long the various tests take, and how often they fail, essentially.

---

<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:** [May 9, 2022, 5:03pm UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/4 "2022-05-09T17:03:52Z")

</div>

This is one of the cases where you may need both an event store and metrics.

For Prometheus having a metric that has “number of failures” makes perfect sense & is a good usage. Generating that metric however might need you to store the actual individual test runs to allow you to calculate that information.

---

<div class="post-metadata">

**Author:** ![allisonw](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@allisonw](https://discuss.prometheus.io/u/allisonw)\
**Post date:** [May 9, 2022, 5:42pm UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/5 "2022-05-09T17:42:07Z")

</div>

The test runs are already stored in our CI, which is then where I was hoping to export them from for these metrics (since the CI system doesn’t have this capability). Just needing to figure out the formatting. Looking, I see I could maybe try to write the output in openmetrics format, but was hoping to stick to jUnit because we have multiple systems in multiple languages, but they all have the ability to generate jUnit so there’d be consistency there.

---

<div class="post-metadata">

**Author:** ![morrtz](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/morrtz/32/711_2.png) [@morrtz](https://discuss.prometheus.io/u/morrtz)\
**Post date:** [May 17, 2023, 6:54pm UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/6 "2023-05-17T18:54:18Z")

</div>

did you manage to do that? I have the same requirement and issue.  
I want to get test results out to prometheus, I’m using pytest and ctest, any solution in mind would be great

---

<div class="post-metadata">

**Author:** ![allisonw](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@allisonw](https://discuss.prometheus.io/u/allisonw)\
**Post date:** [May 19, 2023, 5:23am UTC](https://discuss.prometheus.io/t/ingesting-test-results/964/7 "2023-05-19T05:23:14Z")

</div>

I didn’t find a way, no. Ended up having to leave it for now to work on some other things, but I hope to get back to it one of these days. :-/
