# Application objects counter

**URL:** <https://discuss.prometheus.io/t/application-objects-counter/1969>\
**Category:** Exporters and Metrics\
**Created:** [October 18, 2023, 9:57am UTC](https://discuss.prometheus.io/t/application-objects-counter/1969 "2023-10-18T09:57:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Othmane](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@Othmane](https://discuss.prometheus.io/u/Othmane)\
**Post date:** [October 18, 2023, 9:57am UTC](https://discuss.prometheus.io/t/application-objects-counter/1969/1 "2023-10-18T09:57:41Z")

</div>

I have a Rust Actix web application.  
I integrated Prometheus successfully with this application.  
Now I need to count the number of objects within my application ex: the number of Posts.  
What steps and tools do I need to achieve that?

---

<div class="post-metadata">

**Author:** ![salessandri](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/salessandri/32/814_2.png) [@salessandri](https://discuss.prometheus.io/u/salessandri)\
**Post date:** [October 24, 2023, 5:21am UTC](https://discuss.prometheus.io/t/application-objects-counter/1969/2 "2023-10-24T05:21:09Z")

</div>

What needs to be done specifically depends a lot on the implementation details. But in general terms you should have some sort of registry where you register and then update your metrics. For example, you can take a look at the [prometheus-client crate](https://docs.rs/crate/prometheus-client/latest).

Then in order to expose the metrics so that prometheus can ingest them you will have to create an endpoint in your application. Traditionally, the `/metrics` endpoint would be used. This endpoint would serialize and encode the metrics contained in the registry into a format that can be ingested by prometheus (it can be prometheus format or Open Metrics format).

Finally, you need to configure your prometheus server to scrape your web application’s `/metric` endpoint at recurring intervals.

I don’t know how helpful that is, but that is the big picture. If you want more info on the specifics on certain parts, let’s follow up.
