Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/content/docs/extend/common-interface/config-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,34 +184,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:

```json
[
{
"metric": "API calls",
"value": 150
}
]
```

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-data-folder). You will get a
`stage_0.zip` archive in your **Storage** > **File Uploads**, which will contain the `config.json` file.
Expand Down
Loading