Skip to content

v1.3.0 — Monitoring (usage, tokens & cost)

Choose a tag to compare

@ivannavas ivannavas released this 27 Jun 12:49

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 @UsageStore component, wired by its own @Processor like @Model or @ConversationStore. The shipped InMemoryUsageStore is the in-memory default — put its package on your component scan to use it, or declare your own @UsageStore to 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 from sprout.monitoring.pricing.<model>.input / .output rates (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.