feat: Add readUnits, upsertedCount, and matchedRecords to ResponseMetadata#218
Open
rasharab wants to merge 3 commits intopinecone-io:mainfrom
Open
feat: Add readUnits, upsertedCount, and matchedRecords to ResponseMetadata#218rasharab wants to merge 3 commits intopinecone-io:mainfrom
rasharab wants to merge 3 commits intopinecone-io:mainfrom
Conversation
Agent-Id: agent-99b8efc1-3adb-4099-8683-03d0a3351bed Linked-Note-Id: b55dbb0b-4a64-437e-93bd-f29d287c9b0c
Agent-Id: agent-e63157ed-432d-4883-9f3e-1895a0b24e7a
Agent-Id: agent-3f21d110-2d0f-42e3-aae2-b6331803d85a
rasharab
commented
Mar 27, 2026
| // Operations to track (matches VectorService RPC method names) | ||
| private static final Set<String> TRACKED_OPERATIONS = new HashSet<>(Arrays.asList( | ||
| "Upsert", "Query", "Fetch", "Update", "Delete" | ||
| "Upsert", "Query", "Fetch", "Update", "Delete", "List" |
Contributor
Author
There was a problem hiding this comment.
We use a LOT of list operations. This is necessary for us.
Contributor
Author
|
FYI @jhamon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BACKGROUND:
Our company is using your listener pattern for Otel metrics, but there's just not enough valuable information for us.
We're adding fields we consider necessary for our operations.
Adds usage and operation-result fields to ResponseMetadata so users can track read units, upserted count, and matched records via the metadata listener.
Changes:
Note
Medium Risk
Medium risk because it changes the gRPC interceptor to reflectively parse response bodies during
onMessage(), which could affect performance or subtly vary by response type; failures are handled by returning nulls with debug logging.Overview
Adds richer per-request observability metadata by extending
ResponseMetadatawith three new nullable fields:readUnits,upsertedCount, andmatchedRecords, including builder setters, getters, andtoString()output only when present.Enhances metadata capture in the gRPC client interceptor by tracking
Listoperations and extracting the new fields from response messages via reflection duringonMessage(), then emitting them through the existing response-metadata listener.Updates README documentation/examples and expands unit test coverage to validate defaults, builder wiring, and
toString()behavior for the new fields.Written by Cursor Bugbot for commit a164dee. This will update automatically on new commits. Configure here.