Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Design the telemetry pipeline for your company using OpenTelemetry: services, collectors, backends. What problems does the collector solve?

Services export OTLP to a collector running next to them, on the node or in the cluster, never straight to a vendor. Collectors batch and retry, remove personal data from attributes, sample, and route each signal to one or more backends, which decouples services from the backend and makes a vendor change a configuration change. Because they now carry every signal, collectors are critical infrastructure: we size them, monitor them, and standardise resource attributes such as service.name, environment and version so every query works the same way.

Why this question is asked

Every company that adopts OpenTelemetry has to decide where the data goes after it leaves a service. Sending it directly from each service to a vendor looks simplest, but it spreads backend credentials, sampling rules and privacy filters across hundreds of applications, and any change requires redeploying all of them. Interviewers ask this design question to see whether we understand what the OpenTelemetry collector is for and whether we treat the pipeline as a production system in its own right. In this answer, we will recap the collector's parts, lay out a pipeline from services to backends, go through the problems the collector solves, look at how to run it reliably, and finish with the resource attributes that make the data usable.

1A Quick Recap of the OpenTelemetry Collector

The collector is a standalone program from the OpenTelemetry project that receives telemetry, processes it and sends it on. Its configuration is built from three kinds of components. Receivers accept data, for example OTLP over gRPC on port 4317 or HTTP on 4318. Processors change it, for example batching, filtering attributes or sampling. Exporters send it to a destination, such as a vendor, Prometheus, Tempo or Elasticsearch. A pipeline connects receivers, processors and exporters for one signal: traces, metrics or logs.

There are two common ways to deploy it. An agent collector runs on every node, usually as a Kubernetes DaemonSet, close to the services. A gateway collector runs as a central, horizontally scaled deployment that receives from the agents. Small setups can use only one of the two; larger ones use both.

2The Pipeline From Service to Backend

Our design has four layers. Services, whether Spring Boot with Micrometer Tracing or other languages with OpenTelemetry SDKs, export OTLP to the agent collector on their node at a fixed local address. The agent adds Kubernetes metadata such as pod and namespace, batches, and forwards to the gateway. The gateway applies company-wide rules: privacy filters, tail-based sampling, routing. Backends store and query the data.

Step throughTelemetry pipeline
  1. ServicesSpring Boot, Go, Node, Python export OTLP to localhost or node address
  2. Agent collectors (DaemonSet)k8s metadata, memory limit, batching, retry
  3. Load-balancing tierRoutes spans by trace id for tail sampling
  4. Gateway collectorsPII filters, tail sampling, routing per signal and team
  5. BackendsTraces, metrics, logs: vendor or open-source, one or several

5 layers, from the top down. Step through them one at a time.

Services know only the local collector; everything after it can change without redeploying them.

3What the Collector Solves

The first problem is reliability. A service that exports directly to a vendor must handle the vendor being slow or down, and during an outage it either blocks, buffers in its own memory or drops data. The collector takes that over: the batch processor groups data into fewer, larger requests, and exporters retry with a sending queue, optionally persisted to disk, so a five-minute backend outage does not lose data or slow the service.

The second is control. Attribute rules for personal data, such as deleting user.email or hashing an account id, live in one place instead of in 300 services. Sampling decisions, especially tail-based ones, need to see all spans of a trace, which only a central tier can do. Routing sends production traces to one backend, security-relevant logs to another, and a copy of everything to a new backend during an evaluation.

The third is decoupling. Services speak only OTLP to a local address. Changing vendors, adding a second backend or moving from self-hosted to managed is a change in the gateway's exporters, not a project across every team. That alone often justifies the collector, because it lowers the switching cost of every future decision.

