Skip to content

Export OpenTelemetry client spans for the native remote cache #906

Open

Description

@jasonkuhrt

Written by an AI agent (Codex) on behalf of @jasonkuhrt.

Problem

Users with an instrumented remote cache server cannot connect its requests to the vp run clients that made them. Native cache fetch, store and blob-download requests currently have neither exported OpenTelemetry client spans nor propagated W3C trace context, so those callers are missing from trace-based service maps.

Proposed capability

Allow vp run to export its native remote-cache HTTP client spans through standard OTLP/HTTP configuration. For example, with a collector configured in the command's environment:

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
  OTEL_SERVICE_NAME=build-client \
  vp run build --remote-cache read-write

The instrumented cache server should receive a traceparent identifying the exported client span. A tracing backend can then connect the caller to its cache server.

The proposed behavior is opt-in when an OTLP endpoint is configured, honors the standard service/resource/header/protocol variables and export opt-outs, and flushes at session completion, including a failed task. A normal cache miss remains successful cache behavior. Exported attributes exclude cache credentials, keys, payloads and error-response contents; an unavailable collector must not fail the task run.

Current implementation

The HTTP transport lives in crates/vt_remote_cache/src/lib.rs; RemoteClients in crates/vt/src/session/cache/remote.rs composes it for a run. The current transport calls reqwest directly without an OpenTelemetry tracer or W3C propagation.

A focused draft implementation follows those boundaries: the session owns the optional SDK/exporter lifetime, and the remote-cache transport accepts a tracer for its HTTP operations. It does not change cache keys, payloads or authentication. Existing internal Rust performance tracing is a separate capability.

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

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions