Skip to content

fix(rag): the Qdrant upsert span names its server by host and port, never by the full URL with its userinfo #2459

Description

@dan-petty

Problem Description

The qdrant.upsert_points span writes the full Qdrant URL as server.address.

Reproduction Steps

  1. Configure the Qdrant URL as http://<masked-user>:<masked-password>@example.com:6333.
  2. Index a repository so that the client calls upsert_points.
  3. Read the qdrant.upsert_points span.

Expected vs Actual Behavior

  • Expected: server.address is example.com and server.port is 6333. No span attribute holds the password.
  • Actual: server.address is http://<masked-user>:<masked-password>@example.com:6333, and the span has no server.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]:6333 and 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:6333 and 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]
  • 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

  1. added
    source/agent
    type/security
    status/new
    value/medium
    effort/low
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/security. A credential in a URL leaks into exported span attributes, which is a security defect.
    • Priority: P2-Medium. The leak is limited to telemetry exports and does not expose data to end users, so it is not P1.
    • Value: Medium. Preventing a password from appearing in every exported span protects credential hygiene.
    • Effort: Low. The fix changes one span-attribute block in one file to parse host and port from the URL.
    • Related: 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, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. added
    status/ready
    and removed
    status/new
    on Oct 29, 2026
  5. devops-cli-service commented on Oct 29, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 0f7bc26 (see proposed design in issue body).

  6. added a commit that references this issue on Oct 30, 2026
  7. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumsource/agenttype/securityvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions