I was using prometheus exporter to collect the metrics. I recently wanted to use the metrics related to the APIs so I added PrometheusExporter::Middleware in my config. And ever since some of my applications APIs started giving 502s and the pods started crashing or going OOM.
I just added this line:
# This reports stats per request like HTTP status and timings
Rails.application.middleware.unshift PrometheusExporter::Middleware
If I remove this line of code from my config file, all the APIs work perfectly but as soon as I add this line some of my APIs start to give 502s. The APIs are mostly those APIs which are making changes in the DB, so all the PUT/POST APIs are giving 502s and all the GET APIs are working perfectly fine.
Can someone help me in resolving this issue please?
I was using prometheus exporter to collect the metrics. I recently wanted to use the metrics related to the APIs so I added
PrometheusExporter::Middleware
in my config. And ever since some of my applications APIs started giving 502s and the pods started crashing or going OOM. I just added this line:If I remove this line of code from my config file, all the APIs work perfectly but as soon as I add this line some of my APIs start to give 502s. The APIs are mostly those APIs which are making changes in the DB, so all the PUT/POST APIs are giving 502s and all the GET APIs are working perfectly fine. Can someone help me in resolving this issue please?