Prompt
Need tracing that works across REST and gRPC services
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
To get tracing that works across both REST and gRPC services, the key is to use one distributed tracing standard end-to-end and make sure context is propagated between calls.
Recommended approach
Use:
- OpenTelemetry for instrumentation and context propagation
- A trace backend like:
- Jaeger
- Tempo
- Zipkin
- Datadog / New Relic / Honeycomb if you use a hosted APM
What this gives you
A single trace can follow:
- incoming REST request
- service-to-service REST calls
- gRPC calls
- database and other downstream spans
How to make it work
1) Instrument both protocols with OpenTelemetry
- REST server/client middleware
- gRPC server/client interceptors
2) Propagate trace context across boundaries
Use the standard headers/metadata:
traceparenttracestate
These are part of the W3C Trace Context standard, which OpenTelemetry supports.
3) Use the same context extraction/injection everywhere
- For HTTP/REST: inject/extract from headers
- For gRPC: inject/extract from metadata
That way, a request entering via REST can continue into gRPC calls and back.
Typical setup
REST service
- HTTP middleware starts/continues a span from incoming headers
- Outgoing REST and gRPC clients inject current context
gRPC service
- gRPC interceptor extracts trace context from metadata
- Incoming span becomes child of caller span
- Outgoing calls propagate the same context onward
Language support
OpenTelemetry supports this well across most stacks:
- Java
- Go
- Python
- Node.js
- .NET
- Ruby
- C++
Minimal architecture
- Client sends REST request with trace headers
- REST service extracts context and starts span
- REST service calls gRPC service with context in metadata
- gRPC service extracts context and starts child span
- Both export spans to the same collector/backend
Best practice
- Standardize on OpenTelemetry + W3C Trace Context
- Use a central OpenTelemetry Collector
- Export to your tracing backend from the collector
If you want, I can also give you:
- a reference architecture diagram
- sample code for REST + gRPC tracing in your language
- a deployment setup with OpenTelemetry Collector