Skip to content

Add CLI tracing proxy exporter#609

Merged
phinze merged 1 commit intomainfrom
phinze/mir-707-cli-tracing-proxy-exporter-so-cli-spans-ship-through-the
Feb 13, 2026
Merged

Add CLI tracing proxy exporter#609
phinze merged 1 commit intomainfrom
phinze/mir-707-cli-tracing-proxy-exporter-so-cli-spans-ship-through-the

Conversation

@phinze
Copy link
Contributor

@phinze phinze commented Feb 13, 2026

Summary

  • CLI deploy spans now ship through the server's existing RPC connection automatically — no OTEL_EXPORTER_OTLP_ENDPOINT needed on the client side
  • New Telemetry.reportSpans(bytes) RPC endpoint receives serialized OTLP protobuf and forwards it to the server's configured collector
  • Server silently drops spans when no collector is configured; RPC errors are swallowed so tracing never blocks deploys

Design

Three layers, all simple:

Layer File(s) What it does
Proxy client pkg/otelproxy/proxy.go Implements otlptrace.Client, marshals spans to protobuf, sends via RPC
RPC endpoint api/telemetry/ + servers/telemetry/server.go Receives bytes, HTTP POSTs to {OTEL_EXPORTER_OTLP_ENDPOINT}/v1/traces
CLI integration cli/commands/deploy.go Connects to telemetry service, sets up proxy tracing. Falls back to no-op if server unreachable

The proxy client lives in pkg/otelproxy/ (not pkg/rpc/) to avoid an import cycle through the generated telemetry RPC code.

Test plan

  • go generate ./api/telemetry/... succeeds
  • make bin/miren builds clean
  • make lint passes (0 issues)
  • make test passes (3287 tests, 20 pre-existing skips)
  • Manual: start dev server with OTEL_EXPORTER_OTLP_ENDPOINT pointed at a collector, run m deploy without any env vars on the CLI side, verify deploy+build spans appear in the collector

Instead of requiring OTEL_EXPORTER_OTLP_ENDPOINT on every CLI invocation,
CLI spans now flow through the server's existing RPC connection. The server
re-exports received spans to its configured OTLP collector.

Three-layer design:
- pkg/otelproxy: implements otlptrace.Client, serializes spans to OTLP
  protobuf, sends via RPC. Errors are swallowed so tracing never blocks.
- api/telemetry + servers/telemetry: new Telemetry.reportSpans(bytes) RPC
  endpoint. Server HTTP POSTs opaque protobuf bytes to the collector.
- cli/commands/deploy.go: sets up proxy tracing automatically via the RPC
  connection. No client-side config needed.
@phinze phinze requested a review from a team as a code owner February 13, 2026 21:50
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a server-assisted distributed tracing architecture. New IDL and generated RPC bindings define a Telemetry interface with a reportSpans method. A new telemetry server implementation reads OTLP configuration from environment variables and forwards span data to a remote OTLP endpoint. An RPC proxy client enables CLI commands to export traces through this server instead of directly. The telemetry service is integrated into the coordinator and exposed over RPC at path dev.miren.runtime/telemetry. Dependencies for OTLP modules are updated, and the deploy command now uses the proxy-based tracing setup.


No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@phinze phinze merged commit 3548242 into main Feb 13, 2026
9 checks passed
@phinze phinze deleted the phinze/mir-707-cli-tracing-proxy-exporter-so-cli-spans-ship-through-the branch February 13, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants