Scrivio Interview library
DesignAdvanced7 min read · updated 12 November 2026

Define tracing standards for a 200-service platform with mixed languages: propagation format, sampling, retention and which spans are required.

Use W3C Trace Context everywhere, including gateways, message headers and batch jobs, so every language continues the same trace. Sample with a head-based probability to control volume and add tail-based sampling in the collector to keep every error and slow trace. Require spans for inbound and outbound calls, messaging and database access, plus business spans for key operations; set retention per environment with attribute rules that keep personal data out; and deliver all of it through the platform starter for Java and the OpenTelemetry collector and SDKs for other languages.

Why this question is asked

With 200 services written in Java, Go, Node and Python, tracing only works if everyone agrees on a few rules. A single service that uses a different header format, or drops the context on a queue, cuts every trace that passes through it, and a single team that sends user emails as span attributes creates a privacy incident. Interviewers ask this design question to see whether we can set standards that are small enough to be adopted and strong enough to keep traces whole and affordable. In this answer, we will recap what a standard must cover, choose the propagation format, design sampling with real numbers, define the required spans, set retention and attribute rules, and decide how to deliver it to teams.

1A Quick Recap: What Breaks Traces at Scale

A trace survives only if every hop does three things: reads the incoming context, makes it current while working, and writes it into every outgoing call or message. A hop is any place where the request crosses a boundary: a gateway, an HTTP call, a message on a queue, a scheduled batch that picks up stored work. On a platform this size, the failures are rarely in the services themselves. They are at the edges nobody owns: the API gateway that strips unknown headers, the legacy service using B3, the batch job that reads from a table and starts a fresh trace.

So the standard has to cover formats, sampling, required spans, data rules and delivery. Each part below is a decision, with the reasoning a reviewer can check.

2Propagation: W3C Trace Context Everywhere

We choose W3C Trace Context, the traceparent and tracestate headers, because it is the default in OpenTelemetry SDKs for every language and in Spring Boot's Micrometer Tracing. Choosing the format every tool already speaks costs nothing. We add W3C baggage only for a short allow list of fields, such as tenant tier, since it travels on every call.

The rule must name every carrier, not just HTTP. Gateways and service meshes must forward traceparent and should start a trace if none arrives. Kafka and other messaging write traceparent into message headers. Batch jobs start a root span per job run and, when they process stored items that came from a request, add a span link to the original trace context saved with the item. Services that still use B3 run both propagators during migration, reading either and writing W3C, with a date to remove B3.

3Sampling: Head-Based for Volume, Tail-Based for Value

Let us put numbers on it. Suppose the edge handles 40,000 requests per second and an average trace has 25 spans. Keeping everything means 1,000,000 spans per second, which would cost far more than the value it provides. Head-based sampling decides at the root, with a probability, and passes the decision downstream in the sampled flag, so traces stay complete. At 10 percent we have 100,000 spans per second.

The weakness of head sampling is that it decides before anyone knows whether the request will fail. Tail-based sampling waits until the trace is finished and decides then. It runs in OpenTelemetry collectors, where policies keep every trace with an error, every trace slower than its endpoint's threshold, and a small random share of the rest. Because a trace's spans come from many services, all spans of one trace must reach the same collector instance, which we do with a load-balancing collector layer that routes by trace id.

Step throughSampling path for a trace
  1. Root serviceHead sampling: parent-based, 10 percent
  2. Spans exportedEvery service sends OTLP to its local collector
  3. Load-balancing collectorsRoute all spans of a trace id to one instance
  4. Error or slower than threshold?
    YesKeep the whole traceNoKeep 5 percent of the rest
  5. BackendErrors and slow traces always present

5 steps in order. Play them, or step through them one at a time.

Head sampling controls volume; tail sampling keeps the traces we need in incidents.

4Required Spans and Naming

A standard that says instrument everything is ignored; one that lists a few must-haves is checkable. We require a server span for every inbound request or message, a client span for every outbound call and message publish, a span for every database or cache call, and business spans for a short list of key operations each domain names, such as payment.authorise or order.place. Spans follow OpenTelemetry semantic conventions for names and attributes, so http.request.method, db.system and messaging.destination.name mean the same thing in every language.

Every span carries the same resource attributes: service.name from the service catalogue, service.version, and the deployment environment. Without them, queries across languages do not line up.

