# Telemetry

Telemetry is an automated process that collects data at a remote point. The only
reason why Memgraph uses telemetry data is to improve its products by focusing
on areas important to users. Memgraph fully understands the need for user
privacy which is why the telemetry feature is completely optional and can be
**[fully disabled](#how-to-disable-telemetry)** before starting the database.

This article serves to cultivate transparent communication with the developer
community. Your feedback is very much appreciated, and telemetry data is a way
of receiving such feedback. If you wish to get in touch with us, you can always
[schedule an office hours call](https://memgraph.com/office-hours) or join our
community on [Discord](https://www.discord.gg/memgraph).

## Data collected

While a Memgraph database instance is running and an open internet connection is
available, the following data will be sent to and stored on Memgraph's servers.

**Information about the host machine:**
  - CPU model
  - CPU microarchitecture level
  - Memory information
  - Host OS
  - Kernel information

**Information about the clients:**
  - client name
  - supported and agreed Bolt version
  - number of sessions from each clients
  - number of executed queries
  - authentication type (user or anonymous)

**Information about active databases:**
  - disk storage and usage
  - RAM usage
  - number of nodes and relationships
  - number of distinct labels and edge types
  - number of constraints and indices
  - number of triggers and streams
  - storage mode
  - isolation level
  - property store compression settings

**Aggregate statistics across all databases:**
  - Total number of databases
  - Total number of users and roles
  - Distribution of labels by node count
  - Number of databases per storage mode
  - Number of databases per isolation level
  - Number of databases with snapshots/WAL enabled

**Database runtime information:**
  - If durability and SSL is enabled.
  - Timestamp of the first failed and first successful executed query.
  - Event counters - For example, number of failed queries or `ScanAll` operator calls.
  - Query module calls - **Only the names** of the query module and procedure are recorded.

**High availability cluster information:**
  - The number of strict sync, sync and asynchronous replicas (retrieved from the current main).
  - The number of coordinators in the cluster.
  - Coordinator runtime settings: `instance_down_timeout_sec`, `instance_health_check_frequency_sec`, `enabled_reads_on_main`, `sync_failover_only`.

**Running environment:**
  - Whether Memgraph is running in K8s or somewhere else.

No personal information is intentionally included in telemetry payloads. As with
any network communication, the source IP address of the connecting instance is 
visible to Memgraph's servers. Each database generates a unique identifier by
which data coming from the same database instance is grouped. This unique
identifier is not connected to other personal information about the user.

## Data usage

Telemetry data is used by Memgraph's developers for the purpose of developing
new functionalities and the general maintenance of products. By analyzing the
host machine environment and runtime information, products can be optimize to
better suit specific user needs.

For example, if there is a considerable number of users who regularly call
NetworkX query modules, more resources would be invested in the development of
similar new features and extending the support for implemented ones.

As is often the case, certain goals need to be prioritized. A data-driven
understanding of product usage will help memgraph prioritize features that are
more likely to benefit a larger subset of Memgraph users.

## Disable telemetry

Telemetry is **completely optional** and can be fully disabled when starting the
database.

There are two ways to disable Memgraph's telemetry features:
- In the `/etc/memgraph/memgraph.conf` file change the setting
  `--telemetry-enabled=true` to `--telemetry-enabled=false`.
- Include `--telemetry-enabled=false` as a command-line argument when starting
  the database.

## Enterprise Telemetry

In addition to the above details, when Memgraph Enterprise is activated by
applying the license key, Memgraph pings back home with relevant licensing data
(every ~8h). The exact list of data points follows below:

* Organization name
* License type - `oem` or `enterprise`
* License key
* License memory limit - limit specified under the license
* Physical memory size - total amount of memory available from the database instance perspective
* Swap memory size - total amount of swap memory available
* Memory used - actual memory used at a given point in time
* Runtime memory limit - limit set by the user when starting an instance
* Machine ID - content of the `/etc/machine-id` (if distinct)

NOTE: Sending licensing information cannot be manually disabled, unlike the
Community Telemetry part explained above; in other words, Memgraph will always
attempt to send the licensing data back home. Of course, it's possible to
disable it on the networking layer forcefully (if there are some compliance
requirements); in such a case, manual reporting (periodically, via email) is
required.
