API
  • API Index
  • Batch API
  • Content Negotiation
  • Dynamic Paths
  • Hierarchy API
  • List API
  • Quick Reference
  • Time Series API
  • Views
    • Configuration
  • Overview
  • Application Configuration
  • Documentation Configuration
  • Spec Configuration
    • Features
  • API Testing
  • Asynchronous Processing
  • Cassandra Time-Series Engine
  • Cassandra Integration
  • Default Controller Customisation
  • Documentation
  • Model Documentation
  • PostgreSQL Integration
    • Tutorials
  • Step-by-Step Guide
  • Archetype Setup
  • Logging
  • Prometheus
  • Sentry Logging
    • UI Customisation
  • UI Customisation
  • SASS Build Chain
  • Shared Layout
  • API Documentation
  • Model Documentation
  • Results
  • sapi-nt v 1.4.0

    Prometheus

    This document contains information on how to expose prometheus metrics on your sapi-nt application.

    First step is to add the required dependencies including the spring boot actuator and the prometheus registry:

    <!-- Spring Boot Actuator -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <!-- Micrometer Prometheus registry -->
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>
    

    The next step is to enable the metrics using the application properties:

    management.endpoints.web.exposure.include=prometheus
    management.endpoint.prometheus.enabled=true
    management.endpoint.metrics.enabled=true
    management.metrics.export.prometheus.enabled=true
    

    The above properties will enable prometheus exposing all default metrics. To find out more about spring boot actuator and other configuration properties checkout the official documentation