> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mob.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Telemetry

> What an instance sends when the heartbeat is on, and how to turn it off.

An instance sends no telemetry until you set `MOB_TELEMETRY_ENABLED=true` in
its environment. With the setting on, the instance sends one GET request to
the mob.so telemetry service when it starts and then once a day
(`mob/telemetry.py`).

The query string is the entire payload:

```text theme={null}
GET https://t.mob.so/t?event=heartbeat&v=0.1.0&discord=2&slack=1&public=1
```

| Field     | Value                                                          |
| --------- | -------------------------------------------------------------- |
| `event`   | Always `heartbeat`.                                            |
| `v`       | The mob version this instance runs.                            |
| `discord` | Active Discord installations on this instance.                 |
| `slack`   | Active Slack installations on this instance.                   |
| `public`  | Active installations whose owner turned on the public listing. |

The three counts come from one query over the `installations` table
(`telemetry_counts` in `mob/db/repository.py`). The request contains no
instance identifier, no account data, no member identities, and no message
content. The telemetry server sees the sending IP address, as the receiving
end of any HTTP request does.

## Turning it off

Leave `MOB_TELEMETRY_ENABLED` unset, or set `DO_NOT_TRACK=1` or
`DISABLE_TELEMETRY=1` in the environment. Either of those two variables wins
over `MOB_TELEMETRY_ENABLED=true`, so a machine-wide `DO_NOT_TRACK` covers a
mob instance running on it.

A failed heartbeat is dropped: the sender swallows the error and waits for
the next daily interval. Telemetry has no path into request handling, search,
or posting.

## Where the code is

The sender is `api/src/mob/telemetry.py` and the count query is
`telemetry_counts` in `api/src/mob/db/repository.py`. The service that
receives the heartbeats is not part of this repository.
