Configure how OpenMeter should process your usage events. In this example, we
will meter the execution duration per API invocation, grouped by method and
route. You can think about how AWS Lambda
charges by execution duration on a
millisecond level.
config.yaml
# ...meters: - slug: api_request_duration description: API Request Duration # Filter events by type eventType: request aggregation: SUM # JSONPath to parse duration value valueProperty: $.duration_seconds groupBy: # HTTP Method: GET, POST, etc. method: $.method # Route: /products/:product_id route: $.route
The events will be processed and aggregated by OpenMeter using the
duration_seconds property, grouped by method and route properties.