# Microservice Statistics

**URL:** <https://community.cumulocity.com/t/microservice-statistics/1463>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [February 15, 2024, 2:26pm UTC](https://community.cumulocity.com/t/microservice-statistics/1463 "2024-02-15T14:26:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Stoffel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/marco_stoffel/32/19453_2.png) [@Marco\_Stoffel](https://community.cumulocity.com/u/Marco_Stoffel)\
**Post date:** [February 15, 2024, 2:26pm UTC](https://community.cumulocity.com/t/microservice-statistics/1463/1 "2024-02-15T14:26:17Z")

</div>

Hi experts!

[Cumulocity.com](http://Cumulocity.com) 10.18

is there an API to get an statistical overview of Microservices utilisation? I mean how many requests were processed, CPU MEM util?

Thanks and kind Regards,

Marco

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [February 15, 2024, 4:33pm UTC](https://community.cumulocity.com/t/microservice-statistics/1463/2 "2024-02-15T16:33:10Z")

</div>

There is a nice (newish?) app, called “Usage Statistics” which gives to you a good overview of usage statistics in a tenant (e.g. devices, and microservices). So that might help you out if you just want to monitor if anything is misbehaving.

I just installed it on my tenant via the Administration → Applications menu:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/a/6/a6065b4454aa37cdb4b20f2dea8042849e7038b8.jpeg)

Here is an example of the microservice monitoring:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/9/4/943e61ad9a5797651c0fcaaddca1eab9b1855a19.png)

I’m not sure if you can get an API (though you could probably have a look at the browser’s API requests to see where it is getting this information from).

If you need fine-grain control over your microservice then I would recommend using a prometheus or [OpenTelemetry](https://opentelemetry.io/) endpoint where you can generally gather more microservice specific information like number of requests per REST API (of the microservice) etc…

---

<div class="post-metadata">

**Author:** ![Marco\_Stoffel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/marco_stoffel/32/19453_2.png) [@Marco\_Stoffel](https://community.cumulocity.com/u/Marco_Stoffel)\
**Post date:** [February 16, 2024, 6:54am UTC](https://community.cumulocity.com/t/microservice-statistics/1463/3 "2024-02-16T06:54:57Z")

</div>

Thanks Reuben,

I know the statistics app, but the information is not enough to analyse the actual load (Requests/Timeframe, Burst etc.). The customer has a lot of Microservices that he wants to consolidate/cluster into fewer to save cost. I will suggest to build a Telemetry Endpoint that you suggested.

Kind Regards,

Marco

---

<div class="post-metadata">

**Author:** ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)\
**Post date:** [February 16, 2024, 7:32am UTC](https://community.cumulocity.com/t/microservice-statistics/1463/4 "2024-02-16T07:32:53Z")

</div>

@Marco_Stoffel For Prometheus, there is an example in the microservices template project:

> **[cumulocity-microservice-templates/metrics at main ·...](https://github.com/Cumulocity-IoT/cumulocity-microservice-templates/tree/main/metrics)**
>
> Collection of templates / examples to give the developer a starting point how common features can be solved by using Cumulocity Microservice SDK for Java. Developed by Global Competency Center IoT...

If you are going to use Open Telemetry, which I think gives you more metrics out of the box if you are using Spring Boot, it would be great if you could share this with the community.

---

<div class="post-metadata">

**Author:** ![Stefan\_Witschel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/stefan_witschel/32/31955_2.png) [@Stefan\_Witschel](https://community.cumulocity.com/u/Stefan_Witschel)\
**Post date:** [February 16, 2024, 9:06am UTC](https://community.cumulocity.com/t/microservice-statistics/1463/5 "2024-02-16T09:06:37Z")

</div>

Also there is a guide about microservice monitoring and collect these metrics you’ve mentioned Marco.

> [@Microservice Monitoring in Cumulocity IoT](https://community.cumulocity.com/t/microservice-monitoring-in-cumulocity-iot/589):
>
> Overview Cumulocity IoT can be extended with Microservices which are deployed to tenants. Large IoT solutions often consist of multiple microservices serving different purposes and might be critical for the overall success of that solution. In that case, you might not want to rely on “luck” or “prayers” but you want to make sure that your microservices are operating normal and if not instantly get informed about it. In short: You want to monitor your microservices. In this article, I will exp…

Out of the box the Java Microservice SDK provides a Prometheus endpoint which can be extend with custom metrics like requests etc. In the article there is an example about that.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [August 14, 2024, 9:07am UTC](https://community.cumulocity.com/t/microservice-statistics/1463/6 "2024-08-14T09:07:03Z")

</div>

Closed on August 14, 2024, 9:07am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
