Tracing OpenAI agents with ClickStack
OpenAI's agents SDK has built-in tracing that can be redirected from OpenAI's hosted product to a custom TracingExporter. Spans can then be written into ClickHouse and explored in HyperDX as part of ClickStack. The worked example uses a gpt-5-mini agent that queries the ClickHouse SQL Playground through the ClickHouse MCP Server. The exporter is attached via a BatchTraceProcessor, adds the missing model name to response spans, and inserts rows into a JSON-typed ClickHouse table. The traces show tool calls, failed SQL attempts and LLM responses, which helps when comparing how different models handle ambiguous instructions.
Related posts
- LLM observability with ClickStack, OpenTelemetry, and MCP
ClickHouse mediumAdept
LibreChat (Node.js) and the Python ClickHouse MCP server can be instrumented with OpenTelemetry and shipped to ClickStack (HyperDX UI, OTel collector, ClickHouse) to observe LLM interactions, MCP tool calls and token usage with minimal code changes. Node.js runs under @hyperdx/node-opentelemetry, while Python uses standard opentelemetry-instrument with the API key passed in OTLP headers. Structured JSON logs are written to files and picked up by a separate collector using filelog and Prometheus receivers, with trace/span IDs and conversation IDs parsed out. In HyperDX, prompts can be filtered by log attribute and tied to a TraceId to follow each interaction and its prompt and completion token counts.
- Open House observability announcements: MCP server, AI Notebooks, and ClickStack Cloud
ClickHouse easyNovice
ClickHouse unveiled three observability updates: ClickStack Cloud, a serverless managed OpenTelemetry endpoint now in private preview; general availability of Managed ClickStack for teams that want control over ingestion and sizing; and AI Notebooks in beta, which turn incident investigations into branching, editable, shareable workspaces. A new open-source ClickStack MCP server exposes intent-level observability tools such as log pattern trends, outlier attribute correlation and slow-trace inspection, along with dashboard and search management, so external agents need not generate raw SQL. In internal benchmarks against the generic ClickHouse MCP, these tools cut tool calls by 25%, raised consistency 2.5x and improved eval scores by about 20%, while raw SQL stays available as an escape hatch. A Docker all-in-one container and a Claude Code connection command make it easy to try locally.
- Announcing the Managed ClickStack MCP Server
ClickHouse mediumAdept
ClickStack's MCP server, which exposes observability-specific investigation tools for logs, metrics and traces to agents like Claude Code, Cursor and Codex, is now available in Managed ClickStack on ClickHouse Cloud with OAuth and per-service dedicated compute. Semantic tools beat raw SQL generation: internal benchmarks show 25% fewer tool calls, 2.5x more consistency and roughly 20% higher eval scores than the generic ClickHouse MCP. The event patterns tool, for example, samples matching events, clusters them with Drain3 in the MCP layer and extrapolates counts, keeping query cost fixed instead of scanning the full dataset. The server also exposes orchestration tools so agents can persist investigations as dashboards and saved searches, while SQL remains available as an escape hatch.
- Trace and evaluate Cursor agents with Langfuse, powered by ClickHouse
ClickHouse mediumAdept
The Langfuse Observability plugin for Cursor captures each agent prompt as a `Cursor Turn` trace containing LLM observations, tool executions, subagents and token usage, stored in a wide ClickHouse observations table that avoids trace/observation joins for cost and latency aggregation. Setup is a Marketplace install plus a `~/.cursor/langfuse.json` key file. File-content capture is off by default, and because Cursor reports tokens once per turn, cost should be read from the trace total. A worked loop shows finding expensive turns caused by repeated file reads and retried shell commands, fixing them with a project rule, and validating the fix with dataset-based evaluations, which can also gate CI via a GitHub Action.
- The observability UI as we know it is dead. So what comes next?
ClickHouse easyNovice
ClickHouse Observability Apps, now in private preview in ClickStack, let teams describe an observability application in natural language and have an agent generate it over live logs, traces and metrics, instead of waiting for a vendor to build every custom view. Generated apps write and test SQL against ClickHouse, lean on OpenTelemetry semantic conventions, and reuse ClickStack's investigation APIs and UI components. They run in a sandboxed iframe that can only request validated actions such as running read-only queries under the viewer's permissions. Open problems include checking that queries answer the intended question and hardening against prompt injection, which is handled today by marking query results and logs as untrusted input.