Repository navigation
Description
Problem Description
The qdrant.upsert_points span writes the full Qdrant URL as server.address.
QdrantClient.__init__(src/devops_cli/ai/rag/qdrant.py) keeps the configured URL withurllib.parse.urlunparse(parsed), soself.base_urlkeeps its scheme, its path and any userinfo.upsert_pointssets the span attributeserver.addresstostr(self.base_url).- The OpenTelemetry conventions define
server.addressas the host, andserver.portas the port. A password in the Qdrant URL goes to every exported span. - fix(ai): replies carry their server as an httpx2 origin, so a password in an AI URL stays out of output, the spend ledger, metrics, spans and cache #1110 fixes the same defect for the AI URLs: it takes
server.addressandserver.portfromhttpx2.URL(url).originwith the helperorigin_span_attributesinsrc/devops_cli/ai/client/models.py.
Reproduction Steps
- Configure the Qdrant URL as
http://<masked-user>:<masked-password>@example.com:6333. - Index a repository so that the client calls
upsert_points. - Read the
qdrant.upsert_pointsspan.
Expected vs Actual Behavior
- Expected:
server.addressisexample.comandserver.portis 6333. No span attribute holds the password. - Actual:
server.addressishttp://<masked-user>:<masked-password>@example.com:6333, and the span has noserver.port.
Environment Diagnostics
Found by reading the code at 4226904e, while the change for #1110 was planned. A k8s:// Qdrant address names a Service, so the fix must also decide what that address writes.
Logs, Traces, or Terminal Output
None. The defect is in src/devops_cli/ai/rag/qdrant.py, in the attributes of the qdrant.upsert_points span.
Proposed design
Problem statement
The qdrant.upsert_points span writes the full Qdrant URL, including any userinfo, as server.address. A password in the URL leaks into every exported span. The span also lacks server.port. The fix must write only the host and port, per the OpenTelemetry server conventions, and must handle k8s:// addresses that name a Service.
Acceptance criteria
Requirement: server.address holds only the host
The qdrant.upsert_points span SHALL set server.address to the host of the Qdrant URL, with no scheme, userinfo, or path.
Scenario: URL with userinfo
- WHEN The Qdrant URL is
http://user:[email protected]:6333and upsert_points runs - THEN server.address is example.com and no span attribute contains the string secret
Requirement: server.port holds the port
The qdrant.upsert_points span SHALL set server.port to the port of the Qdrant URL when the URL names a port.
Scenario: URL with explicit port
- WHEN The Qdrant URL is
http://example.com:6333and upsert_points runs - THEN server.port is 6333
Requirement: k8s address writes the Service name
When the Qdrant URL uses the k8s:// scheme, the span SHALL set server.address to the Service name and server.port to the port, with no userinfo.
Scenario: k8s Service URL
- WHEN The Qdrant URL is k8s://qdrant.devops:6333 and upsert_points runs
- THEN server.address is qdrant.devops and server.port is 6333
Existing Tool Considered
httpx2 provides URL(...).origin, which extracts scheme, host, and port with no userinfo. The project already has origin_span_attributes in src/devops_cli/ai/client/models.py, added by #1110, that formats an httpx2.Origin into the correct server.address and server.port span attributes. The fix calls this existing helper. No new code is built.
Key questions
- Which helper extracts server.address and server.port from the Qdrant URL for the span?: Use origin_span_attributes from src/devops_cli/ai/client/models.py with httpx2.URL(self.base_url).origin. This is the same pattern fix(ai): replies carry their server as an httpx2 origin, so a password in an AI URL stays out of output, the spend ledger, metrics, spans and cache #1110 established for AI client URLs. (best practice) [sources: src/devops_cli/ai/client/models.py:133, openspec/changes/archive/2026-10-28-1110-reply-server-origin/design.md:12]
- Chosen: origin_span_attributes with httpx2.URL origin. Already exists, already tested, matches the fix(ai): replies carry their server as an httpx2 origin, so a password in an AI URL stays out of output, the spend ledger, metrics, spans and cache #1110 pattern, strips userinfo by construction.
- Rejected: urllib.parse.urlparse and manual host/port extraction. Duplicates logic that origin_span_attributes already provides. Adds a second code path to keep.
- Rejected: Write a new helper in rag/qdrant.py. The helper already exists in ai/client/models.py. A second copy would drift.
- What does the span write for a k8s:// Qdrant address?: Write the Service name as server.address and the port as server.port. A k8s:// URL has no userinfo, so no credential leaks. The Service name identifies the logical target. The actual API server is resolved at connection time in _build_client and is not the span's concern. (best practice) [sources: src/devops_cli/ai/rag/qdrant.py, src/devops_cli/k8s/service_proxy.py]
- Chosen: Write the Service name and port from the k8s:// URL. No userinfo to leak. Identifies the logical target. Consistent with the http:// case.
- Rejected: Resolve the proxy connection and write the API server host and port. Requires calling resolve_proxy_connection in the span path, which adds a kubeconfig read to every upsert span. The API server is an implementation detail of the proxy, not the Qdrant target.
- Rejected: Omit server.address and server.port for k8s:// URLs. Loses the ability to identify which Service the span targeted. The Service name is safe to export.
- Does the search_points span in the same file also write the full URL?: No. The ai.rag.qdrant_search span in search_points does not set server.address or server.port at all. Only the qdrant.upsert_points span has the defect. [sources: src/devops_cli/ai/rag/qdrant.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
A credential in a URL leaks into exported span attributes, which is a security defect.The leak is limited to telemetry exports and does not expose data to end users, so it is not P1.Preventing a password from appearing in every exported span protects credential hygiene.The fix changes one span-attribute block in one file to parse host and port from the URL.Both remove a password from span attributes, but #1110 fixes AI client URLs while the candidate fixes the qdrant.upsert_points span in rag/qdrant.py.fix(ai): a reply names its server by the origin of the URL called, so…
devops-cli-service commentedon Oct 29, 2026
Status set to Ready at 0f7bc26 (see proposed design in issue body).
chore(main): release 0.21.0 (#2711)