getlago / lago-api

Open Source Metering and Usage Based Billing
https://www.getlago.com/
GNU Affero General Public License v3.0
321 stars 94 forks source link

[FEAT]: Support CloudEvents as a usage data format for ingestion #1986

Open mostafa opened 2 months ago

mostafa commented 2 months ago

Is your feature request related to a problem? Please describe.

I would like to be able to send CloudEvents and possibly CDEvents to the events controller to update billable metrics.

Describe the solution you'd like

A simple solution is to accept CloudEvents (using the Ruby SDK) for usage data along with the current usage data format with the option to include the fields of the internal events in CloudEvents' data field, and possibly fully transition to CloudEvents at some point.

Describe alternatives you've considered

The current way is to convert CloudEvents to the usage data format before ingestion.

Additional context

OpenMeter already supports CloudEvents, but I prefer to see this feature in this product. Also, I'd be happy to implement it myself, with minimal guidance.

jdenquin commented 2 months ago

@michaelponrajah should we add it into our roadmap?