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

Pull latest Phoenix image from Docker Hub:
Run your containerized instance:
This command:
  • Exposes port 6006 for the Phoenix web UI
  • Exposes port 4317 for the OTLP gRPC endpoint (where traces are sent)
For more info on using Phoenix with Docker, see Docker.
If you are using Phoenix Cloud, adjust the endpoint in the code below as needed.

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