Skip to Content
truemetrics Docs

Data Export

Export setup

Where the daily export goes: an S3 bucket you read from AWS or Google Cloud, or your SFTP server.

Most customers take a daily batch export of their position data and stop KPIs. truemetrics writes it to an S3 bucket that you read from AWS or copy into Google Cloud, or pushes it to your SFTP server for on-premises or other cloud setups. No API key is needed for the export, see API keys. What the files contain is in Export format, how they are laid out in Update and versioning.

AWS

How it works

truemetrics writes exports to an Amazon S3 bucket named true-shared-<your company> in AWS region eu-central-1. The bucket is owned by truemetrics and used only for your data. Each export run adds new folders with the stop KPIs and the positions, see Update and versioning.

You read the files with your own AWS account: directly, or with a daily copy into a bucket you own. No passwords or access keys are exchanged. truemetrics gives read access to the bucket to one IAM role in your account, and to nothing else.

Setup

1. Create the reading role

Create an IAM role in your account for the job that will read or copy the files, for example a Lambda function, an ECS task or an EC2 instance.

2. Send us the role ARN

Send the role’s ARN (arn:aws:iam::<your account ID>:role/<role name>) to info@truemetrics.io. It is not a secret. We allow that role to read the bucket and send you:

  • the name of the S3 bucket
  • the time of day the export finishes

3. Grant the role read access on your side

Access across accounts has to be allowed on both sides. Attach a policy like this to the role:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::true-shared-<your company>"
    },
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::true-shared-<your company>/*"
    }
  ]
}

4. Read or copy the files daily

Schedule your job after the export time we sent you. To copy new files into your own bucket:

aws s3 sync s3://true-shared-<your company>/ s3://<your bucket>/truemetrics/

Don’t add --delete: we keep the files on our side for our own delivery checks and clean them up ourselves, and --delete would then remove your copies of older exports.

Google Cloud

How it works

truemetrics writes exports to an Amazon S3 bucket in AWS region eu-central-1. The bucket is owned by truemetrics and used only for your data. Each export run adds a folder for the positions and one for the stops, see Update and versioning.

To get the files into Google Cloud, you set up a daily copy job with Google Storage Transfer Service (STS). The job runs in your Google Cloud project and copies new files from our S3 bucket into a Cloud Storage bucket you own.

No passwords or access keys are exchanged. truemetrics creates an AWS role that can only read your export bucket, and allows only your project’s Storage Transfer Service to use it.

Setup

1. Choose a project

Pick the Google Cloud project that will run the copy job and enable the Storage Transfer API in it.

2. Create the destination bucket

SettingRecommended value
LocationSingle region in the EU, e.g. europe-west3 (Frankfurt)
Storage classStandard
Access controlUniform bucket-level access
Public accessPrevented

If the bucket is encrypted with your own key (CMEK), or your project is inside a VPC Service Controls perimeter, see Special cases.

3. Send us your Storage Transfer identity

Storage Transfer Service uses a Google-managed account in your project, called the service agent. To find it, run googleServiceAccounts.get with your project ID. You can use the “Try this method” panel on that page.

The response looks like this:

{
  "accountEmail": "project-123456789@storage-transfer-service.iam.gserviceaccount.com",
  "subjectId": "1234567890123456789"
}

Send us the subjectId. It is not a secret. We use it to set up the AWS role so that only your service agent can use it. We then send you:

  • the name of the S3 bucket
  • the role ARN (arn:aws:iam::…:role/…)
  • the time of day the export finishes

4. Grant permissions

WhoRoleOn
The service agent (accountEmail from step 3)Storage Legacy Bucket Writer (roles/storage.legacyBucketWriter)The destination bucket
The service agentStorage Object Viewer (roles/storage.objectViewer)The destination bucket
The person creating the jobStorage Transfer User (roles/storagetransfer.user)The project

If you create the job in the Cloud Console with Storage Admin rights on the bucket, the console grants the two service agent roles for you.

5. Create the transfer job

In the Cloud Console, go to Storage Transfer Service → Create transfer job:

  • Source: Amazon S3. Enter the bucket name, and authenticate with the AWS IAM role (federated identity) using the role ARN from step 3.
  • Destination: your bucket from step 2, optionally a folder in it.
  • Schedule: daily, starting after the export time we sent you.
  • Options: keep Delete files from source off. We keep the files on our side for our own delivery checks and clean them up ourselves.
  • When to delete: select Never. Otherwise a later run deletes your copies of older exports once we have cleaned them up on our side.

Special cases

  • Customer-managed encryption key (CMEK): grant the Cloud Storage service agent of the destination bucket’s project (service-PROJECT_NUMBER@gs-project-accounts.iam.gserviceaccount.com) Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter) on the key.
  • VPC Service Controls: if Storage Transfer Service (storagetransfer.googleapis.com) and Cloud Storage (storage.googleapis.com) are restricted services in your perimeter, put the project that runs the transfer job in the same perimeter as the project of the destination bucket. If the job’s project stays outside, add a perimeter rule that lets it write to the bucket. VPC Service Controls does not block the import from our S3 bucket itself.

SFTP

For on-premises or other cloud setups, truemetrics pushes the files to your SFTP server every day. Send us:

  • the host name and port (22 if not stated)
  • the user name, and either its password or an RSA key pair for it (we hold the private key)
  • the folder for the files, and a second folder if stop KPIs should be kept apart from positions

The folders must exist before the first export; truemetrics does not create them. The files are CSV by default, Parquet where agreed. truemetrics keeps a copy of every file it sends. The file names are in Update and versioning.

On this page