This example is based on our earlier blog post about testing OpenMeter with Benthos.
The input in this case generates random events (mimicking API calls).
Go to the GitHub Releases page and download the latest benthos binary for your platform.
Check out this repository if you want to run the example locally:
git clone https://github.com/openmeterio/benthos-openmeter.git
cd benthos-openmeter/examples/generateCreate a new .env file and add the details of your OpenMeter instance:
cp .env.dist .env
# edit .env and fill in the detailsTip
Tweak other options in the .env file to change the behavior of the example.
Create a meter in OpenMeter with the following details:
- Event type:
api-calls - Aggregation:
SUM - Value property:
$.duration_ms - Group by (optional):
method:$.methodpath:$.pathregion:$.regionzone:$.zone
Tip
Read more about creating a meter in the general examples README.
Launch the example:
export OPENMETER_TOKEN=<YOUR TOKEN>
benthos -c config.yamlWarning
By default the example generates 1000 events per second.
Read more in the general examples README.
Check out the configuration files and the Benthos documentation for more details.
We are actively working on improving the documentation and the examples. In the meantime, feel free to contact us in email or on Discord.
We are more than happy to help you set up OpenMeter in your production environment.