How would I create a Custom Application Monitoring Framework

98 views Asked by At

I am looking to write a framework of some kind that is able to monitor the internal state of an application. In this hypothetical application it completes user Tasks, let's say that it's state moves from Start -> Working -> Finishing -> Completed. I need to collect data on how long it sits in each state.

I am looking to use this collected data to Tune the application by adjusting parameters e.g., Analysis Engine 1 - 3, the number of threads in use, RAM made available etc. Therefore, the goal is to find the optimal combination (of adjustable parameters) that leads to the fasted completed Task (on average). This means that I will need to keep this monitoring data over time.

The goal is to have this automated, at the end of the day.

My questions are:

  • Should i be using something like OpenTelemetry to collect data, or is it reasonable to make database calls or create additional endpoints to poll (to check on state changes)?
  • As I need to run the actual application and have it complete 100's of Tasks. How might I best go about running this and interacting with this?

My current thoughts:

  • My feeling is that the 'framework' should be a separate module that is called with command line arguments (thus not a traditional test), and that this interacts with OpenTelemetry or similar api to retrieve and present / log data.
1

There are 1 answers

2
João Martins On

This is how I setup a way to monitor an app that I have. My backend app is a middleware made in SpringBoot. My frontend app is a react app, that with redux and rest calls will call the backend app on the API that I built to send information back to the frontend. This way i can monitor everything including the Apps Health.

Don't forget to make sure that before the backend sends you any information to validate a token or something of the sort. In this case I do SSO on the frontend and later on every communication I validate the SSO token.

So, Summarizing, create a nice API on the backend that you can get all the information you want, and you just need to make a app that invokes that backend to display the information in the format you want, or even control it. I hope this helps.