Exporting data to Yandex Cloud
Alert
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:
Step 1. Check the ClickHouse cluster settings
-
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.
-
Ensure that the Access from Metrica and AppMetrica option is enabled in the cluster settings.
-
(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
-
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.
-
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
Alert
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.
-
In the AppMetrica interface, click Data export → Upload to cloud.
-
On the Yandex Cloud data exports page, click Create new export.
-
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.
- Open your folder in Yandex.Cloud.
- Go to the Service accounts page by using the menu on the left.
- Click on the service account you created, for example, appmetrica.
- In the Overview section, copy the ID value.
Public key id.
- Open your folder in Yandex.Cloud.
- Go to the Service accounts page by using the menu on the left.
- Click on the service account you created, for example, appmetrica.
- In the Authorized keys section, copy theID value.
Private key.
The key that you saved when creating an authorized key.
Folder ID.
- Open the Yandex Cloud console.
- Copy the ID of your folder.
Click Create.
-
Select the date period to export. If the Realtime option is enabled, the export process is run regularly.
-
In the field Event fields select the parameters to export.
For more information about event parameters, see the Logs API available endpoints .
-
In the Cluster field select the cluster to export. It creates a table with exported parameters.
-
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:
- Start exporting data to the cluster. This creates a user named
appmetrica_export_user
with certain permissions. - In the Yandex Cloud interface, go to the folder page and select Managed Service for ClickHouse.
- Click on the name of the appropriate cluster and select the Users tab.
- 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.
See also
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.