Skip to main content
Test a change to a question in staging before production’s answers use it, and production’s answers change only when you activate the new version there. Put staging under its own prefix in the same organization as production, with its own key, its own budgets and (if you use them) its own templates. For example, production uses acme/prod/tenant_123, and staging uses acme/staging/tenant_123. Brussle bills staging as it bills production, so each staging namespace that Brussle judges in a billing period counts toward the tenant fee, like any other namespace. Marking the staging prefix non-production keeps its tenants out of production’s corrections, but the mark changes nothing on your bill. To keep staging cheap:
  • Copy only the tenants that you need to test, not every production tenant.
  • Give each staging namespace a small budget.
  • Try things in default/quickstart first, since it is free up to its limit.
default/quickstart is a free place to try things, with a small limit in each billing period (pricing). Give your staging deployment a prefix of its own, since default/quickstart is not a staging environment.

A layout

Use production’s names under a different environment prefix (tenants and environments).
  • The key. Give your staging deployment only the acme/staging/* key, which cannot read or change anything in production and cannot mark or unmark prefixes. Create keys on the dashboard’s Keys page (a scope can name a prefix before anything exists under it).
  • The template. Define staging’s judgments on acme/staging/*, as production’s are on acme/prod/*, and each staging tenant has them. Templates need the Team plan, in staging and in production.
  • The budget. A budget is a namespace setting, and a prefix has no budget. A namespace exists from its first write, judgment, group or subscription, so set the budget right after each staging tenant’s first write, with PATCH /namespaces/{ns} (ns.update(budget=...)). Before the namespace exists, the call returns not_found. With pause, a staging tenant stops judging at its budget, and then changed answers read stale, documents never judged read unavailable, and writes continue.

Mark the prefix non-production

Admins and owners mark prefixes in the dashboard under Settings → Non-production prefixes, and every member can see the list. With the API:
  • To mark and unmark, use a read_write key scoped to your whole organization (*), which only admins and owners create. Any other key gets forbidden.
  • To list, use any key of the organization.
These calls are PUT /nonproduction-prefixes/acme%2Fstaging%2F, GET /nonproduction-prefixes and DELETE /nonproduction-prefixes/acme%2Fstaging%2F, and all three return the list:
  • Form. A prefix is namespace characters that end in /. Brussle accepts acme/staging/* and stores it as acme/staging/. A prefix cannot be the whole organization.
  • Timing. A prefix needs no namespaces yet, so mark it before staging records outcomes, and no fit pools them with production’s.
  • How many. At most 20 prefixes can be marked at the same time, so a 21st mark returns conflict. Marking a marked prefix, or unmarking one that is not marked, changes nothing.
  • Audit. Your audit log records each change as org.nonproduction.

What it changes

The mark has one effect, on the template’s pooled correction.
  • The correction. A template’s pool leaves out its tenants under a marked prefix, so their outcomes stay out of the pooled correction and out of the pool that other tenants’ own corrections are held toward. These tenants read the pool and get no correction of their own, and their calibration report says tenant.reason: "non_production". The mark matters when one template covers both environments (such as acme/*). A template that is itself under the marked prefix (such as acme/staging/*) pools its staging tenants together as usual, so staging gets corrections like production, and production’s do not change. Each fit reads the marks as they are when it runs, so a tenant that you mark leaves the pool at the next fit, and a tenant that you unmark joins it again with all its outcomes.
  • Nothing else. The mark does not change your bill. Brussle bills judging, storage, writes and queries under a marked prefix as usual. Each namespace there that Brussle judges in a billing period counts toward the tenant fee, and shadow reports sample its tenants as usual.

Promote a change from staging to production

A judgment change reaches production the same way it reached staging: create the same definition on the production prefix, and let a shadow report on production’s own documents decide the switch. No route copies a judgment from one prefix to another, so keep the definition in your code. Do not use force on the production activation, since staging’s report measured staging’s documents and production’s documents can change in a different way. Shadow reports are free in both environments.
  1. In staging, post the definition again under the same name on acme/staging/*, with the staging key. This request creates the new version, which stays inactive.
  2. Activate the new version on acme/staging/*, which gives you one shadow job, sampled across the staging tenants.
  3. Read the shadow report.
  4. Confirm the shadow job once the report looks right, and each staging tenant switches to the new version.
  5. Ask for a backfill estimate on acme/staging/*.
  6. Confirm the backfill, which judges the existing documents again with the new version.
  7. Test your staging deployment against the new version.
  8. In production, create the same definition on acme/prod/* with the production key. Brussle numbers versions separately for each template, so the version number in production can differ.
  9. Activate the new version on acme/prod/*, which gives you a shadow job, sampled across production tenants.
  10. Read that shadow report.
  11. Confirm the shadow job once the report looks right. Each production tenant switches to the new version, and the confirm starts a backfill on acme/prod/* at the cost of the report’s recompute. To keep production as it was, cancel the job instead.
  12. When the shadow job is done, read its backfill_job_id to follow the backfill. If it is null and answers still read older_version, the cost did not fit a budget or your organization’s balance, so ask for a backfill estimate on acme/prod/* and confirm it.
An answer from the earlier version reads stale, with stale_reason older_version, until the backfill or the document’s next change judges it again. answers: "fresh_only" leaves the answer out, so old and new answers do not mix silently (change the question for every tenant).

Keep staging data synthetic

A staging namespace can have a provider key of its own, such as a test account at your provider, which wins over the organization’s key there. Brussle judges staging documents as it judges production documents, so the engine’s provider sees them (each engine’s page names who handles your data). Use synthetic or cleaned records in staging where you can, rather than copies of production data.