Repository navigation
feat(pricing): Convert usage into the pricing unit - #124
Merged
Merged
Conversation
Meters count raw units (bytes, byte-seconds, millicore-seconds) while ServicePricings price per GiB, GiB-second or vCPU-second, and nothing said how to get from one to the other. Providers billed the per-GiB rate per byte. ServicePricing.spec.unitConversion states how many meter units make one pricing unit, with a required description of why. Offers snapshot it with the rest of the spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Offer CRD repeats the ServicePricing spec in its unbounded servicePricings list, so the regex rule's estimated cost exceeded the CEL budget 8.4x and the API server refused the CRD. A pattern that excludes zero checks the same thing at no CEL cost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
uppppp!!! 🚀 |
mattdjenkinson
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Meters count raw units: bytes, byte-seconds, millicore-seconds. ServicePricings price per GiB, GiB-second or vCPU-second.
pricingUnitis only a label, so nothing tells a provider how to get from one to the other.openmeter-provider sends the rate as is, so OpenMeter charges the per-GiB rate per byte. Datum's staging bill for the current period is about $1.97B, and invoices go to Stripe on Nov 10.
How
ServicePricing.spec.unitConversion(Usage charges only):meterUnitsPerPricingUnit: how many meter units make one pricing unit. A positive decimal, checked in the CRD.description: required, so the reason for a conversion is always written down for whoever maintains the pricing.The provider will pass it to OpenMeter's
unit_config(divide by the factor), so usage is converted rather than the price. Invoices then read3600 GiB-s x $0.0000045instead of byte counts times a tiny per-byte price. I verified this on a kind cluster: 3,600 GiB-s plus 300 GiB of egress (200 GiB free) invoiced exactly $5.02.Follow-ups: service-catalog passes the field through its fan-out, and openmeter-provider applies it.
🤖 Generated with Claude Code