otel-pocket
Surfaces Ollama gen_ai.* LLM spans and supports local Ollama/OpenAI-compatible models for slow-trace diagnosis.
Surfaces OpenAI gen_ai.* LLM spans in trace inspection, enabling analysis of OpenAI LLM calls alongside other spans.
Acts as a local OpenTelemetry collector for OTLP/JSON traces, rendering terminal flamegraphs and exposing trace inspection, critical path, SQL N+1, and gen_ai metrics through MCP tools.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
otel-pocket
One command local OpenTelemetry collector: npx otel-pocket (or bunx otel-pocket) listens on :4318 for OTLP/JSON traces, renders a live terminal flamegraph, flags SQL N+1 loops, and surfaces gen_ai.* LLM spans (Ollama, OpenAI, Anthropic).
Install
bunx otel-pocket
npx otel-pocket
# or install in your project / globally
bun add -d otel-pocket
npm i -D otel-pocketJSR:
bunx jsr add @kanchingyg/otel-pocket
npx jsr add @kanchingyg/otel-pocketgo install github.com/kanchingyg/otel-pocket@latestThe core collector runs in Go (main.go, internal/). TypeScript under src/*.ts is included for npx / bunx / JSR usage and MCP bridge helpers.
Related MCP server: tracehub-mcp
Quick start
npx otel-pocket
bunx otel-pocket
# point your SDK exporter to http://127.0.0.1:4318/v1/tracesnpx otel-pocket --mcpAdd to Cursor or Claude Code MCP config:
{
"mcpServers": {
"otel-pocket": {
"command": "npx",
"args": ["-y", "otel-pocket", "--mcp"]
}
}
}MCP tools
Tool | Purpose |
| Recent traces with duration and error status |
| Span tree, critical path, N+1 SQL, and |
| Ask a local OpenAI-compatible model (Ollama/LM Studio); loopback-only unless |
Set OTEL_POCKET_LLM_URL / OTEL_POCKET_LLM_MODEL for local LLM diagnosis.
Why otel-pocket
Jaeger and desktop viewers require a browser, lack a terminal TUI, and do not ship MCP tools for coding agents. Phoenix and Langfuse are heavy Python/Docker stacks. otel-pocket correlates HTTP, SQL N+1, and gen_ai.* spans in a single zero-config npx, bunx, or go install binary.
MCP Tools Reference
Tool | Mutates | Description |
|
| List recent OTLP traces stored in memory with total duration, span count, and error status. |
|
| Render the hierarchical span tree, critical path, collapsed SQL N+1 loops, and |
|
| Send a sanitized trace summary to a loopback Ollama or OpenAI-compatible model for bottleneck analysis. |
Editor and Agent Integration
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"otel-pocket": {
"command": "npx",
"args": ["-y", "otel-pocket", "--mcp"]
}
}
}Claude Code CLI
claude mcp add otel-pocket -- npx -y otel-pocket --mcpProgrammatic Usage (JSR / TypeScript)
import * as bridge from "jsr:@kanchingyg/otel-pocket/bridge";Runtime Safety and Guardrails
Stdio frame isolation: When
--mcpis active,hijackStdoutForMcp()redirects accidentalconsole.logcalls tostderrso JSON-RPC 2.0 frames onstdoutnever corrupt.Read-only by default: Mutating tools (
mutates: true) are blocked in--dry-runmode and require explicit--allow-writeauthorization.Loop breaker: Repeated identical
(toolName, args)invocations are hashed with SHA-256 and halted after 3 consecutive repeats to prevent runaway agent loops.Context budget truncation: Tool outputs are middle-truncated (
60%head /40%tail) scaled to the probed local modeln_ctx(Ollama/api/show, llama.cpp/props, vLLM/v1/models).Secret redaction and path normalization: AWS keys (
AKIA*,ASIA*), bearer tokens, andsk-*keys are scrubbed before returning tool output, and Windows drive paths (C:\...) translate cleanly to/mnt/c/...when WSL mode is enabled.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
LLM Orchestration Agent (Opentelemetry Api)
AI agent observability for production traces, natural-language insights, and improvement loops.
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
LLM Orchestration Agent (Opentelemetry Instrumentation Fastapi)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying and analysis of OpenTelemetry traces, metrics, and logs stored in Elasticsearch/OpenSearch, allowing AI assistants to investigate performance issues, find root causes, and explore system behavior.3 npm14MIT
- AlicenseAqualityAmaintenanceConnects AI assistants to OpenTelemetry trace backends (Jaeger, Grafana Tempo, Traceloop, Datadog, Sentry, AWS X-Ray, New Relic and Honeycomb) for natural-language trace and span search, error triage, cross-backend correlation, and LLM analytics such as token usage, model performance and the most expensive or slowest traces.19162 PyPIApache 2.0
- AlicenseAqualityBmaintenanceEnables local-first observability for MCP agent workflows by recording tool calls, prompts, latency, and token usage in a local SQLite database, and provides tools for inspecting, comparing, exporting, and generating dashboards from traces.1336 npmMIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and developers to query traces, sessions, exceptions, prompts, datasets, annotation queues, scores, and metrics for local debugging and observability. Runs locally over stdio or HTTP with selective tool-group loading, read-only mode, and compact or file-dump output to control token usage.-