Exporting data to Yandex Cloud

Attention. Data export is temporarily unavailable for new users.

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 runs on a regular basis.

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
  4. Troubleshooting

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.
Note. The User management via SQL option is currently unavailable.

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 Creating a service account in the Yandex Cloud Help.

  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 Creating an authorized key in the Yandex Cloud Help.

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 the Yandex Cloud data exports page, click Create 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:
    Name;

    Enter a name.

    Service account id.
    1. Open your folder in Yandex Cloud.
    2. Go to the Service accounts page by using the menu on the left.
    3. Click on the service account you created, for example, appmetrica.
    4. In the Overview section, copy the ID value.
    Public key id.
    1. Open your folder in Yandex Cloud.
    2. Go to the Service accounts page by using the menu on the left.
    3. Click on the service account you created, for example, appmetrica.
    4. In the Authorized keys section, copy theID value.
    Private key.
    The key that you saved when creating an authorized key.
    Folder ID.
    1. Open the Yandex Cloud console.
    2. Copy the ID of your folder.

    Click Create.

  4. Select the date period to export. If the Realtime option is enabled, the export process is run regularly.
  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.

Troubleshooting

The “FAILED_PRECONDITION: operation not permitted when SQL user management is enabled” error.

The User management via SQL option is currently unavailable. Disable the option and restart the export.

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.