postgres: stream Remote Queries COPY output to the Agent relay - #24925
Merged
nubtron merged 2 commits intoAug 27, 2026
Conversation
Extend the Postgres remote query COPY stream with an optional resultDelivery instruction (mode POC_PUBLIC_CHUNKED_UPLOAD). When present, the integration feeds bounded COPY bytes through the existing native emit callback to the Agent-owned upload transport: chunks are sized by resultDelivery.chunkBytes, capped by resultDelivery.maxBytes, and carry a SHA-256 digest; the STARTED event carries the sanitized upload-session handle (uploadId only) and the final event carries a compact provisional uploadReceipt aligned to the Agent-owned receipt shape. Python never receives the upload baseUrl, scoped token, or API/app keys and performs no HTTP upload; the Agent Go side retains those secrets. Omitting resultDelivery keeps the inline streaming behavior unchanged.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: bf9d874 | Docs | View more details | Give us feedback! |
…tion Replace the emit-callback upload bridge with direct HTTP upload to its-agent-intake from the Postgres Python integration. When resultDelivery is present, the integration PUTs bounded COPY chunks straight to the intake over HTTP using the base URL and scoped upload token forwarded through the native bridge plus the org API key and POC application key read from Agent config via datadog_agent.get_config. Bulk chunk bytes no longer traverse the native emit bridge, AgentSecure, PAR, or AP action output; only metadata/final/error events cross back. The integration owns chunking, per-chunk sha256, the HTTP PUT with retry on transient 408/429/5xx, finalize, and best-effort abort on failure. RemoteQueryResultDelivery now accepts and requires baseUrl and token. execute_agent_rpc_stream_copy routes upload-mode requests to a new _execute_upload_stream that drives the existing chunk iterator but sinks data events to an injectable _UploadClient (production uses requests; tests inject a fake). Omitting resultDelivery keeps the inline streaming path unchanged.
Contributor
Validation ReportAll 21 validations passed. Show details
|
evalya-impact-summaryevalya impact analysis |
3 tasks
Collaborator
Author
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.
Stack
nubtron/remote-queries-pocSummary
Validation
Deployment
Used only by the local Remote Queries intake proof setup; no shared deployment.