feat(OpenMeter): add kongctl bootstrap scripts#51
Closed
eliteprox wants to merge 5 commits into
Closed
Conversation
The billable_usd_micros meter (SUM on $.billable_usd_micros) rejected every create_signed_ticket event with "invalid event: missing value property" because the collector never emitted that field. Emit it as an interim passthrough equal to network_fee_usd_micros so the meter validates and accumulates; phase-2 markup (network × pipeline/model multiplier) is applied later. Update the README's two-meter section accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…omer OpenMeter attributes usage by exact subject match and forbids changing a customer's subject_keys once it has an active subscription. Customers are keyed (and subject-keyed) by the compound client_id:usage_subject, so a bare usage_subject subject never matches — producing "no customer found for event subject". Emit subject = auth_id (compound) instead of the bare usage_subject; data.client_id / data.usage_subject remain for per-tenant/user meter dimensions. Verified against live Konnect: a compound-subject create_signed_ticket event attributes to demo-client:demo-user (billable + network meters return values). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Idempotent provisioning of meters, features, plan check, and tenant customers via `kongctl api` (kongctl has no native meter resource yet, Kong/kongctl#1334), replacing the Go SDK provisioner from #39 with thin cross-platform scripts and a JSON catalog. - catalog.json — meters/features/plan_key (data, not code) - bootstrap.sh — Linux/Darwin; bootstrap.ps1 — Windows - subcommands: catalog | customer <client_id> <external_user_id> | all - customers keyed + subject-keyed by compound client_id:external_user_id; never mutates subject_keys (OpenMeter blocks that on subscribed customers) - verified against live Konnect: catalog idempotent, demo customer up to date Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…gement - Added support for loading environment variables from a specified .env file in both PowerShell and Bash scripts. - Improved error handling for missing Konnect PAT and added checks for meter and feature associations. - Introduced new functions for managing features and plans, including creation, validation, and publishing of plans. - Updated catalog.json to include a structured plan definition with phases and rate cards, replacing the previous plan_key approach. This update streamlines the provisioning process and ensures that features are correctly linked to their respective meters, enhancing the overall functionality of the OpenMeter provisioning scripts.
eliteprox
force-pushed
the
feat/openmeter-provisioning
branch
from
June 29, 2026 21:52
43024a1 to
8b643c9
Compare
9 tasks
Collaborator
Author
|
Superceeded by #53 |
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.
What does this PR do?
Makes the OpenMeter collector path end-to-end usable against Konnect and replaces the Go SDK provisioner from #39 with thin, idempotent
kongctlbootstrap scripts.Collector fixes (
openmeter-collector/collector.yaml):billable_usd_micros— the billable meter (SUM on$.billable_usd_micros) rejected everycreate_signed_ticketevent with "invalid event: missing value property". The collector now emitsbillable_usd_microsas an interim passthrough equal tonetwork_fee_usd_microsso the meter validates and accumulates. Phase-2 markup (network × pipeline/model multiplier) is deferred.subject— OpenMeter attributes usage by exact subject match; customers are keyed (and subject-keyed) byclient_id:usage_subject. A bareusage_subjectnever matched, producing "no customer found for event subject". The collector now setssubject = auth_id(compound) whiledata.client_id/data.usage_subjectremain for per-tenant/user meter dimensions.Provisioning (
openmeter-collector/provision/):catalog.json— meters, features, and plan key (data, not code)bootstrap.sh/bootstrap.ps1— cross-platform scripts usingkongctl api(no native meter resource yet; see Kong/kongctl#1334)catalog|customer <client_id> <external_user_id>|allclient_id:external_user_id; scripts never mutatesubject_keys(OpenMeter blocks that on subscribed customers)Closes #
Type of change
Affected component(s)
Integration mode
How was this tested?
Verified against live Konnect:
bootstrap.sh catalog— idempotent; meters/features created or reported up to datebootstrap.sh customer demo-client demo-user— demo customer provisioned with compound subject keycreate_signed_ticketCloudEvent with compound subjectdemo-client:demo-user— bothbillable_usd_microsandnetwork_fee_usd_microsmeters return values (usage attributes to the customer)Checklist
CHANGELOG_PENDING.mdif this is a user-facing changeNotes for reviewers
feat/identity-webhook; review collector identity contract alongside webhookauth_idshape.README.mdstill references the Goclearinghouse-bootstrapCLI in the bootstrap section — follow-up to point atopenmeter-collector/provision/(or remove the Go CLI reference once feat(collector): implement customer upsert functionality in OpenMeter collector #39 is fully superseded).README.mdidentity contract still listssubject = usage_subject; the collector and provision README now document compoundsubject = client_id:usage_subject. Align in a follow-up or as part of this PR if preferred.billable_usd_micros == network_fee_usd_microsis intentional until phase-2 markup lands.