Java SDK

Spring Boot, Spring MVC, and any Jakarta Servlet 6.1 container.

Add the nolax-sdk dependency and register a servlet filter. The Spring Boot example is below.

Maven artifact: net.nolax:nolax-sdk:1.1.0

Ingest contract: v1.1

Supported environments

EnvironmentStatus
Spring BootSupported
Spring MVCSupported
Tomcat, Jetty, UndertowSupported

Maven

xml
<dependency>
  <groupId>net.nolax</groupId>
  <artifactId>nolax-sdk</artifactId>
  <version>1.1.0</version>
</dependency>

Spring Boot (filter)

java
@Bean
public FilterRegistrationBean<NolaxFilter> nolaxFilter() {
  NolaxProperties props = NolaxProperties.builder()
      .apiKey(System.getenv("NOLAX_API_KEY"))
      .environment("production")
      .build();

  FilterRegistrationBean<NolaxFilter> reg = new FilterRegistrationBean<>();
  reg.setFilter(new NolaxFilter(props));
  reg.addUrlPatterns("/*");
  return reg;
}

Gradle

groovy
implementation 'net.nolax:nolax-sdk:1.1.0'

Configuration

NolaxProperties.builder() takes the same options as the other SDKs: endpoint, batchSize (100), flushIntervalMs (2000), maxQueueSize (10,000), maxInFlight (4), release, service, consumer, captureIp, captureUserAgent, ipHeader, ignorePaths, ignoreMethods, beforeSend, dryRun, debug and an error listener.

Flushing on shutdown

When the container destroys the filter, it flushes queued events for at most two seconds.

Troubleshooting

  • Raw path shown: the servlet request had no route pattern, so the SDK uses getRequestURI().
  • payloadSize is 0: the response had no Content-Length header.
  • Flush failures: check network access and outbound rules to server.nolax.net.

See also Batching and Retries and What the SDK Sends.