All SDKs

Java / Spring Boot

v0.4.0

sa.allstak:allstak-spring-boot-starter

AllStak/allstak-java-sdk

AllStak SDK for Java and Spring Boot. Captures exceptions, logs, inbound and outbound HTTP requests, spans, JDBC and reactive DB queries, scheduled jobs, message-queue work, cache calls, GraphQL operations, release-health sessions, and continuous JVM profiles.

One package, everything covered

<dependency>
  <groupId>sa.allstak</groupId>
  <artifactId>allstak-spring-boot-starter</artifactId>
  <version>0.4.0</version>
</dependency>

That is the entire dependency surface a Spring Boot consumer has to learn.

The starter pulls every AllStak instrumentation glue module transitively (~190 KB total), but none of their underlying third-party libraries (OkHttp, Apache HTTP 5, Kafka clients, MongoDB driver, Lettuce, Jedis, Quartz, …). Each instrumentation lights up automatically the moment your existing classpath already includes the matching library — @ConditionalOnClass is the gate.

What auto-activates when

Each integration below is attached automatically by the starter — you register your normal bean and get the telemetry with no per-call code. The starter detects the library on your classpath (@ConditionalOnClass) and wires the AllStak interceptor onto the relevant client/factory bean.

If your app uses…AllStak activatesGate (default ON)
Spring MVC / ServletInbound HTTP capture + scope per requestcapture-http-requests
RestTemplate / WebClientOutbound HTTP span + trace headers(on with web)
OkHttpInterceptor attached to every OkHttpClient beancapture-ok-http
Apache HttpClient 5Interceptors attached to every HttpClientBuilder beancapture-apache-http
OpenFeignRequestInterceptor bean (trace-header injection)capture-feign
Project ReactorScope propagation across thread hopscapture-reactor
@ScheduledCron check-ins, error capturecapture-scheduled
QuartzJobListener attached to every Scheduler beancapture-quartz
Spring Kafka (DefaultKafka*Factory)Producer + consumer interceptor appended to factoriescapture-kafka
Spring SecurityAuthenticated principal → scope usercapture-security-user
JDBC DataSourceSpan per querycapture-db-queries
Spring Data Redis (Lettuce)Tracing wired into auto-configured ClientResourcescapture-lettuce
Spring Data MongoDB driverCommand listener added to the Mongo clientcapture-mongodb
Spring CacheSpan per get / put / evictcapture-spring-cache
graphql-java / Spring GraphQLInstrumentation bean → span per operationcapture-graphql
gRPC (io.grpc.ServerBuilder bean)Server interceptor registered (inbound trace context)capture-grpc
Logback / Log4j2Logs → events / breadcrumbscapture-logs
Java Flight RecorderContinuous CPU profile (opt-in)enable-profiling (off)

Disable any one with its gate property set to false (e.g. allstak.capture-kafka=false); everything is on by default when its library is present.

Note on Kafka / Lettuce / MongoDB. Auto-attachment for these uses the Spring integration beans (spring-kafka, spring-data-redis, spring-data-mongodb). When you use the raw kafka-clients, lettuce-core, or MongoDB driver directly — without the matching Spring integration — wire the interceptor at the point you build the client using the helper documented on each module's class.

Helper-based modules (manual wiring)

These ship as instrumentation helpers rather than auto-attached beans, because there is no safe, side-effect-free attachment point Spring can hook into for them. Call the helper where you build the client / handle the message:

ModuleHow to wire
gRPC clientchannelBuilder.intercept(new AllStakGrpcClientInterceptor())
JedisAllStakJedisInstrumentation.timed("GET", () -> jedis.get(key))
R2DBCProxyConnectionFactory.builder(cf).listener(new AllStakR2dbcProxyListener())
JMSAllStakJmsTrace.stamp(msg) / AllStakJmsTrace.harvest(msg)
RabbitMQAllStakRabbitTrace on publish / consume
Kotlin coroutinesScopeSnapshot helper across suspension points
OpenTelemetry SDKSpanProcessor bridge into AllStak

Plain Java (no Spring Boot)

<dependency>
  <groupId>sa.allstak</groupId>
  <artifactId>allstak-java-core</artifactId>
  <version>0.4.0</version>
</dependency>

Then wire individual instrumentation modules where your code constructs the third-party client. See each module's README under the repo root for a one-liner example.

Plain Java setup

import dev.allstak.AllStak;
import dev.allstak.AllStakConfig;

AllStak.init(AllStakConfig.builder()
    .apiKey(System.getenv("ALLSTAK_API_KEY"))
    .environment("production")
    .release(System.getenv("ALLSTAK_RELEASE"))
    .serviceName("worker")
    .build());

AllStak.captureLog("info", "worker started");
AllStak.captureException(new RuntimeException("checkout failed"));
AllStak.flush();
AllStak.shutdown();

Configuration

PropertyDescription
allstak.api-keyProject API key.
allstak.enabledEnables or disables auto-configuration.
allstak.environmentDeployment environment.
allstak.releaseApp version or commit SHA.
allstak.service-nameLogical service name.
allstak.capture-http-requestsCaptures inbound requests.
allstak.capture-exceptionsCaptures exceptions.
allstak.capture-logsCaptures logs.
allstak.capture-db-queriesCaptures JDBC queries.
allstak.capture-ok-httpAttaches the interceptor to OkHttpClient beans.
allstak.capture-apache-httpAttaches interceptors to HttpClientBuilder beans.
allstak.capture-kafkaAppends trace interceptors to Spring Kafka factories.
allstak.capture-lettuceWires Redis command tracing (Spring Data Redis).
allstak.capture-mongodbAdds the Mongo command listener (Spring Data MongoDB).
allstak.capture-graphqlExposes the graphql-java Instrumentation bean.
allstak.capture-grpcRegisters the gRPC server interceptor on ServerBuilder beans.

Every capture-* gate defaults to true and only takes effect when the matching library is present. Set any to false to opt out.

Privacy

The SDK redacts common sensitive headers and fields. Avoid putting secrets in custom metadata or log messages.

Troubleshooting

  • No events: confirm ALLSTAK_API_KEY is available to the JVM.
  • Missing Spring telemetry: confirm the starter dependency is on the runtime classpath.
  • Missing outbound traces: use Spring-managed RestTemplate or WebClient beans.

Contributing and Support

License

MIT