OpenTelemetry traces, queried where they lie.
The span index Data Prepper writes for OpenSearch trace analytics, unchanged. YANG-DB reads it as spans calling spans, services and traces, and asks across every trace at once what the trace view shows one trace at a time.
Run everything on your own engine.
The page talks to YANG-DB's REST API straight from your browser. Without an engine it shows results recorded from a real one, marked recorded, so you can explore first and run later.
Your engine
- The engine answers at
/health - The OtelTraces ontology is registered
- The Span index has data
The engine allows requests from any origin, so this works from yang-db.github.io to localhost. If your browser blocks it (Safari blocks http:// from an https:// page), open a local copy instead: docs/examples/otel/index.html in a clone of the repository.
Start it and load the data
- Start YANG-DB 0.12 or later and OpenSearch with Docker. The image is built from source (about 5 minutes the first time). The traces load next to the Dragons tutorial in the same engine:
cd docker && ./buildDocker.sh Dragons docker compose -f docker-compose-os.yml up -d
- Load the spans. The loader indexes the sample (2,035 spans, in the repository) into
otel_spansas Data Prepper writes them, then registers the ontology and the index provider. From the repository root:python3 examples/otel/load_otel.py --reset
Your own spans already in OpenSearch? Point the index provider at your index instead: nothing is copied or reshaped. - For projection (step 5), the engine's
projectionindex is set up by the Dragons tutorial:python3 docker/e2e/load_tutorial.pyonce. - Connect on the left. All set: explore the schema.
More: examples/otel, and how event indices are mapped: F21.
One span document is already a piece of the graph.
The flights example copies its sample into entity and relationship indices. Here nothing is copied: the index provider says which field is what, and the engine reads the graph from the spans as they are. Four fields carry it.
otel_spansSpan the document
id: spanIdname, kind, durationInNanos, …spanId (idField); the _id OpenSearch generated is not used.ChildOf parentSpanId
Span → SpanOf → Service serviceName
Span → ServiceIn → Trace traceId
Span → TracetraceGroup rides along as its property.The ontology the queries are written against.
Three entity types and three relationship types (OtelTraces.json), mapped onto the span index by OtelTraces-indexProvider.json. Click a type to see its properties and where it comes from; drag the nodes to rearrange them.
Six types, one index, created by someone else.
Every type below reads otel_spans. YANG-DB creates no index and writes no document: initialising the ontology only registers the mapping. Relationships are not stored twice here: each is one field of one span.
Ask across every trace in Cypher.
Pick a query, edit it if you like, and run it. The result is drawn as a graph, listed as rows, or shown as the JSON the API returns. Each query's answer was checked against the sample data itself.
Save a query's results, then slice them.
With the projection cursor, the engine writes every result row into an OpenSearch index. Here: every call made from a checkout span, 1,067 rows. Break them down by service, operation and duration, and page through them, without running the query again. recorded