Export data to Yandex.Cloud

Attention. You can only export event parameters.

If you use Yandex.Cloud and Managed Service for ClickHouse, you can export data from AppMetrica to your cluster. You can use the data, for example, to create your own reports in Yandex DataLens.

Data can be exported “in real time” — export starts every 30 minutes.

This section below describes the steps for configuring export:

  1. Step 1. Check the ClickHouse cluster settings
  2. Step 2. Create a service account and an authorized key
  3. Step 3. Start exporting process

Step 1. Check the ClickHouse cluster settings

  1. Ensure that your ClickHouse cluster has two or more hosts. This is necessary for replication.

    If the cluster is with a single host, add one or more hosts.

  2. Ensure that the Access from Metrica and AppMetrica option is enabled in the cluster settings.
  3. (Optional) To create reports in Yandex DataLens, ensure that the Access from the DataLens option is enabled in the cluster settings.

Step 2. Create a service account and an authorized key

  1. Create a service account in the Yandex.Cloud console. When creating select a role editor.

    For more information, see the Creating a service account article of the Yandex.Cloud documentation.

  2. Create an authorized key. After creating, save the secret part of the key, for example, in a text file. You need it to link your service account to AppMetrica.

    For more information, see the Creating an authorized key article of the Yandex.Cloud documentation.

Step 3. Start exporting process

Attention. When the export is running, you cannot change the cluster configuration. To change the configuration, stop all running export processes, change the configuration, and start the export again.
  1. In the AppMetrica interface, click Data export → To the Cloud.

  2. On page Export to Yandex.Cloud press the button Launch a new export.
  3. Link your Yandex.Cloud service account To do this, in the Service account field click the Create button. In the window that opens, specify the following:

    Click Create.

  4. Select the date period to export. If the Realtime option is enabled, export process runs every 30 minutes.
  5. In the field Event fields select the parameters to export.

    For more information about event parameters, see the Logs API available endpoints .

  6. In the Cluster field select the cluster to export. It creates a table with exported parameters.
  7. Click the Launch export button.
Note. If you want to create a MaterializedView based on the exported table, do the following before creating the MaterializedView:
  1. Start exporting data to the cluster. This creates a user named appmetrica_export_user with certain permissions.
  2. In the Yandex.Cloud interface, go to the folder page and select Managed Service for ClickHouse.
  3. Click on the name of the appropriate cluster and select the Users tab.
  4. Grant the appmetrica_export_user the rights to write data to the database where you want to create the MaterializedView. Otherwise, the export is suspended.