rpc

star 2

Guidelines for RPC interface design, resilience, and tracing.

andrewhowdencom By andrewhowdencom schedule Updated 1/26/2026

name: rpc description: Guidelines for RPC interface design, resilience, and tracing.

RPC

Design

  • Context: Every RPC entry point or client call MUST accept context.Context as the first argument.
  • Tracing: All RPCs MUST be instrumented with OpenTelemetry.
    • Server: Extract context, start span.
    • Client: Inject context, start span.

Resilience

Timeouts

Set a deadline on every outgoing request.

ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
Scenario Timeout
Inter-service (same datacenter) 2s
External API 5-10s
User-facing 1s
Background jobs 30-60s

Retries

Use exponential backoff with jitter for transient failures.

  • gRPC: Use grpc_retry middleware.
  • HTTP: Use go-retryablehttp.
Install via CLI
npx skills add https://github.com/andrewhowdencom/.agents --skill rpc
Repository Details
star Stars 2
call_split Forks 2
navigation Branch main
article Path SKILL.md
More from Creator
andrewhowdencom
andrewhowdencom Explore all skills →