Skip to main content

Prerequisites

  • Java 11 or higher
  • (Optional) Phoenix API key if using auth

Add Dependencies

1. Gradle

Add the dependencies to your build.gradle:

Setup Phoenix

Run Phoenix on your own infrastructure, backed by PostgreSQL so traces persist beyond a single process. This is the option to reach for once Phoenix is shared across a team or environment.The self-hosting guide covers Kubernetes, Helm, Railway, AWS CloudFormation, Google Cloud Run, Azure, and Render, plus authentication and configuration.
Phoenix serves its UI and OTLP HTTP on port 6006, and OTLP gRPC on port 4317. For a local instance that’s http://localhost:6006 — leave it running while you work.
If your Phoenix instance isn’t running on localhost, adjust the endpoint in the code below as needed. If it has authentication enabled, also set PHOENIX_API_KEY to an API key from its Settings page.

Configuration for Phoenix Tracing

Run Spring AI

By instrumenting your application, spans will be created whenever it is run and will be sent to the Phoenix server for collection.

Observe

Once configured, your OpenInference traces will be automatically sent to Phoenix where you can:
  • Monitor Performance: Track latency, throughput, and error rates
  • Analyze Usage: View token usage, model performance, and cost metrics
  • Debug Issues: Trace request flows and identify bottlenecks
  • Evaluate Quality: Run evaluations on your LLM outputs

Resources

Full Example

OpenInference package