Files
gabrielvidalandClaude Opus 5.5 1b8711b634 feat(stats): usage counts on the relay — connector, forms, landing, downloads
The relay now counts how it is used, for the person who runs it: sign-ins
to the chat-app connector by app (a short known list, else "other"), tool
calls and errors, rate-limit hits, forms made through the connector (where,
kind, language, size, field types, pictures/mockups/conditions), how they
ended and how fast they were answered, landing and example views (people
and bots apart), install.sh / agent-install / plugin / claude.ai skill
fetches, machine registrations, and form pages opened and answered through
the relay.

Never kept: a form's text, title, id or answers, an address, a user agent,
a token. Per connector account, a summary under a hash of its id (app,
where, active days, forms made/answered) gives active accounts and the
7-day return rate; a pending form is held under a hash of its id until its
outcome is seen (a tool result, or the cloud's own events).

- internal/stats: counters per day in stats.json (next to machines.json),
  the summary, Prometheus text; nil-safe Recorder.
- relay: GET /_relay/v1/stats (JSON, ?days=N) and /_relay/v1/metrics behind
  ASK_FORM_RELAY_STATS_TOKEN (404 without one); --stats FILE|off.
- ask-form-relay stats [--days 7] [--json] reads the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:00:28 +01:00
..