---
title: "LLM observability with ClickStack, OpenTelemetry, and MCP"
description: "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."
url: "https://swe.quest/articles/llm-observability-with-clickstack-opentelemetry-and-mcp-0444a970ae228536"
canonical: "https://clickhouse.com/blog/llm-observability-clickstack-mcp"
source: "ClickHouse"
published: "2025-07-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 13
tags: ["observability","llms","ai-agents"]
---

# LLM observability with ClickStack, OpenTelemetry, and MCP

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-07-15, 13 min read, How-to. Original: [https://clickhouse.com/blog/llm-observability-clickstack-mcp](https://clickhouse.com/blog/llm-observability-clickstack-mcp)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)

## Prerequisites

- Docker Compose ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- OpenTelemetry basics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- LLM API usage ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

ClickStack, OpenTelemetry, MCP, LibreChat, HyperDX, ClickHouse, FastMCP

## Related posts

- [Tracing OpenAI agents with ClickStack](https://swe.quest/articles/tracing-openai-agents-with-clickstack-27a1630cee998ca8.md): ClickHouse · 2025-10-27 · Medium · 13 min read · Observability, AI agents, Python, Analytics & OLAP
  OpenAI's agents SDK has built-in tracing that can be redirected from OpenAI's hosted product to a custom TracingExporter.
- [Open House observability announcements: MCP server, AI Notebooks, and ClickStack Cloud](https://swe.quest/articles/open-house-observability-announcements-mcp-server-ai-notebooks-and-clickstack-027c56eb64027b0c.md): ClickHouse · 2026-05-27 · Easy · 9 min read · Observability, AI agents, Analytics & OLAP
  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.
- [Scaling observability at Character.AI: thousands of GPUs, 10x logs, and 50% lower cost with ClickStack](https://swe.quest/articles/scaling-observability-at-character-ai-thousands-of-gpus-10x-logs-and-50-lower-a0ff79c12547eafa.md): ClickHouse · 2025-08-27 · Medium · 10 min read · Observability, Analytics & OLAP, Cost optimization, Kubernetes, Scaling
  Character.AI consolidated fragmented logging across multi-cloud Kubernetes GPU clusters onto ClickStack (HyperDX UI) backed by ClickHouse Cloud.
- [The observability UI as we know it is dead. So what comes next?](https://swe.quest/articles/the-observability-ui-as-we-know-it-is-dead-so-what-comes-next-31b03aa568b097ab.md): ClickHouse · 2026-11-09 · Easy · 9 min read · Observability, AI agents, Sandboxing & isolation, Analytics & OLAP
  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.
- [Announcing the Managed ClickStack MCP Server](https://swe.quest/articles/announcing-the-managed-clickstack-mcp-server-2e355443e7bc5530.md): ClickHouse · 2026-06-24 · Medium · 8 min read · Observability, AI agents, Analytics & OLAP
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
