Skip to content

Add anonymous self-hosted telemetry client#142

Merged
EricNGOntos merged 3 commits into
mainfrom
feat/wangbinqi/self-hosted-telemetry
Jun 11, 2026
Merged

Add anonymous self-hosted telemetry client#142
EricNGOntos merged 3 commits into
mainfrom
feat/wangbinqi/self-hosted-telemetry

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • add self-hosted telemetry config fields to shared API settings
  • add a small anonymous PostHog batch client using existing httpx
  • generate a stable anonymous installation id from env or a persistent file
  • emit API startup, heartbeat, and shutdown events without user/person profiles
  • enforce event/property allowlists so private request/document/query fields are stripped

Privacy boundary

  • PostHog events use the anonymous installation id as distinct_id
  • events include $process_person_profile=false
  • no user id, email, org id, IP address, document id, chunk id, filename, prompt, response, retrieval query text, request body, API key, webhook URL, or raw stack trace is emitted

Tests

  • uv run pytest apps/api/tests/contract/test_self_hosted_telemetry_contract.py -q
  • make lint
  • make typecheck
  • git diff --check

Comment thread packages/shared-python/shared/services/telemetry/client.py Fixed
@suguanYang suguanYang force-pushed the feat/wangbinqi/self-hosted-telemetry branch from dd23277 to 3522a1c Compare June 11, 2026 02:47

@EricNGOntos EricNGOntos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - all CI checks passed, no conflicts with main.

@EricNGOntos EricNGOntos merged commit e6b9f1d into main Jun 11, 2026
6 checks passed
@EricNGOntos EricNGOntos deleted the feat/wangbinqi/self-hosted-telemetry branch June 11, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants