From your app to the store


- Your app or its framework makes spans with an OpenTelemetry SDK.
- The app sends the spans over OTLP: HTTP on port 4318, gRPC on port 4317.
magpie-servermaps each span to a Magpie span. With a mask policy (--mask, off by default), it replaces private data before it stores anything.- The server writes the spans to the store: one folder of files.
- You ask questions in JSON over the query API, on port 4318. The read-only web viewer at
/uses the same API.
magpiedb in Rust, Node.js or Python), there is no network part. Your app opens the store folder itself, then writes and queries it. Both ways use the same engine and write the same kind of store.
New data is searchable after the next commit. The store commits 0.5 s after the first write that waits.
The parts of the data


A span with the same trace id and span id replaces the one before. So a retry makes no copy, and you can write a span again when it ends.
Span kinds
kind tells what a step did. From OpenTelemetry, Magpie takes it from gen_ai.operation.name. With the library, you set it yourself.
What you can search and sum
Tokens and cost come from model calls and embeddings only. An agent span reports the sum of the model calls under it, so Magpie does not count those tokens twice.
Attribute values have no text search: an attribute filter matches a whole value.
Quick start
Start the server, send a trace and ask questions.
Queries
Every query type, with examples.
Send traces with OpenTelemetry
The setup for your framework, and how Magpie maps a span.