Skip to content

feat(ai): llm slot wait time by priority as a metric #815

Closed

Description

@dan-petty

Context & Rationale

acquire_ollama_slot queues calls by priority (src/devops_cli/ai/client/network.py:189-232). Lease and queue counts live in per-process dicts (network.py:31-41), and nothing reads them: get_ollama_active_leases and get_ollama_waiting_counts (:239-248) have no caller. A short-lived process can't report these as a meaningful gauge. The time each call waits for a slot is per-call data, and it fits the delta model.

Scope & Deliverables

  • Deliverable:
    • Add a histogram devops_cli_ai_slot_wait_seconds, labelled by priority and outcome (leased or timed_out), to INSTRUMENTS.
    • Add a p95-by-priority panel to ai-spend.json.
  • Acceptance criteria:
    • A call that waits sends one observation with its priority and outcome.
    • The panel query passes tests/test_telemetry_instruments.py.
  • Constraint: No panel for lease counts or queue lengths.

Strategic Alignment

  • Milestone: Backlog
  • Depends on: none

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p3-lowscope/telemetrytype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions