Spring Boot

Altix ErrorTrack utilise le protocole Sentry : vous pouvez donc vous servir du SDK officiel io.sentry:sentry-spring-boot-starter. Les extraits ci-dessous utilisent un DSN d'exemple ; la page de configuration de votre projet les affiche avec votre véritable DSN.

  1. Installer le SDK

    Ajoutez io.sentry:sentry-spring-boot-starter, le SDK Sentry officiel. Il fonctionne sans aucune modification avec Altix ErrorTrack.

    groovy

    // build.gradle
    implementation 'io.sentry:sentry-spring-boot-starter:8.61.1'
  2. Le configurer

    Initialisez le SDK le plus tôt possible dans votre application, à l'aide de votre DSN.

    src/main/resources/application.properties

    sentry.dsn=https://<public-key>@errortrack.altixcode.com/<project-id>
    sentry.release=my-app@1.0.0
    sentry.traces-sample-rate=1.0
  3. Vérifier

    Déclenchez volontairement une erreur. Elle apparaîtra dans votre flux de problèmes en quelques secondes.

    java

    @GetMapping("/debug-errortrack")
    public String fail() {
      throw new IllegalStateException("My first ErrorTrack error");
    }

Créez un projet et sa page de configuration préremplira votre véritable DSN.