Instrumenting my business logic with Prometheus

Do you mean 5 apps in an umbrella setup?

If you don’t have an umbrella setup and just one elixir app, there is nothing special to do.

If you have an umbrella setup with different apps, I would suggest that you create another app just for the metrics. That metrics app has the dependency to prometheus_ex and exposes functions for your other apps to add and update their metrics. That way, your other apps can have the metrics app as dependency and push their metrics to it. That metrics app also exposes Prometheus.Format.Text.format which is important for your web facing app to get the metrics for the endpoint. The point is that you have a central place for the metrics so you don’t end up having one metrics list per app which is not very practical in most cases.

3 Likes