Spring Boot 1.x

Dashboard

Dashboard for Spring Boot 1.x apps using Micrometer and Prometheus
Last updated: 3 years ago

Start with Grafana Cloud and the new FREE tier. Includes 10K series Prometheus or Graphite Metrics and 50gb Loki Logs

Downloads: 829

Reviews: 1

    Dashboard for Spring Boot 1.x applications, using Micrometer and Prometheus.

    Features

    • Overall status
    • API stats
    • Tomcat
    • JVM

    Variables

    Only one variable is declared in Grafana:

    • $job : property "job_name" coming from prometheus.yml config file

    Enable Actuator /prometheus endpoint

    Here are the dependencies to add in pom.xml:

    <!-- Actuator (with security enabled) -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    
    <!-- Monitoring endpoint - Micrometer + Prometheus -->
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-spring-legacy</artifactId>
        <version>1.0.6</version>
    </dependency>
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
        <version>1.0.6</version>
    </dependency>
    

    Add config in prometheus.yml

    Snippet for a https endpoint:

      - job_name: my-app-prod
        scheme: https
        basic_auth:
          username: your_actuator_user
          password: your_actuator_password
        metrics_path: /MyApp/actuator/prometheus
        static_configs:
          - targets:
              - "your_hostname:your_port"   
    

    Snippet for a http endpoint:

      - job_name: my-app-prod
        scheme: http
        metrics_path: /MyApp/actuator/prometheus
        static_configs:
          - targets:
              - "your_hostname:your_port"