From f4a5ba5165f35f0d8bc6b4ec91705a277e8a4e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Van=C3=AD=C4=8Dek?= Date: Mon, 10 Aug 2026 15:06:17 +0200 Subject: [PATCH] Remove the Usage File section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The usage file has never worked. `job-runner` read `/data/out/usage.json`, validated it and handed it to `Client::addJobUsage()`, which has had an empty body since 2019 — the payload was always discarded, so `usageData` on a job is always empty and nothing translates it to credits. Two of the three claims in this section were therefore false: the payload was never "stored within a job", and it never fed billing. The one true claim - that a wrong format fails the component - goes with it, because the code that validated the file is being removed too. No page links to the removed anchor. --- extend/common-interface/config-file.md | 28 -------------------------- 1 file changed, 28 deletions(-) diff --git a/extend/common-interface/config-file.md b/extend/common-interface/config-file.md index 384f6320..1d020b17 100644 --- a/extend/common-interface/config-file.md +++ b/extend/common-interface/config-file.md @@ -187,34 +187,6 @@ are run simultaneously in the **same project**, the one writing data later wins. as an HTTP cookie than as a database. A typical use for the state file would be saving the last record loaded from some API to enable incremental loads. -## Usage File - -Unlike the state file, the **usage file is one way only** and has a pre-defined structure. -The usage file is used to pass information from the component to Keboola. -Metrics stored are used to determine how much resources the job consumed and translate the usage to Keboola -credits; this is very useful when you need your customers to pay using your component or service. - -The usage file is located at `/data/out/usage.json`. It should contain an array of objects -keeping information about the consumed resources. The objects have to contain only two keys, `metric` -and `value`, as in the example bellow: - -{% highlight json %} -[ - { - "metric": "API calls", - "value": 150 - } -] -{% endhighlight %} - -This structure is processed and stored within a job, so it can be analyzed, processed and aggregated later. - -To keep track of the consumed resources in the case of a component failure, **it is recommended to -write the usage file regularly** during the component run, not only at the end. - -*Note: As the structure of the state file is pre-defined, the content of the usage file is strictly -validated and a wrong format will cause a component failure.* - ## Examples To create an example configuration, use the [Run Job API call in debug mode](/extend/component/running/#preparing-the-data-folder). You will get a `stage_0.zip` archive in your **Storage** > **File Uploads**, which will contain the `config.json` file.