Skip to main content
Ingest rules drop or sample logs, spans, and metric points before Squasher stores them. Squasher checks the rules of a project in order, and the first enabled rule that matches a row decides. Dropped data is not stored and not billed. Changes apply within about 60 seconds. See Ingest rules for the conditions, sampling, and error protection. Fields use camelCase.

Operations

List the rules

position is the evaluation order, 0 first. measured counts what the rule did over the last 7 days, in billing bytes. kept counts matched rows that the rule kept: the sampled share and protected error rows. The saving values are examples; Squasher reads them from your plan.

Add a rule

Each item of match.attributes is { "key", "op", "value" }. op is eq (exact text) or regex (an RE2 search, up to 256 characters, no lookaround or backreferences). The key is looked up in the resource attributes, then in the record attributes.
The response has status 201 and the new rule. The rule applies within about 60 seconds.

Change a rule

Send only the fields that change. Fields of match merge with the saved conditions. To remove a condition, set it to null (or [] for severities and attributes).
The response has the changed rule.

Order the rules

Send every rule ID of the project once, first rule first.
The response has the rules in the new order.

Remove a rule

The response has status 204. Within about 60 seconds, the rows of the rule are stored again, or the next matching rule applies.

Preview a rule

The preview takes the same body as a new rule and writes nothing. Add ruleId to test changes to a saved rule in its place. Rows that an earlier enabled rule matches are not counted, because that rule decides them first. The preview works on every plan.
matchedRows and matchedBytes are estimates: the project’s billed rows and bytes of the signal over the last 7 days, times the share of a bounded sample of stored rows that the rule matches. droppedShare is the share of the matched bytes the rule would drop: 1 for drop, 1 - samplePercent / 100 for sample, less the error rows when includeErrors is false. source names the data behind the estimate.

The saving

saving is the monthly money effect of the dropped bytes, from your plan’s current prices. Dropped data is not billed, so:
  • ingestCents is the telemetry charge of the month with the dropped bytes minus the charge without them. It is 0 while your telemetry stays within includedBytes; note then says so.
  • storageCents is an estimate of the storage charge of the data that is no longer stored. storageIsEstimate is always true.
  • projectedMonthBytes is your organization’s telemetry for a month at its recent rate.
  • droppedBytesPerMonth is the 7-day dropped bytes times 30/7.

Errors

TypeScript client and CLI

The CLI also has squasher ingest-rules create, update, reorder, and delete. For their flags, see the CLI reference.