liveBook · Manning

Vector store operation metric

As explained in Spring AI in Action

The vector store operation metric records counts and durations of operations performed against vector stores.

The vector store operation metric records how often vector-store operations run and how long they take. Spring Boot Actuator exposes it at /actuator/metrics/db.vector.client.operation, where measurements and filterable tags support operational inspection. section 9.1.1 section 9.1

Read the metric through three measurements and operation tags:

  • COUNT reports the number of vector-store operations. section 9.1.1
  • TOTAL_TIME reports the combined duration in seconds, while MAX reports the longest individual operation. section 9.1.1
  • Filter with db.operation.name for add, delete, or query; db.system identifies stores such as Qdrant, and spring.ai.kind identifies vector_store. section 9.1.1

Inspect add operations

After exposing the health and metrics endpoints, request /actuator/metrics/db.vector.client.operation?tag=db.operation.name:add with an HTTP client. The response can isolate add-operation counts and durations. section 9.1.1 section 9.1

$ http :8080/actuator/metrics/db.vector.client.operation -b
{
  "name": "db.vector.client.operation",
  "baseUnit": "seconds",
  "measurements": [
    { "statistic": "COUNT", "value": 4.0 },
    { "statistic": "TOTAL_TIME", "value": 1.872260833 },
    { "statistic": "MAX", "value": 0.638242833 }
  ],
  "availableTags": [
    { "tag": "db.system", "values": [ "qdrant" ] },
    { "tag": "spring.ai.kind", "values": [ "vector_store" ] },
    { "tag": "error", "values": [ "none" ] },
    { "tag": "db.operation.name", "values": [ "add", "query" ] }
  ]
}

Use the sample response to connect COUNT, TOTAL_TIME, MAX, and availableTags to an actual Qdrant-backed metric. section 9.1.1

How Spring AI in Action covers it

How deep it goes
Defines measurements, tags, and HTTP filtering, but stops short of implementation internals.
Examples
Uses Qdrant add and query operations, JSON metric responses, and HTTPie tag-filtered requests.
What it assumes
Assumes a running Spring Boot application with Actuator metrics exposed over HTTP.
What you can do after
Diagnose vector-store workload and latency by querying measurements and filtering operations by tags.
How it connects
Connects vector stores with Spring Boot Actuator, Spring AI, metrics endpoints, and Qdrant.

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.