telemetry · usage analytics for open source
Send one POST from your app and see who uses it. No sign-up: the first event creates the project.
- /telemetry
- 1 project, public
- by duyet
- MIT
- Self-host ↓
Daily, weekly and monthly users, versions, platforms and countries, on a public page and as JSON. It works for CLIs, desktop apps, web pages and anything that speaks OTLP, and runs inside the Cloudflare free plan.
How it works
- 1Pick a slug: lowercase letters, digits and dashes, like
my-cli. - 2Send the first event. It creates the project and returns your admin token, once.
- 3Open
https://telemetry.anyr.workers.dev/my-cli.
curl -X POST https://telemetry.anyr.workers.dev/my-cli \
-d '{"event":"ping","id":"<random-id>","version":"1.0.0"}'
→ {"accepted":1,"dropped":0,"project":{"slug":"my-cli","created":true,
"admin_token":"tk_…","page_url":"https://telemetry.anyr.workers.dev/my-cli"}}Save the admin token. It renames the project, rotates the token, and imports history.
Send events
One JSON object per event, or an array of up to 25. The id is a random string your client keeps; the server hashes it with a secret salt and never stores it raw.
event- Required. A name like ping, run or build. Letters, digits, _ . : / and -, up to 64 characters.
id- Random install id the client persists. With it, users are counted across days. Without it, daily users only.
version- App version, up to 32 characters.
os,arch- What the runtime reports: linux, darwin, windows; x64, arm64. Do not remap them.
ci- true when the event came from a CI run.
props- Up to 8 extra keys with short string, number or boolean values. Keep them categorical.
n- Occurrence count, 1 to 1000. Default 1.
The country comes from Cloudflare. The IP and user agent are never stored. Full rules in the API docs.
OpenTelemetry
Any OpenTelemetry SDK or collector can send to the same project. Point it at the project URL with JSON encoding.
export OTEL_EXPORTER_OTLP_ENDPOINT=https://telemetry.anyr.workers.dev/my-cli
export OTEL_EXPORTER_OTLP_PROTOCOL=http/jsonLogs, traces and metrics become events. Set service.instance.id as a resource attribute to count users.
With an agent
Every project has a playbook at /<slug>/install.md. Paste this prompt into Claude Code, Codex or Cursor and the agent wires the client in, with an opt-out env var and a Telemetry section in the README.
Add anonymous usage telemetry to this repo. Follow https://telemetry.anyr.workers.dev/my-cli/install.md exactly. Respect DO_NOT_TRACK, add an opt-out env var and a Telemetry section to the README, never send PII, never block the main path.Projects
- 0 users/day
Self-host
One Worker, one D1 database, one Analytics Engine dataset. The schema applies itself on first request.
git clone https://github.com/duyet/telemetry && cd telemetry && bun install && bunx cf deployEnable Analytics Engine once in the Cloudflare dashboard, under Workers & Pages. The free tier covers it.
Privacy
Ids are hashed with a secret salt before they are stored, and the raw id is never written anywhere.
IP addresses and user agents are never stored. Raw events are deleted after 90 days; only daily counts stay.
Every project page and its JSON are public. Send nothing you would not publish as an aggregate.