Guides · Topology

Service topology and dependency maps with OpenTelemetry

Topology is the map of what you have and how it connects: which service calls which, and which pod and host each one runs on. OpenTelemetry has no topology signal. The map is derived from the traces and attributes you already send. This guide explains how, and what you need for a complete map.

By the OneGlass team · December 3, 2026 · 7 min read

What a map is for

  • During an incident: if the database fails, which services depend on it? If a host goes down, what was running there?
  • Before a change: who is affected if you touch this service?
  • To group alerts: twenty alerts on services that depend on the same component are one problem, not twenty.

A hand-drawn map is out of date the day it is finished. The useful one builds itself from what the system does.

Two kinds of relationship

A complete map has relationships in two directions, and each comes from a different place in the telemetry:

  • Horizontal, "calls": service A makes requests to service B. These come from traces.
  • Vertical, "runs on": the service runs in a pod, the pod on a node, the node on a hypervisor. These come from resource attributes.

Connections between services come from traces

Every span has a kind that says what role it plays. Four of them draw almost everything:

  • CLIENT and SERVER: when service A calls B, A records a CLIENT span and B a SERVER span that is a child of the first. A SERVER span whose parent is a CLIENT span from another service is an arrow on the map.
  • PRODUCER and CONSUMER: the same for queues and messaging. The publisher and the consumer end up linked even if minutes pass between them.

For B's span to be a child of A's, the trace context has to travel with the request. That is context propagation: a standard header, traceparent, that auto-instrumentation adds and reads on its own.

What you didn't instrument shows up too

A database, a third-party API or a legacy system doesn't send telemetry, but the service that calls it does. Its CLIENT span says where it went:

  • server.address and server.port: the destination of the call.
  • db.system.name and db.namespace: which database engine and which database.
  • messaging.destination.name: the queue or topic.

With that, the map can draw a node for the dependency even though it never sent any data of its own.

What lies underneath comes from resource attributes

Every piece of data a process sends carries attributes that say where it runs. When two pieces of data share the value of one of those attributes, they are in the same place:

  • Service: service.name, service.namespace and service.instance.id. The three together identify an instance unambiguously.
  • Process and container: process.pid, container.id.
  • Kubernetes: k8s.pod.uid, k8s.deployment.name, k8s.namespace.name, k8s.node.name, k8s.cluster.name.
  • Host: host.id, host.name.

It is best if the Collector adds these attributes, with the resourcedetection and k8sattributes processors, rather than each application. That way all data from the same node carries exactly the same values, which is what lets you join them.

The OpenTelemetry project is formalizing this idea with the concept of entities: a standard way to say "this is a host, this is a pod, and this service runs on that one". It is still in development. For now, relationships are derived from attributes.

A service graph in the Collector

The Collector can compute the connections between services and publish them as metrics, with the servicegraph connector. It pairs each CLIENT span with its SERVER span and counts the requests, failures and latency of each pair.

yaml
receivers:
  otlp:
    protocols:
      grpc: { endpoint: 0.0.0.0:4317 }
      http: { endpoint: 0.0.0.0:4318 }

connectors:
  servicegraph:
    store:
      ttl: 10s                  # how long it waits for the other half of the pair
      max_items: 5000
    dimensions: [deployment.environment.name]

exporters:
  otlphttp:
    endpoint: https://ingest.oneglass.io
    headers:
      Authorization: "Api-Token ${env:ONEGLASS_INGEST_KEY}"
      X-Tenant-ID: "${env:ONEGLASS_TENANT_ID}"

service:
  pipelines:
    traces:        { receivers: [otlp], exporters: [otlphttp, servicegraph] }
    metrics/graph: { receivers: [servicegraph], exporters: [otlphttp] }

The result is metrics like traces_service_graph_request_total, with the attributes client and server: one series for each arrow on the map. One caution: both halves of a pair have to pass through the same Collector instance, so with several instances you need to route by trace ID.

Many observability platforms do this calculation on their own when they receive the traces. If yours does, you don't need the connector.

Why connections sometimes go missing

  • Context propagation breaks. A proxy that drops the traceparent header, or a hop through an uninstrumented queue, splits the trace in two. You get two services with no arrow between them.
  • The same service under two names. checkout in one environment and checkout-api in another are two different nodes.
  • Sampling hides the infrequent. With 1% of traces, a call that happens once an hour may never show up. If the map is computed after sampling, it will miss the rare connections.
  • Resource attributes are missing. Without host.name or k8s.pod.uid, the service floats with nothing underneath it.
  • Traces don't see the network. Switches, routers and firewalls don't take part in a request the way a service does. To get them on the map you need other sources: SNMP, the hypervisor API, the cluster API.

Checklist

  • Every service has a unique, stable service.name.
  • Context propagation goes through proxies, load balancers and queues.
  • The Collector adds the host and Kubernetes attributes.
  • CLIENT spans carry server.address and, for a database, db.system.name.
  • The map is computed before sampling, or on the full set of traces.

With OneGlass

OneGlass is an OpenTelemetry-native observability platform, made in Argentina. It builds the topology on its own from your telemetry and draws it on a single map: network devices, hypervisors, hosts, containers, Kubernetes objects, processes and services, with history so you can see what changed. There is nothing to draw by hand.