Skip to content

P17: Add per-user and per-host tracing for daemon usage #70

@wauputr4

Description

@wauputr4

Goal

Extend usage tracing so self-hosted operators can see which users/API keys consumed their daemon capacity.

User Story

As a self-hosted host, I can see per-user and per-API-key usage routed through my daemon node, including model, token usage, status, latency, and timestamps. As the Mizan operator, I can enforce limits and audit requests without exposing raw provider secrets.

Scope

  • Extend usage/request log model with daemon host/node references.
  • Add host-facing usage query endpoints or admin endpoints filtered by daemon node/host.
  • Ensure existing user-facing usage remains scoped to the requesting user.
  • Add metrics labels for daemon node/host where safe.
  • Avoid exposing conversation content in logs by default.

Acceptance Criteria

  • Every daemon-backed completed request records user id, API key id, node id, route id, model, status, latency, and usage tokens.
  • Host/admin can query daemon usage by node and date range.
  • User can query their own usage without seeing host-private metadata beyond public model/route info.
  • Metrics include safe daemon/node dimensions with cardinality guardrails.
  • Tests cover per-user and per-host usage isolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: daemonDaemon runtime, node registration, and host-side executionarea: distributedDistributed proxy control plane, dispatch, tunnels, and nodesarea: meteringUsage events, token accounting, and credit chargesarea: observabilityTracing, logs, metrics, and diagnosticsenhancementNew feature or requestrustPull requests that update rust codev0.2.0Planned for Mizan v0.2.0 distributed proxy milestone

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions