This version is still in development and is not considered stable yet. For the latest snapshot version, please use Spring AI 1.0.0-SNAPSHOT! |
Observability
Spring AI builds upon the observability features in the Spring ecosystem to provide insights into AI-related operations. Spring AI provides metrics and tracing capabilities for its core components: ChatClient (including Advisors), ChatModel, EmbeddingModel, ImageModel and VectorStore.
Low cardinality keys will be added to metrics and traces, while high cardinality keys will only be added to traces. |
ChatClient
Name |
Description |
|
|
|
|
|
Spring AI kind - |
|
Is the chat model response a stream - |
Name |
Description |
|
Map of advisor parameters. |
|
List of configured chat client advisors. |
|
Is the chat model response a stream. |
|
Chat client system parameters. |
|
Chat client system text. |
|
Enabled tool function names. |
|
List of configured chat client function callbacks. |
|
Chat client user parameters. |
|
Chat client user text. |
ChatClient input data
The ChatClient input data is typically too big to be included in an observation as span attributes. The preferred way to store large data it is as span events, which are supported by OpenTelemetry but not yet surfaced through the Micrometer APIs. Spring AI supports storing these fields as events in OpenTelemetry and will provide a more general event based solution once the issue github.com/micrometer-metrics/micrometer/issues/5238 is resolved.
Property |
Description |
Default |
|
Enables the inclusion of the input content in the observations. This brings the risk of exposing sensitive or private information. Please, be careful! |
|
ChatClient Advisors
Name |
Description |
|
Spring AI kind - |
|
Where the advisor applies it’s logic in the request processing, one of |
Name |
Description |
|
Name of the advisor |
ChatModel
Observability features are currently supported only for ChatModel and EmbeddingModel implementations from the following AI model providers: OpenAI, Ollama, Anthropic, and Mistral. Additional AI model providers will be supported in a future release. |
Name |
Description |
|
The name of the operation being performed. |
|
The model provider as identified by the client instrumentation. |
|
The name of the model a request is being made to. |
|
The name of the model that generated the response. |
Name |
Description |
|
The frequency penalty setting for the model request. |
|
The maximum number of tokens the model generates for a request. |
|
The presence penalty setting for the model request. |
|
List of sequences that the model will use to stop generating further tokens. |
|
The temperature setting for the model request. |
|
The top_k sampling setting for the model request. |
|
The top_p sampling setting for the model request. |
|
Reasons the model stopped generating tokens, corresponding to each generation received. |
|
The unique identifier for the AI response. |
|
The number of tokens used in the model input (prompt). |
|
The number of tokens used in the model output (completion). |
|
The total number of tokens used in the model exchange. |
|
The full prompt sent to the model. |
|
The full response received from the model. |
Chat prompt and completion data
The chat prompt and completion data are typically too big to be included in an observation as span attributes. The preferred way to store large data it is as span events, which are supported by OpenTelemetry but not yet surfaced through the Micrometer APIs. Spring AI supports storing these fields as events in OpenTelemetry and will provide a more general event based solution once the issue github.com/micrometer-metrics/micrometer/issues/5238 is resolved.
Property |
Description |
Default |
|
|
|
|
|
|
EmbeddingModel
Observability features are currently supported only for ChatModel and EmbeddingModel implementations from the following AI model providers: OpenAI, Ollama, Anthropic, and Mistral. Additional AI model providers will be supported in a future release. |
Name |
Description |
|
The name of the operation being performed. |
|
The model provider as identified by the client instrumentation. |
|
The name of the model a request is being made to. |
|
The name of the model that generated the response. |
Name |
Description |
|
The number of dimensions the resulting output embeddings have. |
|
The number of tokens used in the model input. |
|
The total number of tokens used in the model exchange. |
ImageModel
Name |
Description |
|
The name of the operation being performed. |
|
The model provider as identified by the client instrumentation. |
|
The name of the model a request is being made to. |
Name |
Description |
|
The format in which the generated image is returned. |
|
The size of the image to generate. |
|
The style of the image to generate. |
|
The unique identifier for the AI response. |
|
The name of the model that generated the response. |
|
The number of tokens used in the model input (prompt). |
|
The number of tokens used in the model output (generation). |
|
The total number of tokens used in the model exchange. |
|
The full prompt sent to the model. |
Image prompt data
The image prompt data are typically too big to be included in an observation as span attributes. The preferred way to store large data it is as span events, which are supported by OpenTelemetry but not yet surfaced through the Micrometer APIs. Spring AI supports storing these fields as events in OpenTelemetry and will provide a more general event based solution once the issue github.com/micrometer-metrics/micrometer/issues/5238 is resolved.
Property |
Description |
Default |
|
|
|
Vector Stores
All vector store implementations in Spring AI are instrumented to provide metrics and distributed tracing data through Micrometer.
Name |
Description |
|
Spring AI kind - |
|
The database management system (DBMS) product as identified by the client instrumentation. One of |
|
The name of the operation or command being executed. One of |
Name |
Description |
|
The name of a collection (table, container) within the database. |
|
The dimension of the vector. |
|
The name field as of the vector (e.g. a field name). |
|
The metadata filters used in the search query. |
|
The namespace of the database. |
|
The content of the search query being executed. |
|
Returned documents from a similarity search query. Needs to be enabled with auto-configuration and use of OpenTelemetry events. |
|
The metric used in similarity search. |
|
Similarity threshold that accepts all search scores. A threshold value of 0.0 means any similarity is accepted or disable the similarity threshold filtering. A threshold value of 1.0 means an exact match is required. |
|
The top-k most similar vectors returned by a query. |
Vector Store response data
The Vector Store response data are typically too big to be included in an observation as span attributes. The preferred way to store large data it is as span events, which are supported by OpenTelemetry but not yet surfaced through the Micrometer APIs. Spring AI supports storing these fields as events in OpenTelemetry and will provide a more general event based solution once the issue github.com/micrometer-metrics/micrometer/issues/5238 is resolved.
Property |
Description |
Default |
|
|
|