Spring AI Observability with LangSmith, OpenTelemetry, and Arconia
Integrate a Spring AI application with LangSmith for dedicated AI observability, using OpenTelemetry and Arconia.
Observability is a key property of any production-grade application. Even more so for AI-infused applications, given the complexity and non-determinism of Generative AI-driven workflows. What prompt is sent to the model? What parameters were used? How many tokens were consumed in the interaction with an inference service? Which tool did the model request to execute?
In this article, I'll show you how to configure observability for Spring AI applications. We'll be using:
- OpenTelemetry for gathering and exporting traces from the Java application;
- LangSmith, an AI observability cloud platform offered by the company behind LangChain;
- Arconia for adding full OpenTelemetry support to Spring Boot (including support for the OpenTelemetry Semantic Conventions for Generative AI in the flavor used by LangSmith).
Spring AI Observability
The Spring AI project provides built-in instrumentation for models, vectors, and workflows based on the Micrometer APIs. In fact, I designed and implemented the main observability features in Spring AI, and continue working on it to improve and extend it.
The beauty of the Micrometer APIs is that you instrument your code once and then generate different observability signals, including logs, metrics, and traces. Micrometer also allows changing the conventions used by the instrumentation, adapting the exported telemetry to the specific backend.
Arconia builds on top of that built-in instrumentation to provide multiple semantic-convention modules, making it straightforward to target different AI observability platforms without changing any instrumentation code.
LangSmith
LangSmith is a cloud platform from LangChain that supports AI-infused applications, including observability, evaluation, prompt management, and deployments.
The observability features support OpenTelemetry, enabling traces to be shipped to LangSmith from any application. The conventions adopted by LangSmith are built on the experimental OpenTelemetry Semantic Conventions for Generative AI, with some changes and additions. Arconia offers out-of-the-box support for the LangSmith-flavored conventions, so that you can integrate your Spring AI application with LangSmith without the need for changing any code.
LangSmith is an enterprise cloud platform that requires a subscription. To evaluate the platform, you can create a free account here. LangSmith runs on the Google Cloud Platform (GCP) and Amazon Web Services (AWS). When you register for an account, you can choose in which cloud vendor and region you want your account to be provisioned. For example, if you live in the European Union, you'll probably want to choose the EU region in GCP.
Once you have logged into LangSmith, go to the "Tracing" page and create a new project named spring-ai-langsmith. That's what we'll use in the rest of this article. After creating the project, you'll be redirected to the "Tracing" page for that project, where you'll find a "Generate API Key" button you need to click to obtain an API Key you'll need later when configuring your application.
In the next section, I'll show you how that integration works.
Quick Start
Let's build an AI-infused Java application with Spring AI using Ollama as the model inference service and LangSmith as the observability backend. The application and inference service will run on your local machine based on open-source software, whereas the observability platform will run in the cloud.
1. Project Setup
For this example, I'll use Spring Boot 4.0, Spring AI 2.0, Gradle, and Java 25. Here's how the dependencies section of your build.gradle file should look:
dependencies {
implementation 'io.arconia:arconia-opentelemetry-ai-semantic-conventions'
implementation 'io.arconia:arconia-opentelemetry-spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.ai:spring-ai-starter-model-ollama'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testAndDevelopmentOnly 'io.arconia:arconia-dev-services-ollama'
testImplementation "org.springframework.boot:spring-boot-starter-webmvc-test"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
dependencyManagement {
imports {
mavenBom "io.arconia:arconia-bom:0.27.1"
mavenBom "org.springframework.ai:spring-ai-bom:2.0.0-M6"
}
}
The key dependencies are:
arconia-opentelemetry-spring-boot-starter: Arconia OpenTelemetry simplifies observability for Spring Boot applications by combining the standardization of OpenTelemetry with the robustness of Micrometer to deliver a unified solution that covers all your telemetry needs for Java.arconia-opentelemetry-ai-semantic-conventions: Arconia Semantic Conventions bring to Spring AI support for the OpenTelemetry Semantic Conventions for Generative AI, including the specific flavor used by LangSmith.
Ollama is an open-source platform for running model inference services locally, keeping your data private. It's available as a native application for macOS, Linux, and Windows. Follow the download instructions to install Ollama. It includes built-in GPU acceleration, so performance will vary depending on the resources available on your computer.
Using Ollama, you can run any large language model locally, choosing from the many options available in the model library. We will use open-source models from Mistral AI's Ministral family.
2. Configuring the Model Inference Service
For this example, we'll use the ministral-3:3b chat model built by Mistral AI. It's an open-source model (Apache 2.0) that's available for direct serving in Ollama.
You can specify the model via configuration properties in the application.yml or application.properties file of your application. You can also instruct Spring AI to download the model for you via Ollama in case it's not already available on your machine.
Make sure you also specify a name for the application, as that information will be used to categorize the telemetry data exported.
spring:
application:
name: spring-ai-langsmith
ai:
ollama:
init:
pull-model-strategy: when-missing
embedding:
include: false
chat:
model: ministral-3:3b
3. Building a Chat Client
Let's now implement an HTTP endpoint we can call to interact with a chat model. Spring AI provides the ChatClient API that we can use to send chat requests to an inference service. Since our project is configured with Ollama, the ChatClient is auto-configured to interact with that.
@RestController
class ChatController {
private final ChatClient chatClient;
ChatController(ChatClient.Builder chatClientBuilder) {
this.chatClient = chatClientBuilder.build();
}
@GetMapping("/chat")
String chat(String question) {
return chatClient
.prompt(question)
.call()
.content();
}
}
ChatClient API in the documentation.4. Configure the LangSmith Integration
The arconia-opentelemetry-ai-semantic-conventions dependency provides out-of-the-box support for the OpenTelemetry Semantic Conventions for Generative AI. LangSmith reuses some of them but also adopts additional conventions. Furthermore, in some cases, it uses conventions that conflict with the upstream OpenTelemetry conventions.
Arconia takes that into account and offers the possibility to choose which flavor to use for the conventions, based on specific requirements dictated by the given AI observability platform in use. You can enable the LangSmith flavor via configuration properties in the application.yml or application.properties file of your application.
arconia:
observations:
conventions:
opentelemetry:
ai:
flavor: langsmith
Finally, you need to configure OpenTelemetry to publish traces (which will follow the LangSmith semantic conventions) to a LangSmith platform. Since LangSmith doesn't support logs and metrics, we will disable their export.
arconia:
otel:
exporter:
otlp:
endpoint: "https://eu.api.smith.langchain.com/otel"
headers:
"x-api-key": "${LANGSMITH_API_KEY}"
"Langsmith-Project": "spring-ai-langsmith"
logs:
enabled: false
metrics:
enabled: false
https://api.smith.langchain.com/otel as the endpoint.5. Running the Application
It's time to see the example in action. If you have installed Ollama, ensure it's up and running. Then, fire up your app using the standard Spring Boot command for Gradle:
export LANGSMITH_API_KEY=<your-langsmith-api-key>
./gradlew bootRun
Or, if you prefer using the Arconia CLI:
export LANGSMITH_API_KEY=<your-langsmith-api-key>
arconia dev
If a native Ollama service is detected running on your machine, it will be used. Otherwise, Arconia Dev Services will automatically start an Ollama container as well when the application runs.
6. Calling the application
Let's verify the application is working as expected. For this example, I'll use httpie, a command-line HTTP client that makes it easy to interact with HTTP APIs.
From a Terminal window, call the /chat endpoint with a question you'd like the model to answer:
http :8080/chat question=="What is the capital of Italy?" -b
Feel free to send a few different requests so that the application, under the hood, generates various tracing data and sends it to LangSmith.
7. Inspecting the telemetry data
Finally, it's time to gain insights into how our application interacted with the inference service. Navigate to the "Tracing" page. Here you’ll find all the data from the application's traces. You can gain more insights into how the application interacted with Ollama by expanding the spans named chat ministral-3:3b.
LangSmith renders the different details of the LLM operation, including token usage, model, prompt, and response. In this example, you can see that no cost information is shown. That’s because we’re using Ollama and running the entire system locally, so there’s no token cost. If you replace Ollama with a cloud inference service, LangSmith will also show the cost.

Now navigate to the "Monitoring" page in LangSmith, where you should see the default dashboard for LLM interactions, showing statistics based on metrics that LangSmith generates automatically from the traces data.

The content of the prompt and response can be sensitive. When using the LangSmith flavor of the OpenTelemetry Semantic Conventions, Arconia enables the capturing of prompt and response content to align with the default behavior in the LangSmith SDK for Python and TypeScript. You can always disable that via configuration properties in the application.yml or application.properties file of your application.
arconia:
observations:
conventions:
opentelemetry:
ai:
capture-content: none
You can check the documentation to learn about all the available configuration properties.
Conclusion
In this article, I showed you how to integrate a Spring AI application with LangSmith for dedicated AI observability.
Building on the out-of-the-box instrumentation in Spring AI, I covered how Arconia enables adopting different semantic conventions for telemetry data without changing any code, including the flavor used by LangSmith.
Are you using Spring AI? What's your current strategy for observability? Have you tried LangSmith? I'd love to hear from you! Share your experience on Bluesky or LinkedIn. And if you'd like to contribute to the Arconia framework, feel free to reach out on our GitHub project!
First version published on May 20th, 2026.