Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Save Money on AI: How to Track Token Usage with Spring Boot, Prometheus and Grafana

Dan Vega via YouTube

Overview

Coursera Plus Monthly Sale: All Certificates & Courses 40% Off!
This 22-minute tutorial demonstrates how to build a complete AI monitoring dashboard to track token usage and costs when working with large language models. Learn to implement a monitoring solution using Spring Boot, Spring AI, Prometheus, and Grafana that provides real-time visibility into token consumption, response times, error rates, and projected costs. Follow along as Dan Vega explains the token usage problem, introduces key observability tools, walks through the system architecture, and guides you through setting up a project from scratch. Master essential configurations for proper metrics collection in both development and production environments, create a simple chat controller, test API calls, and customize Grafana dashboards to visualize your AI application's performance and costs effectively.

Syllabus

00:00 - Introduction to the Token Usage Problem
02:35 - Observability Tools Overview Spring Boot Actuator, Prometheus, Grafana
05:49 - System Architecture Explanation
08:12 - Setting Up the Project with Start.Spring.io
11:04 - Docker Configuration for Prometheus and Grafana
14:30 - Spring Boot Application Properties Configuration
17:21 - Creating a Simple Chat Controller
19:32 - Running the Application and Checking Actuator Endpoints
22:15 - Testing API Calls and Viewing Metrics
25:48 - Exploring the Grafana Dashboard
29:10 - Customizing Your Own Dashboards
31:45 - Conclusion and Best Practices

Taught by

Dan Vega

Reviews

Start your review of Save Money on AI: How to Track Token Usage with Spring Boot, Prometheus and Grafana

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.