End-to-End OpenTelemetry for a Next.js + FastAPI + Ollama App

You built an app: a Next.js frontend, a FastAPI backend, a local LLM served by Ollama, and Postgres underneath. It works. Then someone asks “why did that request take 40 seconds?” and you realize you have no idea. Was it retrieval? One of the model calls? The database? All you have is a spinner and a vibe. This post adds OpenTelemetry traces, metrics, and logs across the whole path, from a click in the browser to the token stream coming out of the model. The whole thing sits behind a single env var and is a true no-op when that var is unset, so local dev, tests, and CI never notice. Everything exports over OTLP to a Grafana LGTM stack (Loki, Grafana, Tempo, Mimir). ...

July 2, 2026 · 11 min · Alex Popescu

Building an MCP Server the Official Way: STDIO Core + HTTP Gateway Explained

Do you want to know how complicated it is to create an MCP server in python using the official MCP package? It’s complicated because: the MCP server should run over stdio transport belongs outside tools live inside and HTTP is just a gateway layer This blog explains how I rewired my architecture. The Architecture The application is composed of: MCP Server HTTP Gateway Layer 1: The MCP Server This is where: ...

January 15, 2026 · 4 min · Alex Popescu