Supported frameworks
Version 0.1. Spring Boot 3 and any Jakarta Servlet container (Tomcat, Jetty, Undertow), OkHttp andjava.net.http.HttpClient.Install
build.gradle.kts
dependencies { implementation("com.codeskop.sdk:codeskop-server:0.1.0")}pom.xml
<dependency> <groupId>com.codeskop.sdk</groupId> <artifactId>codeskop-server</artifactId> <version>0.1.0</version></dependency>Initialize
Call Codeskop.init once at startup. On its own this reports uncaught exceptions on any thread and flushes before the JVM exits.
Codeskop.init(Codeskop.options() .apiKey(System.getenv("CODESKOP_API_KEY")) // cs_live_pk_… (public key) .environment("production"));Spring Boot and Servlet apps
Register CodeskopFilter. Requests are recorded by route pattern (/orders/{id}), unhandled exceptions are reported with their route, and the authenticated principal's name is attached as the user ID.
ShopApplication.java
@SpringBootApplicationpublic class ShopApplication { public static void main(String[] args) { Codeskop.init(Codeskop.options().apiKey(System.getenv("CODESKOP_API_KEY"))); SpringApplication.run(ShopApplication.class, args); } @Bean CodeskopFilter codeskopFilter() { return new CodeskopFilter(); }}Config.kt
@Beanfun codeskopFilter() = CodeskopFilter()Outside Spring, add the filter to your container (web.xml or ServletContext.addFilter) for all paths. Health checks and /actuator/* aren't recorded.
Outgoing calls
// OkHttpOkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new CodeskopOkHttpInterceptor()) .build(); // java.net.http.HttpClientHttpResponse<String> res = CodeskopHttp.send(httpClient, request, HttpResponse.BodyHandlers.ofString());Report errors yourself
try { payments.charge(order);} catch (PaymentException e) { Codeskop.captureException(e, Map.of("provider", "stripe"));} Codeskop.captureMessage("Inventory sync skipped");Codeskop.setUser(user.getId()); // inside a request: your own ID, never an emailOptions
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | String | CODESKOP_API_KEY | The project's public key. Secret keys are refused and the SDK stays off. |
| environment | String | production | Env var CODESKOP_ENVIRONMENT. |
| release | String | auto | Auto-detected from common hosts and CI. Env var CODESKOP_RELEASE. |
| captureRequests / captureOutgoing | boolean | true | Incoming requests / outgoing calls. |
| ignoreRoutes | List | health checks | Glob patterns never recorded. |
| ignoreExceptions | List | [] | Exception class names never sent. |
| beforeSend | Function | none | Edit or drop any event before it's sent. |
| sendUserId | boolean | true | Attach the authenticated principal's name. |
| debug | boolean | false | Log what the SDK does. |
Privacy
Never captured: request or response bodies, cookies, Authorization headers and query strings. See Privacy & Security.