openmeterio / openmeter

Metering and Billing for AI, API and DevOps. Collect and aggregate millions of usage events in real-time and enable usage-based billing.
https://openmeter.io
Apache License 2.0
1.14k stars 68 forks source link

fix(serializer): allow cloudevents without data #1853

Closed hekike closed 1 week ago

hekike commented 1 week ago

The Kafka event serializer always expected the data property to be set. This resulted in an incorrect 500 error for users. This PR makes the data property optional and sets it as an empty string in the Kafka message.

This change need to be backported to the new parser: https://github.com/openmeterio/openmeter/pull/1720/files#diff-4b55946e836c7ec5383592308e9cde246b976ed16da8a83f571c413f46166252R75