Span requirements
SpanRequired forKey attributes
Inbound server or consumerEvery request and messageroute template, status
Outbound client or producerEvery call and publishpeer service, destination
Database and cacheEvery query or commanddb.system, operation; no full SQL with values
Business operationKey operations per domainoutcome, low cardinality type
Batch job runEvery run, links to source tracesjob name, item count

5Retention and Attribute Rules

Retention follows value and cost. Production traces are kept for 7 days, which covers incident analysis and the following review; staging for 3 days; development for 1 day. Metrics derived from spans, such as request rate and latency per route, are generated in the collector and kept for 13 months, so we keep long-term trends without keeping raw spans. A team that needs longer for compliance asks for an exception with a reason.

Attribute rules protect privacy. The standard forbids personal data in span names and attributes: no emails, names, card numbers or full SQL with values. Ids are allowed only as opaque internal ids. The collector enforces a second line of defence with processors that delete or hash forbidden keys and redact patterns such as card numbers, because a rule only in a document will eventually be broken.

6Delivering the Standard

Standards are adopted when they are the default. For Java, the platform's Spring Boot starter brings Micrometer Tracing with the OpenTelemetry bridge, W3C propagation, Kafka observation enabled, a ContextPropagatingTaskDecorator and the OTLP endpoint of the local collector, so a new service is compliant with no configuration. For Go, Node and Python, we publish a thin wrapper around the OpenTelemetry SDK with the same defaults, or use OpenTelemetry auto-instrumentation where it fits. The collector, run by the platform team, applies sampling, attribute rules and routing for everyone.

Finally, we measure compliance: the share of traces with a broken parent, services emitting non-W3C headers, and spans missing service.name. A weekly report per team turns the standard into something visible, and it shows which edges still cut traces.

7Follow-up questions

Why not use tail-based sampling alone?

Because every span would have to be sent to the collectors before a decision is made, which means paying network and collector capacity for all 1,000,000 spans per second. Head sampling reduces that first. Some platforms with enough capacity do send everything to collectors and only tail sample, but at this scale a combination is cheaper.

How do we keep a trace when a message waits in a queue for hours?

The context is stored in the message headers, so the consumer can continue the trace whenever it runs. A trace that spans hours is awkward to view, so some teams start a new trace at the consumer and link it to the producer's context. The standard should pick one approach so queries are consistent.

Who owns the gateway and mesh configuration?

The platform team does, and it is the most important part. A gateway that drops traceparent breaks every trace on the platform, so header forwarding and trace start at the edge are tested as part of the gateway's own release checks.

8Conclusion

In this answer, we designed tracing standards for 200 mixed-language services. We chose W3C Trace Context for every carrier, including gateways, message headers and batch jobs; combined head-based probability sampling for volume with tail-based sampling in collectors that route by trace id to keep errors and slow traces; listed required spans with semantic conventions and resource attributes; set retention per environment with span-derived metrics for long trends and collector-enforced rules against personal data; and delivered it all through the platform starter and the OpenTelemetry collector so that compliance is the default.

What to say in the interviewAbout 80 seconds aloud

Open with

I'd keep the standard short and checkable. Propagation is W3C Trace Context everywhere, because every OpenTelemetry SDK and Spring Boot already default to it. The rule explicitly covers gateways and the mesh, Kafka and other message headers, and batch jobs, which start a root span per run and link to the trace saved with the item.

Then, if they want more

Legacy B3 services read both during a migration window. For sampling, I'd use head-based, parent-based probability at the root, say ten percent, to control volume, and tail-based sampling in OpenTelemetry collectors that keep every error and slow trace plus a small share of the rest. That needs a load-balancing collector tier that routes by trace id.

Required spans are inbound and outbound calls, messaging, database calls and a few named business operations, using semantic conventions and the same resource attributes, service.name, version and environment. Retention is by environment, for example seven days in production and less elsewhere, with span-derived metrics kept long term.

Attribute rules forbid personal data, and the collector enforces them by deleting or redacting keys. Delivery is what makes it work: the Java platform starter configures all of this by default, other languages get a thin SDK wrapper, and we report compliance per team, like broken parent rate.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Define tracing standards for a 200-service platform with mixed languages: propagation...": https://scrivio-interview-library.netlify.app/spring-boot/observability/b39bece746/