How to see kafka producer metrics using spring boot - spring-boot

I want to see Kafka producer JMX metrics using Spring boot actuator. How can I see those metrics using spring boot? AN example will be much appriciated

You can use Spring Boot Admin.
You'll create a Spring Boot Admin application and have your producer register itself with it. Here's a nice tutorial.

Related

How to expose Kafka metrics from SpringBoot application through JMX to Prometheus?

I have a springboot app from which i would like to expose the kafka.consumer metrics to Prometheus via JMX. I can see the metrics here but i just don't know where to set those mBeans(i.e. kafka.consumer:type=consumer-metrics,client-id=([-.\w]+)). I understood reading the spring boot documentation that i need to activate JMX only by doing this setting spring.jmx.enabled=true but i don't know what to do extra to expose those metrics to Prometheus through JMX.
Kafka automatically registers its own MBeans with those names.
If you add the actuator starter, Boot will configure Micrometer to scrape those MBeans.
However, Micrometer has deprecated the JMX scraper and has new KafkaMetrics Objects.
Spring Boot 2.3 now uses those classes to configure Micrometer instead of JMX.

How to Refresh Spring Boot Configuration Info with Using Spring Cloud Config

I would like to ask how to refresh spring boot configuration info with using spring cloud config. Would you please give me some advice? Many thanks.
If your spring boot application is a client of Spring Cloud Configuration Server and use itself as single point of truth in the application configuration let's say retrieve application.properties/yml from the config server, you can benefit of #RefreshScope. in this case if you do a post to the /refresh if you use spring boot 1.x or /actuator/refresh if you use spring boot 2.x all the bean that are have are annotated as #RefreshScope will be refreshed.

No exporter for Kafka in Spring Boot Actuator

Is there any exporter to Kafka the same way Spring boot has for Redis (RedisMetricRepository), JMX (JmxMetricWriter) as seen here
This is what I was looking for.

How we can use loglevel-management by using Spring Boot Admin?

Currently i am using logback for logging purpose , i just heard about spring boot admin but does not get an exact idea about how to implement loglevel-management by using Spring Boot Admin , please any one tell me how we can implement this .Thanks in advance
You have to expose your application by JMX bean using jolokia details
You can access log level management via JMX bean using spring boot admin client details
In case you are using spring boot admin 1.5.x and spring boot 1.5.x on your client you don't need to do anything - it should just work.

Consuming Spring cloud config using Spring REST service (non-boot rest service)

I'm just curious, is it possible to consume Spring Cloud config by a Spring REST service which is not a Spring boot application. If it is possible, where to define the properties in a Spring REST service. I meant, where should I define
spring.cloud.config.uri etc.
Or, only Spring boot applications are allowed to consume Cloud configuration?
Any thought would be appreciated. Thanks
well spring boot just bootstrap all configuration automatically . so for simple spring application you have to config it manually and define the cloud config server beans in your application configuration file . it could be pure old fashion xml files or just using java code configuration with #Configuration. you could find some samples in github

Resources