YAML
# Gateway collector, simplified
receivers:
otlp:
protocols: { grpc: {}, http: {} }
processors:
memory_limiter: { check_interval: 1s, limit_percentage: 80 }
attributes/pii:
actions:
- { key: user.email, action: delete }
- { key: enduser.id, action: hash }
tail_sampling:
policies:
- { name: errors, type: status_code, status_code: { status_codes: [ERROR] } }
- { name: slow, type: latency, latency: { threshold_ms: 2000 } }
- { name: rest, type: probabilistic, probabilistic: { sampling_percentage: 5 } }
batch: {}
exporters:
otlphttp/vendor: { endpoint: https://otlp.vendor.example }
service:
pipelines:
traces: { receivers: [otlp], processors: [memory_limiter, attributes/pii, tail_sampling, batch], exporters: [otlphttp/vendor] }

Notice the order of processors: memory_limiter first, so an overload is refused early instead of crashing the collector, and batch last, just before export. Exact processor options change between collector releases, so the real configuration should be checked against the version we deploy.

4Running Collectors as Critical Infrastructure

Once every signal flows through the collectors, an unhealthy collector means we are blind during the very incident we need data for. So we plan capacity. As a rough guide, measure spans and log records per second per collector instance under load tests, keep headroom of at least 2x for peaks, and scale the gateway horizontally behind the load-balancing tier. Agents get CPU and memory limits so they cannot starve the services on the node.

And we monitor the monitor. Collectors expose their own metrics: received and refused items, exporter queue size, failed sends and memory use. Alerts on a growing export queue or rising refusals warn us before data is dropped. The collector's own telemetry should go to a separate, simple path, so a broken pipeline can still report that it is broken. Upgrades follow the same release process as any production service, with a canary, because a bad configuration affects everyone.

5Standard Resource Attributes

A resource describes the thing that produced the telemetry, and its attributes are attached to every span, metric and log record. If one team calls its service orders-svc, another uses the jar name, and a third forgets the environment, cross-service dashboards and alerts never line up. So we standardise a small set: service.name from the service catalogue, service.namespace for the domain or team, service.version from the build, and the deployment environment (deployment.environment.name in recent semantic conventions; older versions used deployment.environment, so check yours).

We set them at the source, through the platform starter in Spring Boot, where spring.application.name feeds service.name, and through OTEL_RESOURCE_ATTRIBUTES or SDK settings in other languages. The agent collector adds infrastructure attributes like k8s.pod.name and k8s.namespace.name automatically. With these in place, a query such as error rate by service.name in production returns the same shape for every team.

6Follow-up questions

Is a collector on every node really needed, or is a gateway enough?

A gateway alone works for smaller platforms. Node agents add value when we want Kubernetes metadata attached close to the source, cheap local connections from services, and a buffer per node. Many teams start with a gateway and add agents when the platform grows.

Does the collector add latency to requests?

No, because export is asynchronous. The service hands spans to its own exporter thread, which sends them in batches. The collector adds delay before data appears in the backend, typically a few seconds with batching and tail sampling, which is acceptable for observability.

What happens if the gateway is down?

Agents queue data and retry, within their memory or disk limits. If the outage outlasts the queue, data is dropped rather than slowing services. That is why queue size is one of the first collector metrics to alert on.

7Conclusion

In this answer, we designed an OpenTelemetry pipeline in which services export OTLP to node agents, agents forward to a load-balancing tier and gateway collectors, and gateways send to one or more backends. The collector batches and retries, removes personal data, samples and routes, and above all decouples services from the backend so that changing vendors is a configuration change. Because it becomes critical infrastructure, we plan its capacity, monitor its own queues and refusals, and release it carefully, and we standardise resource attributes such as service.name, environment and version so every signal can be queried the same way.

What to say in the interviewAbout 80 seconds aloud

Open with

I'd have every service export OTLP to a collector, never directly to a vendor. In Kubernetes that's an agent collector on each node as a DaemonSet, which adds pod and namespace metadata, applies a memory limiter and batches, then forwards to a gateway tier.

Then, if they want more

If we do tail sampling, there's a load-balancing layer that routes spans by trace id so one gateway sees the whole trace. The gateway applies company-wide rules: dropping or hashing personal data attributes, tail sampling to keep errors and slow traces, and routing each signal to the right backend, possibly more than one. The collector solves several problems.

It handles batching, retries and queues, so a backend outage doesn't slow services or lose data. It puts privacy and sampling rules in one place instead of in hundreds of services. And it decouples services from the backend: they only know a local OTLP endpoint, so changing vendors or dual shipping is a gateway configuration change.

Because all telemetry goes through it, I'd treat it as critical infrastructure: capacity planning with headroom, alerts on its export queue and refused data, and canary releases. Finally I'd standardise resource attributes, service.name from the catalogue, version and environment, set by the platform starter, so queries work the same across teams.

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 "Design the telemetry pipeline for your company using OpenTelemetry: services...": https://scrivio-interview-library.netlify.app/spring-boot/observability/43923a66f3/