Prompt

I need service dependency mapping from traces automatically

Technology / Observability1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

You can do this automatically from distributed traces by building a service dependency graph.

What to extract from traces

From each trace/span, capture at least:

  • trace_id
  • span_id
  • parent_span_id
  • service.name
  • span.kind (SERVER, CLIENT, PRODUCER, CONSUMER)
  • peer.service / destination host / RPC target
  • timestamps and latency

Basic mapping rule

A dependency usually exists when a span from service A causes a child span in service B.

Common patterns:

  • HTTP/gRPC sync call: A -> B
  • Messaging:
    • producer service A publishes to topic/queue
    • consumer service B processes it
    • map as A -> topic -> B or directly A -> B if you want service-to-service only

Recommended approach

1) Ingest traces

Use OpenTelemetry / Jaeger / Zipkin trace data.

2) Normalize spans

Convert each span to a canonical form:

{
  "trace_id": "...",
  "span_id": "...",
  "parent_span_id": "...",
  "service": "orders",
  "kind": "CLIENT",
  "peer_service": "payments",
  "operation": "POST /charge"
}

3) Build edges

For each span:

  • If kind = CLIENT and peer_service exists:
    • create edge service -> peer_service
  • If parent span belongs to a different service than child:
    • create edge parent_service -> child_service
  • Aggregate counts, latency, error rates per edge

4) Aggregate into graph

For each edge:

  • call count
  • p95 latency
  • error rate
  • first seen / last seen

Example:

orders -> payments   1284 calls   p95=42ms   errors=0.7%
orders -> inventory   980 calls    p95=18ms   errors=0.1%
payments -> fraud     220 calls    p95=75ms   errors=1.9%

Output formats

You can emit:

  • JSON graph
  • Graphviz DOT
  • Neo4j / graph DB
  • Prometheus metrics
  • OpenTelemetry topology service map

Example JSON:

{
  "nodes": ["orders", "payments", "inventory", "fraud"],
  "edges": [
    {"from": "orders", "to": "payments", "count": 1284, "p95_ms": 42},
    {"from": "orders", "to": "inventory", "count": 980, "p95_ms": 18}
  ]
}

Tooling options

  • OpenTelemetry Collector for ingestion/export
  • Jaeger topology/service graph
  • Grafana Tempo + service graph
  • AWS X-Ray service map
  • Elastic APM service map
  • Neo4j / custom pipeline if you want full control

If you want to implement it yourself

A simple algorithm:

  1. Group spans by trace_id
  2. Build span tree using parent_span_id
  3. For each parent-child pair across different services, add edge
  4. Merge edges across traces
  5. Compute metrics

Pseudo-code:

for trace in traces:
    spans = trace.spans
    by_id = {s.span_id: s for s in spans}

    for s in spans:
        if s.parent_span_id and s.parent_span_id in by_id:
            p = by_id[s.parent_span_id]
            if p.service != s.service:
                edges[(p.service, s.service)].count += 1
                edges[(p.service, s.service)].latencies.append(s.duration_ms)

Important caveats

  • Sampling can hide dependencies.
  • Messaging systems need special handling.
  • Async calls may not have direct parent-child service relationships.
  • Repeated retries can inflate edge counts.
  • You may need heuristics for missing peer.service.

If you want, I can provide:

  1. a Python script to generate a service graph from OTLP/Jaeger traces,
  2. a database schema for storing dependencies, or
  3. a Kubernetes/OpenTelemetry architecture for doing this in production.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.