Server SDK

Error monitoring for the JVM

A JVM core plus a Spring Boot auto-configuration starter. On Spring the starter registers a high-precedence exception resolver; on plain JVM apps you configure the core directly.

Frameworks Spring Boot · plain JVMRequires Java 17+Package com.errorgap:errorgap-spring-boot-starterSource ↗Package ↗Agent guide ↗
Install

Install

Add the Spring Boot starter (Maven shown; Gradle is equivalent):

xml
<dependency>
  <groupId>com.errorgap</groupId>
  <artifactId>errorgap-spring-boot-starter</artifactId>
  <version>0.2.0</version>
</dependency>

For non-Spring apps, depend on errorgap-core instead.

Configure

Configure

Spring Boot

In application.properties:

properties
errorgap.endpoint=${ERRORGAP_ENDPOINT}
errorgap.project-slug=${ERRORGAP_PROJECT_SLUG}
errorgap.api-key=${ERRORGAP_API_KEY}
errorgap.environment=production
errorgap.release=@project.version@

Auto-configuration is gated on errorgap.project-slug and registers an MVC HandlerExceptionResolver at the highest precedence, reporting controller exceptions before the framework renders them.

Plain JVM

java
import com.errorgap.Configuration;
import com.errorgap.Errorgap;

Configuration cfg = new Configuration()
    .setEndpoint(System.getenv("ERRORGAP_ENDPOINT"))
    .setProjectSlug(System.getenv("ERRORGAP_PROJECT_SLUG"))
    .setApiKey(System.getenv("ERRORGAP_API_KEY"));
Errorgap.init(cfg);
Keep the key in an environment variable (or your framework's secret store) — never commit it to source control.
Trigger a test error

Trigger a test error

java
@GetMapping("/errorgap-test")
public String errorgapTest() {
    throw new RuntimeException("Errorgap test error");
}
Verify

Verify the connection

Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:

bash
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
  -H "content-type: application/json" \
  -H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
  -d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'

A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.

Next: the full ingestion API, or browse every SDK.