biosimulations / biosimulations

A platform for sharing and reusing biomodeling studies including models, simulations, and visualizations of their results
https://biosimulations.org
MIT License
38 stars 13 forks source link

Add metrics endpoint to API #3895

Open bilalshaikh42 opened 2 years ago

bilalshaikh42 commented 2 years ago

We can use the monitoring dashboard to keep track of metrics for API performance, such as the number of successful and failed runs, size of runs etc. This would require a "/metrics" endpoint that returns statistics in prometheus standard format

Approach:

create a module that provides a singleton service that keeps track of the various metrics via private variables. The module should declare a controller that exposes the metrics through an endpoint. The module should export a service that exposes methods to increment the counters.

There are probably libraries that make the output format easier

bilalshaikh42 commented 2 years ago

https://github.com/willsoto/nestjs-prometheus#counter