Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Generate

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).

Table of Contents

Prerequisites

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/generate

Create a new .env file and add the details of your OpenMeter instance:

cp .env.dist .env
# edit .env and fill in the details

Tip

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: $.method
    • path: $.path
    • region: $.region
    • zone: $.zone

Tip

Read more about creating a meter in the general examples README.

Launch the example

Launch the example:

export OPENMETER_TOKEN=<YOUR TOKEN>
benthos -c config.yaml

Warning

By default the example generates 1000 events per second.

Checking events

Read more in the general examples README.

Advanced configuration

Check out the configuration files and the Benthos documentation for more details.

Production use

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.