Skip to main content

Submitting Telemetry Data to Element

Issue

  • I am unable to allow Element's telemetry upload to take place and need to submit my telemetry data to Element.

(By default, ESS servers connected to the internet will automatically send Telemetry to Element. Please allow this to happen by making sure you have not blocked ems.element.io from your homeserver. If you are air-gapped or need to block ems.element.io, then please follow the resolution below to manually submit Telemetry.)

Environment

  • Element Server Suite

Resolution

In order to gather telemetry data, you will need to use the element-telemetry-export.py script, which comes with the installer.

To do this, run:

cd ~/.element-enterprise-server/installer/lib
/usr/bin/env python3 ./element-telemetry-export.py 

You will be prompted for an access token:

Matrix user access token not specified in the "MATRIX_USER_ACCESS_TOKEN" environment variable. Please provide the access token and hit enter: 

You will need to provide a valid access token for a user who has access to the telemetry room. This can be found by logging in to Element Web as this user, going to "All Settings", then clicking "Help & About" and finally expanding the section for "Access Token".

accesstoken.png

Provide the access token to the prompt and hit enter.

Once you have done this, you will have some messages that look similar to:

2023-04-18 15:36:41,580:INFO:Parsing configuration file (/home/karl1/.element-enterprise-server/config/telemetry-config.json)
2023-04-18 15:36:41,581:INFO:Performing Matrix sync with homeserver (https://hs.element.demo)
2023-04-18 15:36:41,643:INFO:Scanning page 1
2023-04-18 15:36:41,716:INFO:Scanning page 2
2023-04-18 15:36:41,782:INFO:Writing 19 telemetry events to ZIP file (/home/karl1/.element-enterprise-server/installer/lib/telemetry_2023-04-18.zip)
2023-04-18 15:36:41,783:INFO:Saving some internal state (for next time)

and you will have a new zip file in this directory with a date stamp in the format telemetry_YYYY-MM-DD.zip. In my case, I have telemetry_2023-04-18.zip.

If you are having SSL connectivity issues with the exporter, you may wish to either disable TLS verification or provide a CA certificate to the exporter with these optional command line parameters:

  --disable-tls-verification
                        Do not check SSL certificate validity when querying the Matrix server
  --ca-cert-path CA_CERT_PATH
                        Specify the path to the CA file (or a directory) to use when verifying Matrix server's
                        SSL certificate. Consult README.md for more details

I can now browse to https://ems.element.io/on-premise/subscriptions and click "Upload Telemetry" next to the subscription that I wish to upload the data for:

ems-subs.png

I can then browse for my telemetry file and click "Submit Telemetry":

browse-telemetry.png

Once successful, you will see this screen:

success.png

You can then close the upload window.

Root Cause

  • Some environments do not allow telemetry data to be uploaded to Element. This is caused by blocking access from the homeserver to ems.element.io on port 443.