Your first trace in five minutes

You need JDK 21+, Spring Boot 4.1 on MVC or WebFlux, React 18 or 19, and Node 22. The starter is on Maven Central and the SDK on npm.

Spring Boot

Add the starter

One dependency. No agent, no extra process.

<dependency>
  <groupId>dev.causeline</groupId>
  <artifactId>causeline-spring-boot</artifactId>
  <version>0.1.0-alpha.5</version>
</dependency>
Spring Boot

Switch it on in dev

Causeline is off unless causeline.enabled is true, and it refuses to start under a prod or production profile. Keep it in a dev or QA profile.

src/main/resources/application-dev.yml
causeline:
  enabled: true

Using Spring Security? Permit /causeline/**. Causeline protects those paths with its own access token.

Spring Boot

Start and open the UI

Run the app with the dev profile. The log prints a link with a fresh access token. Open it, then call any endpoint.

Terminal
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev
Application log
INFO Causeline UI: http://localhost:8080/causeline/?token=…
React

Add the React SDK

The provider does nothing in production builds, so it’s safe to leave in. If your dev server runs on another port, proxy /api and /causeline to Spring Boot.

Terminal
npm install @causeline/react
main.tsx
import { CauselineProvider } from '@causeline/react';

createRoot(root).render(
  <CauselineProvider endpoint="/causeline/api/spans">
    <App />
  </CauselineProvider>,
);
React

Name the click

Wrap a handler in trace(). Click the button, open the newest trace in /causeline, and the click, the request, the Spring Boot spans and the state update are on one timeline.

Checkout.tsx
import { trace, useTracedState } from '@causeline/react';

const [status, setStatus] = useTracedState('checkoutStatus', 'idle');
const onCheckout = () =>
  trace('Checkout', async () => {
    const res = await fetch('/api/orders', { method: 'POST', body });
    setStatus(res.ok ? 'paid' : 'failed');
  });
Optional

Next.js and tests

Trace the Next.js server too: route handlers, server actions, rendering and its calls to Spring join the same trace. Start Next.js with CAUSELINE_TOKEN set to the Spring app’s access token.

instrumentation.ts
export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    const { registerCauseline } = await import('@causeline/next');
    registerCauseline({ serviceName: 'storefront' });
  }
}

Guard what you saw in a JUnit test with causeline-test in test scope.

pom.xml
<dependency>
  <groupId>dev.causeline</groupId>
  <artifactId>causeline-test</artifactId>
  <version>0.1.0-alpha.5</version>
  <scope>test</scope>
</dependency>
Optional

Python and AI

With Spring AI 2.0 in your app, model calls and vector searches join the timeline with no setup. If your Spring Boot app calls a FastAPI service, add the Python library to put that service in the same trace. LangChain chat calls and retriever runs appear in the RAG panel.

Terminal
pip install "causeline[langchain]"
app.py
import causeline
from fastapi import FastAPI

causeline.init(endpoint="http://localhost:8080", service="ai-service")  # token: CAUSELINE_TOKEN
app = FastAPI()
causeline.instrument(app)

Python spans go to the Causeline in your Spring Boot app, so you need its access token and Causeline 0.1.0-alpha.5 or later. Call the service with a client built from Spring’s RestClient.Builder or WebClient.Builder so the request carries traceparent. The library is off by default and stays off in production.