Monitoring and Alerting your spring boot

While developing micro services is one thing, monitoring (and alerting in serious issues)post deployment and in production is equally important for an effective DevOps operation. In this blog, I am going to discuss some of the best practices that I have learnt and hence would recommend in monitoring critical Spring Boot based micro services in production:

management:
  metrics:
    enable:
      all: false
      http.server.requests: true
      api: true
management:
  endpoints:
    web:
      base-path: /management
      exposure:
        include: info, health, metrics, prometheus
Counter apiErrors = meterRegistry.counter(api.errors", tags);
apiErrors.increment();
Timer apiTimer = meterRegistry.timer(api.timers, tags);
apiTimer.record ()