Open Source · Free CLI

jq for OpenTelemetry GenAI traces.

Point otq at OTLP JSON/JSONL trace exports and pipe a jq-inspired pipeline query over spans. No backend, no server, runs entirely offline. Treats gen_ai.* attributes—model, tokens, prompt/completion messages, tool calls—as first-class fields instead of opaque attribute strings.

View on GitHub
Slowest gen_ai.chat spans in a trace export
$ otq 'spans | select(.name == "gen_ai.chat") | sort_by(.duration_ms, desc) | limit(10)' trace.json

jq-inspired pipeline

select, sort_by, limit, project, group_by—compose stages the same way you already do with jq, but with GenAI semantics built in.

GenAI fields, first-class

gen_ai.request.model, gen_ai.prompt, gen_ai.completion, gen_ai.usage.*, gen_ai.tool.name—no digging through nested OTLP attribute arrays.

Trace-aware navigation

children, descendants, parent, ancestors, root resolve against the full span set, so you can jump from a slow span straight to what it caused.

Built-in aggregations

sum, avg, max, p95, count after group_by—token spend per model or latency percentiles in one query, no external script.

Install

Release binary

tar xzf otq_<version>_<os>_<arch>.tar.gz
sudo mv otq /usr/local/bin/
otq --version

From source (Go 1.22+)

go build -o otq ./cmd/otq

otq debugs one trace file at a time.

ChatIntel is the zero-code toolkit for evaluating, measuring, and improving AI agent quality across every conversation your agent has—in production, not just in a local export.