Integration and measurement

Metrics Engine

Turns an event stream into outcome metrics and demand forecasts.

Status, in the repository's words: Version 1.3.0, dated 2026-11-10 in the changelog: security review fixes.

Repositorybulletproof-metrics-engine
OwnerBulletproofSoftwareAI
Version1.3.0
In suite v1.0.01.3.0, tagged 2026-11-10
Released2026-11-10
LicenseApache-2.0

What it is

A small FastAPI service with a dashboard.

It turns a stream of agent and task lifecycle events into outcome metrics and forecasts.

The forecasts of demand and cost are statistical; no machine learning is used.

Besides reading from the event router, it can be fed directly by any producer that posts task lifecycle events to it.

What it does today

What it ships

What it needs

Install

Copied from the repository's README. This site has not run these commands.

pip install -r requirements.txt
export EVENT_ROUTER_URL=http://localhost:8085            # event-router 1.1.0+
export EVENT_ROUTER_TOKEN_FILE=/path/to/event-router-token  # or EVENT_ROUTER_TOKEN
export METRICS_API_TOKEN="$(openssl rand -hex 32)"        # required: the API answers 503 without it
uvicorn app.main:app --host 127.0.0.1 --port 8086

Limits and known issues, as the repository lists them

As listed on branch main of BulletproofSoftwareAI/bulletproof-metrics-engine on 2026-11-30, commit 7ec2b5d: newer than the version described above.

  • There is one API token for all callers, with no roles: anyone holding it can read and write.
  • The service speaks plain HTTP only, so it should be published on loopback or behind a proxy that terminates TLS.
  • The container image has HIGH findings in base operating-system packages for which no fixed version has been published; they are accepted until a fix ships.
  • Forecast-accuracy (MAPE) monitoring is not implemented.
  • Model pricing settings are configuration only; they are not yet applied in the cost calculations.
  • Daily roll-up totals are written when old events are purged, but no endpoint reads them.

Works with

Event Router: Reads the event router's routing log through the router's authenticated HTTP API.
Agent Economics: The optional backfill fills in missing cost and token data from agent-economics candidates.

Documents in the repository

Source code

Where each statement on this page comes from

Read from BulletproofSoftwareAI/bulletproof-metrics-engine, branch main, commit a29de4d; the limits and known issues from BulletproofSoftwareAI/bulletproof-metrics-engine, branch main, commit 7ec2b5d, read on 2026-11-30. File and line for each statement:

  1. Turns an event stream into outcome metrics and demand forecasts. README.md:9
  2. Version 1.3.0, dated 2026-11-10 in the changelog: security review fixes. CHANGELOG.md:7
  3. 1.3.0 app/__init__.py:3
  4. 2026-11-10 CHANGELOG.md:7
  5. Apache-2.0 README.md:144
  6. A small FastAPI service with a dashboard. README.md:10
  7. It turns a stream of agent and task lifecycle events into outcome metrics and forecasts. docs/OVERVIEW.md:6
  8. The forecasts of demand and cost are statistical; no machine learning is used. docs/OVERVIEW.md:11
  9. Besides reading from the event router, it can be fed directly by any producer that posts task lifecycle events to it. docs/OVERVIEW.md:20
  10. Reads events from the event router through the router's API and does not open the router's database. docs/OVERVIEW.md:118
  11. Other producers can send task lifecycle events to it directly over HTTP. docs/OVERVIEW.md:47
  12. Computes outcome metrics such as completion rate and time to resolution. README.md:17
  13. There are eight outcome metrics, all worked out from the stored task events. docs/OVERVIEW.md:81
  14. Builds hourly and weekly demand curves, and cost forecasts for the 24h, 7d and 30d horizons. README.md:22
  15. Keeps detailed events for 90 days by default; the period is a setting. README.md:96
  16. The API needs a shared token: until one is set, every route except the health check, the dashboard page and the signed backfill answers 503. README.md:86
  17. The cost backfill endpoint is protected by a shared signing secret and stays off, answering 503, until that secret is set. README.md:99
  18. If the event router is down or refuses the token, the service keeps running, logs the reason and retries with growing waits. README.md:76
  19. Generates a 7-day digest of outcomes and predictions on request and saves it as a JSON file. docs/HOW-TO-USE.md:174
  20. A health endpoint, JSON metrics APIs and an HTML dashboard. README.md:23
  21. A single SQLite database holds everything it stores. docs/OVERVIEW.md:52
  22. A Dockerfile based on python:3.12-slim that runs the service as a non-root user. docs/OVERVIEW.md:141
  23. Auto-generated API documentation, served while the app is running. docs/HOW-TO-USE.md:207
  24. Python 3.12. docs/INSTALL.md:9
  25. No database server: data is kept in a local SQLite file. docs/INSTALL.md:10
  26. Pull ingest needs event router 1.1.0 or later. docs/ADMINISTRATOR.md:143
  27. The router is optional: with the router address left empty, pull ingest is off and events are pushed to the service instead. README.md:74
  28. Seven pinned Python packages are its direct runtime dependencies. docs/SBOM.md:10
  29. There is one API token for all callers, with no roles: anyone holding it can read and write. docs/ADMINISTRATOR.md:160 at 7ec2b5d
  30. The service speaks plain HTTP only, so it should be published on loopback or behind a proxy that terminates TLS. docs/ADMINISTRATOR.md:161 at 7ec2b5d
  31. The container image has HIGH findings in base operating-system packages for which no fixed version has been published; they are accepted until a fix ships. docs/SECURITY-ACCEPTED-RISK.md:6 at 7ec2b5d
  32. Forecast-accuracy (MAPE) monitoring is not implemented. docs/ADMINISTRATOR.md:198 at 7ec2b5d
  33. Model pricing settings are configuration only; they are not yet applied in the cost calculations. docs/ADMINISTRATOR.md:194 at 7ec2b5d
  34. Daily roll-up totals are written when old events are purged, but no endpoint reads them. README.md:170 at 7ec2b5d
  35. Reads the event router's routing log through the router's authenticated HTTP API. docs/OVERVIEW.md:17
  36. The optional backfill fills in missing cost and token data from agent-economics candidates. README.md:25
  37. Install section of the README README.md:28

Bulletproof suite v1.0.0 pins tag v1.3.0, commit a29de4d, tagged 2026-11-10.