Skip to content

service: no per-service usage stats are recorded #1133

Description

@edwin-zvs

Nothing is recorded per service. There are no counters anywhere in the service module, so an operator running a service has no way to answer "is it being used, is it working, and what is it costing".

The design calls for, per service: requests by outcome per channel, sessions created and currently active, queue and turn latency, tokens by harness and model, and rate-limit rejections.

Two notes on sequencing:

  • The rate-limit rejection counter only becomes meaningful once budgets exist (service: per-service budgets (rate, concurrency, tokens) are not enforced #1132), but the rest stands alone and is useful immediately.
  • Counters must survive daemon restart, alongside definitions and key-to-session maps. ServiceShared already persists state atomically to data_dir/services/<name>.json and is a per-service singleton for the daemon's lifetime, so it is the natural owner — but note the invariant that it must never be recreated on reload, or counters reset silently.

Surfacing is a second question: the TUI service view and the web UI both currently show definition state only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions