Skip to content

feat(telemetry): installation telemetry — usage analytics from self-hosted deployments #758

Closed

Description

@vybe

Summary

Add an opt-out telemetry heartbeat that periodically reports aggregate usage metrics from Trinity installations back to an Ability-controlled endpoint. This gives us visibility into feature adoption, version distribution, and platform diversity across the self-hosted fleet — without collecting any user content or PII.

Design

What to report (no PII, aggregates only)

Field Description
installation_id Random UUID generated at first boot, persisted in system_settings. Not tied to any user.
trinity_version From package/build metadata
platform OS, Docker version, CPU arch
agent_count Total agents, currently running
features_enabled Boolean flags: Slack, Telegram, WhatsApp, Nevermined, voice, git-sync, canary
schedule_execution_count_7d Aggregate executions last 7 days
active_users_7d Count of distinct user IDs with activity (no emails/names)
uptime_days Days since first boot
reported_at ISO 8601 UTC timestamp

Transport

  • POST https://telemetry.ability.ai/v1/ping (HTTPS, JSON body)
  • Daily heartbeat via APScheduler at a jittered time (avoids thundering herd across fleet)
  • Fire-and-forget: failure is silently swallowed, never surfaced to users

Opt-out

  • Single escape hatch: TELEMETRY_ENABLED=false env var — fully suppresses all reporting
  • On by default; no admin UI toggle (keeps the surface area minimal and the data coverage high)
  • Must be documented clearly in .env.example and deployment docs

Backend components

services/telemetry_service.py       — collect snapshot, POST to endpoint
db/system_settings.py               — add installation_id field
main.py                             — register APScheduler daily job
config.py                           — read TELEMETRY_ENABLED (default True)

Receiving server

Separate ops work (not in this issue). Needs a simple ingestion endpoint at telemetry.ability.ai that writes to a time-series store (ClickHouse or BigQuery).

Acceptance Criteria

  • installation_id is generated once at first boot and persisted; never regenerates
  • Daily heartbeat fires (jittered ±2h around midnight UTC) and POSTs the payload
  • TELEMETRY_ENABLED=false env var fully suppresses all reporting; any other value (or absent) means enabled
  • Payload contains no email addresses, agent names, message content, or IP addresses
  • Network failure is silently ignored — no error surfaced to UI or logs (debug level only)
  • .env.example documents TELEMETRY_ENABLED=false with a comment explaining what is collected

Technical Notes

  • installation_id should live in system_settings (existing table), not a new table
  • Use httpx async client with a short timeout (5s) — already a dependency
  • The existing _notify.py Resend key is a separate concern and should be moved to an env var in a follow-up; don't conflate with this issue
  • Jitter the daily fire time so coordinated deployments don't spike simultaneously at midnight

Activity

  1. added
    priority-p2
    type-feature
    on May 10, 2026
  2. added
    theme-infrastructure
    on Jun 3, 2026
  3. added
    complexity-medium
    status-incubating
    on Jun 12, 2026
  4. vybe commented on Jul 3, 2026

    @vybe
    ContributorAuthor

    Readiness triage 2026-07-03: duplicate of trinity-enterprise#12 (anonymous opt-in usage telemetry via hosted intake), which is the newer framing and lives in the correct tracker for feature work. First-run operator intake shipped separately (trinity-enterprise#38).

  5. removed
    status-incubating
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-mediumpriority-p2theme-infrastructuretype-feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions