Test and Publish
Billing rules should be tested before they affect live ingestion. The normal order is:
- Run an interactive rule test against a draft or published rule set.
- Publish the reviewed rule so production APIs can use it.
- Run the test again against the published rule, then submit a simulated real event when you want to verify ingestion and account billing.
Rule version lifecycle
Section titled “Rule version lifecycle”A rule set keeps the same rule ID across edits. Editing creates the next draft version. Publishing moves the current version pointer to that draft, and rollback moves the current pointer back to an earlier published version. Historical published versions remain read-only.
Delete a draft when you want to discard unpublished changes. If v2 is still a draft and the current version is v1, deleting the draft returns the editor to v1 without changing live ingestion. Rollback is different: it changes the current version immediately, so use it only after selecting a previously published version.
Run an interactive rule test
Section titled “Run an interactive rule test”Open Rules and select Rule test.
Use this test before publishing. It runs your sample raw event against the selected extractor and optional pricing rule set, but it does not write production usage data or debit accounts.
- Select an extractor rule set. This can be a draft while you are still editing.
- Optionally select a pricing rule set.
- Paste a raw event JSON sample.
- Select Run test.
The result shows:
- extracted subject and dimensions;
- generated charge items;
- rated amounts when pricing is available;
- unmatched items when fallback pricing did not match.
Adjust the draft and run the test again until the extracted subject, dimensions, charge items, and amounts match what you expect.
Publish after the test passes
Section titled “Publish after the test passes”Open Rules.
Publishing promotes a tested draft into the active project rule set selection path. Production ingestion and rating use published rule sets, not arbitrary drafts, so unfinished edits cannot accidentally change customer billing. The published version also gives audit, replay, account billing, and support workflows a stable rule version to reference later.
- Find the extractor or pricing rule set.
- Select Details.
- Review the rule set ID, status, version, effective time, and configuration.
- Select Publish.
Only draft rule sets can be published. Published rule sets remain auditable. If you no longer want a published rule set active, archive it from the details sheet.
Test the published production path
Section titled “Test the published production path”After publishing, return to Rule test, select the published rule set, and run the same sample again. The Portal can then show a simulated real-reporting action.
Use this action to submit the sample event into the current project’s production ingestion path. The Portal adds an idempotency key for the test request. This is useful when you want to verify the same path used by the production API, including subject routing, account resolution, wallet debit behavior, and usage explorer visibility.
After submitting:
- Open Usage explorer.
- Use a recent time window.
- Select Show usage or turn on Live.
- Confirm the event and charge items appear after queue processing completes.
- If the subject is routed to an account and realtime debit is enabled, verify the account and wallet results in the Portal.
When to use a pricing rule set in tests
Section titled “When to use a pricing rule set in tests”Leave pricing empty when you only want to verify extraction.
Select a pricing rule set when:
- extractor charge items do not have attached pricing;
- you need to verify fallback matching;
- you want to test metric-specific pricing rules before publishing them.