v1.3.0 — Monitoring (usage, tokens & cost)
sprout-monitoring
A new module that tracks agent and model usage, tokens and cost — per model, per agent and per tool — with no change to your agents. It builds on the event bus introduced alongside it: a collector subscribes to the prefab lifecycle events and folds each one into a usage store.
Highlights
- New
@UsageStorecomponent, wired by its own@Processorlike@Modelor@ConversationStore. The shippedInMemoryUsageStoreis the in-memory default — put its package on your component scan to use it, or declare your own@UsageStoreto persist usage elsewhere (database, Prometheus/StatsD, …), with nothing else changing. - Token & cost accounting. Per-model token totals and cost, per-agent runs/iterations/tokens, per-tool call counts, and global totals via
UsageSnapshot. Costs come fromsprout.monitoring.pricing.<model>.input/.outputrates (per one million tokens); unpriced models are tracked at zero cost. - Spring-friendly. The store is a managed singleton named
usageStore, so under the Spring Boot starter it is exposed as a Spring bean automatically.
Maven
<dependency>
<groupId>io.github.ivannavas</groupId>
<artifactId>sprout-monitoring</artifactId>
<version>1.3.0</version>
</dependency>All modules (core, anthropic, openai, mcp, orchestration, monitoring, spring-boot-starter) are published at 1.3.0.