Grafana integration with springboot and postgres

Viewed 301

I am trying to use Grafana for visualization. I have a Spring-boot application which is integrated with PostgreSQL. I want to fetch the data from Postgres and show it in Grafana.

So far, I have found maven dependency for grafana which is as below :

    <!-- https://mvnrepository.com/artifact/com.appnexus.grafana-client/grafana-api-java-client -->
<dependency>
    <groupId>com.appnexus.grafana-client</groupId>
    <artifactId>grafana-api-java-client</artifactId>
    <version>1.0.5</version>
</dependency>
     

Can anyone please help with the tutorials examples?

1 Answers

If you want to just visualized the PostgreSQL database metrics on grafana then you can use this plugin.

However if you want to view the Spring Boot related metrics ( http response status, performance, jvm stats, connection pool stats etc.) then a more popular way is to setup Prometheus as the time series datastore and metrics scraper from where graphana can generate the visualization. For detailed information on setup of each component you can refer to this or this article. There are even ready made grafana dashboards for Spring Boot like this. Of course this too uses Prometheus.

Related