SShortSingh.
Back to feed

How One Developer Built a Unified Grafana Dashboard to Track AI Token Costs

0
·1 views

A homelab developer running three AI tools — Claude Code, Codex, and a custom alert-triage agent — found they had no visibility into combined token usage or costs across the setup. The three tools operate under different billing models: two use flat subscriptions measured in quota percentages, while the automated agent pays per token via a hosted API. To unify monitoring, the developer routed metrics from all three into Prometheus using separate collection methods — OpenTelemetry for Claude Code, a log-tailing Python exporter for the agent, and a Pushgateway timer for the mobile Codex CLI. Ollama, which lacks a native Prometheus endpoint, was handled by parsing its journald logs and polling its /api/ps endpoint via per-node exporters. The result is a single Grafana dashboard displaying token counts, latency, cache hits, quota burn rates, and real dollar spend across all AI workloads simultaneously.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Oracle OCI AI Foundations Course Breaks Down AI, ML, and Deep Learning Basics

Oracle University offers an OCI AI Foundations course that introduces learners to artificial intelligence, machine learning, deep learning, neural networks, and large language models. The course distinguishes between these often-confused terms, explaining that AI is the broadest field, machine learning is a data-driven subset of AI, and deep learning is a further specialization using multi-layered neural networks. Rather than focusing solely on generative AI, the course builds foundational knowledge before connecting concepts to Oracle's cloud and database ecosystem. It uses practical examples, such as predicting employee turnover, to illustrate how machine learning models identify patterns from historical data instead of relying on manually coded rules. The training is designed for professionals working with Oracle technologies who want to understand how modern AI capabilities integrate with enterprise applications.

0
ProgrammingDEV Community ·

Dev Reflects on Building a Secure Inventory Router for a Restaurant Management App

A software developer has shared a detailed retrospective on their contribution to Dine Flow, a restaurant inventory and order-management platform built by a six-person team over six weeks. Their core responsibility was the Express/TypeScript backend, with a particular focus on the stock router powered by Prisma and PostgreSQL. The router handled ingredient tracking, expiration dates, supplier integrations, and automatic stock decrements tied to order placements. During development, the engineer caught a subtle bug where a single-item endpoint was silently returning the entire stock table with a 200 status, reinforcing the lesson that a successful response and a correct response are not the same thing. A deliberate design choice was also made to treat each delivery as an immutable record rather than updating existing rows, preserving batch-level expiration tracking critical to food safety.

0
ProgrammingDEV Community ·

Open-Weight Models vs. Open Stack: Understanding the Difference in AI Transparency

Open-weight AI models, such as Llama, Mistral, and Gemma, allow users to download and run model weights on their own infrastructure, but they typically share little about how the model was built. An 'open stack' goes further by making the full development pipeline more transparent, including training data, code, recipes, evaluation methods, and deployment tools. Openness in AI is not a fixed standard but rather a spectrum, with some projects releasing model weights and architecture while keeping training and evaluation details private. Projects like OLMo by Ai2 and BLOOM by BigScience represent more comprehensive open approaches, sharing not just the final model but the entire process behind it. Understanding this distinction helps developers and researchers assess how much insight they truly have into the AI tools they use.

0
ProgrammingDEV Community ·

OpenAI May Be Building a Sketch Tool for ChatGPT's Image Workflow

OpenAI appears to be developing a sketch-based input feature for ChatGPT that would allow users to draw rough visuals directly in the chat interface instead of relying solely on text prompts. A credible September 2026 Axios report cited OpenAI product lead Adele Li discussing a sketch tool and templates in connection with the upcoming ChatGPT Images 2.5 update. The feature has not been officially confirmed or documented by OpenAI, and details such as naming, availability, and release timing remain unspecified. OpenAI has, however, confirmed two prior image milestones: a refreshed ChatGPT Images experience in December 2025 and the launch of ChatGPT Images 2.0 in April 2026, which introduced improved editing and a new creation space. A sketch tool would logically extend this multimodal direction by letting users reduce prompt ambiguity through simple visual references rather than lengthy written descriptions.