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.

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 getdo started,this, yourun:

will
cd need to create a configuration file that has the following in ~/.element-enterprise-server/config/installer/lib
/usr/bin/env python3 ./element-telemetry-config.json:

{
        "homeserver": {
                "base_url": "https://hs.element.demo",
                "access_token": "syt_s0m3t0k3nbWluLWRvbm90ZGVsZXRl_OcCeJSNKHPLsbececapM_3jON6y",
                "room_id": "!EUaiYKUtdFlLuCqDdT:element.demo"
        }
}export.py 

ForYou will be prompted for an access token:

Matrix user access token not specified in the base_url"MATRIX_USER_ACCESS_TOKEN" variable,environment youvariable. willPlease need to specifyprovide the fqdnaccess oftoken yourand homeserver.

hit enter:

For the access_token variable, youYou 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

ForProvide the room_idaccess variable, you will needtoken to join the telemetry room /join #element-telemetry:element.demoprompt and thenhit open the "Room Settings" and click on "Advanced" and there you will see the "Internal Room ID". In the given /join command, you will need to replace element.demo with your homeserver domain. The Room Settings panel with the ID looks like:enter.

roomsettings.png

Once you have these three variables filled in for your homeserver setup, you can run:

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

Once you have rundone 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/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.