<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.thebennett.platform</groupId>
        <artifactId>platform-parent</artifactId>
        <version>0.1.11</version>
        <relativePath>../platform-parent</relativePath>
    </parent>

    <artifactId>platform-starter-observability</artifactId>
    <name>The Bennett Platform :: Starter :: Observability</name>
    <description>Error capture, structured logs and a metrics registry, from Spring's own machinery.</description>

    <properties>
        <!-- Not managed by the Spring Boot BOM, so it is pinned here for Renovate to bump. Boot 4
             needs `sentry-spring-boot-4`; the `-jakarta` artifact is the Boot 3 one and does not
             work here. -->
        <sentry.version>8.53.0</sentry.version>
    </properties>

    <dependencies>
        <!-- The registry and the endpoint machinery. Already pulled in by platform-starter-web, and
             declared again here so this starter stands on its own for a non-web app. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!-- Puts a Prometheus-format scrape endpoint on the classpath. Micrometer then collects JVM
             heap, GC pauses, HikariCP pool saturation, Tomcat threads and HTTP request percentiles
             with no code and no configuration.

             The endpoint is deliberately NOT exposed by this starter. See the note in
             ObservabilityDefaultsEnvironmentPostProcessor: turning it on is a security decision, not
             a default, because actuator shares the application port. -->
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>

        <!-- Error capture. Inert until sentry.dsn is set, which is what makes it safe to ship in the
             platform before any app has somewhere to send to. -->
        <dependency>
            <groupId>io.sentry</groupId>
            <artifactId>sentry-spring-boot-4</artifactId>
            <version>${sentry.version}</version>
        </dependency>
        <!-- Declared explicitly rather than left to the Spring integration, so that anything logged
             at ERROR is captured with its stack trace even when it never reaches an exception
             handler. A swallowed exception that only ever becomes a log line is exactly the failure
             this is meant to catch. -->
        <dependency>
            <groupId>io.sentry</groupId>
            <artifactId>sentry-logback</artifactId>
            <version>${sentry.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
