0

I have a spring boot application with spring boot version 2.7.6 which I have recently upgraded to 3.0.6

I had one Rest API for which I was getting Prometheus metric like below,

http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="2xx",uri="/mock-api/{response-code}/{sleep-time}",} 4.0

But after this upgrade I am getting metric like below,

http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/mock-api/{response-code}/{sleep-time}",} 3.0
http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="201",uri="/mock-api/{response-code}/{sleep-time}",} 1.0

'2xx' vs '200'

I think it has happened due to springboot version upgrade. Is there a way to still get '2xx' instead of '200'? Reason why I need it as coz my application is already there on production for a very long time and there are n-number of grafana dashboards on it. Due to this change in metric value, I am seeing issues there. I want to avoid any impact on grafana dashboards.

Please guide if anyone has faced this.

  • Are you sure update is the one to blame here? Because I remember [you asking specifically about how to make this happen](https://stackoverflow.com/questions/76816722) ;) – markalex Aug 28 '23 at 13:42
  • That was a different project where I was using spring boot 2.7.6. This is a different project which we have upgraded to spring boot 3.0.6 after this upgrade I have noticed that 2xx Prometheus metrics have been detailed out to 200, 201 etc due to which my existing Grafana dashboard are causing issues. Hence I am looking for an option to get metrics as 2xx using spring boot 3.0.6 . Please let me know if you have any solution. – Sachin Mankotia Aug 28 '23 at 17:15
  • Then I suppose you can mention upgrade to boot 3 in linked question as a way to solve it) – markalex Aug 28 '23 at 19:11
  • Regarding thisissue: Idk changes in spring, but you can theoretically apply relabeling and recording rules on prometheus' side to replace detailed view with aggregated one. – markalex Aug 28 '23 at 19:14

0 Answers0