Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(logs): reject vacuous drop-rule filter groups at write time (#67596)

Daniel Visca77ac2dc0bb29
diff --git a/products/logs/backend/presentation/views/sampling_api.py b/products/logs/backend/presentation/views/sampling_api.py
index 889c30c66667..0f4f205f9601 100644
--- a/products/logs/backend/presentation/views/sampling_api.py
+++ b/products/logs/backend/presentation/views/sampling_api.py
@@ -69,6 +69,25 @@ def _filter_group_node_count(node: Any) -> int:
return total
+def _filter_group_has_empty_group(node: Any) -> bool:
+ """True when any group node in the tree has an empty `values` list. The worker's
+ matchFilterGroup treats empty groups as no-match (dropping is irreversible, so
+ vacuous filters fail closed), which makes a rule carrying one silently inert —
+ worst on rate_limit, where `{"type": "AND", "values": []}` reads like "cap
+ everything" but caps nothing.
+
+ Recurses without a depth short-circuit of its own — callers must run the
+ MAX_FILTER_GROUP_DEPTH check first so the tree is already bounded."""
+ if not isinstance(node, dict):
+ return False
+ values = node.get("values")
+ if not isinstance(values, list) or node.get("type") not in ("AND", "OR"):
+ return False
+ if len(values) == 0:
+ return True
+ return any(_filter_group_has_empty_group(child) for child in values)
+
+
class LogsSamplingRuleSerializer(serializers.ModelSerializer):
id = serializers.UUIDField(read_only=True, help_text="Unique identifier for this sampling rule.")
name = serializers.CharField(max_length=255, help_text="User-visible label for this rule.")
@@ -112,7 +131,9 @@ class LogsSamplingRuleSerializer(serializers.ModelSerializer):
"AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) "
"+ `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. "
'Filter group example: `{"type":"AND","values":[{"type":"AND","values":['
- '{"key":"service.name","operator":"exact","value":"api"}]}]}`. '
+ '{"key":"service.name","operator":"exact","value":"api"}]}]}`. Every group in '
+ "`filter_group` must contain at least one filter — empty groups never match, so the "
+ "rule would never apply. "
"For severity_sampling: object with `actions` per severity level and optional `always_keep`. "
"For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` "
"integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, "
@@ -151,6 +172,10 @@ class LogsSamplingRuleSerializer(serializers.ModelSerializer):
if rule_type is None and self.instance is not None:
rule_type = self.instance.rule_type
config = attrs.get("config")
+ # Only reject vacuous groups on requests that actually write config: rows that
+ # predate this validator can carry an empty group, and a PATCH of unrelated
+ # fields (e.g. disabling the rule) must not be blocked by the stored config.
+ reject_vacuous = config is not None
if config is None and self.instance is not None:
config = self.instance.config
@@ -167,11 +192,11 @@ class LogsSamplingRuleSerializer(serializers.ModelSerializer):
mak = config.get("match_attribute_key")
if mak is not None and mak != "" and not isinstance(mak, str):
raise ValidationError({"config": {"match_attribute_key": "Must be a string when provided."}})
- self._validate_filter_group(config.get("filter_group"))
+ self._validate_filter_group(config.get("filter_group"), reject_vacuous=reject_vacuous)
if rule_type == LogsExclusionRule.RuleType.RATE_LIMIT:
if not isinstance(config, dict):
raise ValidationError({"config": "rate_limit rules require config to be a JSON object."})
- self._validate_filter_group(config.get("filter_group"))
+ self._validate_filter_group(config.get("filter_group"), reject_vacuous=reject_vacuous)
self._validate_rate_limit_config(config)
return attrs
@@ -227,7 +252,7 @@ class LogsSamplingRuleSerializer(serializers.ModelSerializer):
if burst > 10_000_000:
raise ValidationError({"config": {"burst_kb": "Must be at most 10000000 KB."}})
- def _validate_filter_group(self, filter_group: Any) -> None:
+ def _validate_filter_group(self, filter_group: Any, *, reject_vacuous: bool = False) -> None:
if filter_group is None:
return
# Validate shape against PropertyGroupFilter so malformed payloads
@@ -260,6 +285,22 @@ class LogsSamplingRuleSerializer(serializers.ModelSerializer):
}
}
)
+ # Well-formed but empty groups pass Pydantic, yet the worker treats them as
+ # no-match — the rule would be silently inert (see _filter_group_has_empty_group).
+ # Ordering constraint: this walk recurses without its own depth short-circuit,
+ # so it must run only after the depth check above has bounded the tree.
+ if reject_vacuous and _filter_group_has_empty_group(filter_group):
+ raise ValidationError(
+ {
+ "config": {
+ "filter_group": (
+ "Every group in filter_group must contain at least one filter — an empty group "
+ "never matches, so the rule would never apply. For rate_limit rules, omit "
+ "filter_group entirely to cap all matching logs."
+ )
+ }
+ }
+ )
def validate_scope_attribute_filters(self, value: Any) -> Any:
if not isinstance(value, list):
diff --git a/products/logs/backend/test/test_sampling_rules_api.py b/products/logs/backend/test/test_sampling_rules_api.py
index f3352200c844..79ff3ab4b05e 100644
--- a/products/logs/backend/test/test_sampling_rules_api.py
+++ b/products/logs/backend/test/test_sampling_rules_api.py
@@ -199,6 +199,67 @@ class TestLogsSamplingRulesAPI(APIBaseTest):
)
assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()
+ # Well-formed but vacuous shapes: they pass Pydantic validation, but the worker's
+ # matchFilterGroup returns false for empty groups, so the rule silently never
+ # applies. Worst on rate_limit, where `{"type": "AND", "values": []}` reads like
+ # "cap everything" but caps nothing (omitting filter_group entirely is how to
+ # match all logs).
+ VACUOUS_FILTER_GROUPS = [
+ ("outer_empty", {"type": "AND", "values": []}),
+ ("inner_empty", {"type": "AND", "values": [{"type": "AND", "values": []}]}),
+ (
+ "empty_group_beside_leaf",
+ {
+ "type": "AND",
+ "values": [
+ {
+ "type": "AND",
+ "values": [
+ {
+ "key": "service.name",
+ "operator": "exact",
+ "value": "api",
+ "type": "log_resource_attribute",
+ },
+ {"type": "OR", "values": []},
+ ],
+ }
+ ],
+ },
+ ),
+ ]
+
+ @parameterized.expand(
+ [
+ (f"{rule_type}_{shape_label}", rule_type, base_config, shape)
+ for shape_label, shape in VACUOUS_FILTER_GROUPS
+ for rule_type, base_config in [("path_drop", {"patterns": []}), ("rate_limit", {"kb_per_second": 100})]
+ ]
+ )
+ def test_create_rejects_vacuous_filter_group(self, _label, rule_type, base_config, vacuous):
+ response = self.client.post(
+ self.base_url,
+ self._payload(rule_type=rule_type, config={**base_config, "filter_group": vacuous}),
+ format="json",
+ )
+ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()
+ assert "at least one filter" in str(response.json()), response.json()
+
+ def test_patch_unrelated_fields_succeeds_when_stored_filter_group_is_vacuous(self):
+ # Rows that predate the vacuous-group validator may carry an empty group;
+ # a PATCH that doesn't rewrite config (e.g. disabling the rule) must not 400.
+ rule = LogsExclusionRule.objects.create(
+ team_id=self.team.pk,
+ name="legacy empty group",
+ enabled=True,
+ priority=0,
+ rule_type=LogsExclusionRule.RuleType.RATE_LIMIT,
+ config={"kb_per_second": 100, "filter_group": {"type": "AND", "values": []}},
+ )
+ response = self.client.patch(f"{self.base_url}{rule.id}/", {"enabled": False}, format="json")
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ assert response.json()["enabled"] is False
+
def test_create_path_drop_rejects_filter_group_nested_too_deeply(self):
# 20 nested AND groups around a single leaf — well past the cap of 16.
# Worker recurses per record, so an unbounded depth is a stack-overflow + CPU footgun.
diff --git a/products/logs/frontend/generated/api.schemas.ts b/products/logs/frontend/generated/api.schemas.ts
index eb3a52906188..3ee0303e744d 100644
--- a/products/logs/frontend/generated/api.schemas.ts
+++ b/products/logs/frontend/generated/api.schemas.ts
@@ -1255,7 +1255,7 @@ export interface LogsSamplingRuleApi {
scope_path_pattern?: string | null
/** Optional list of predicates over string attributes, e.g. [{"key":"http.route","op":"eq","value":"/api"}]. */
scope_attribute_filters?: LogsSamplingRuleApiScopeAttributeFiltersItem[]
- /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
+ /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
config: unknown
/** Incremented on each update for worker cache coherency. */
readonly version: number
@@ -1312,7 +1312,7 @@ export interface PatchedLogsSamplingRuleApi {
scope_path_pattern?: string | null
/** Optional list of predicates over string attributes, e.g. [{"key":"http.route","op":"eq","value":"/api"}]. */
scope_attribute_filters?: PatchedLogsSamplingRuleApiScopeAttributeFiltersItem[]
- /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
+ /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
config?: unknown
/** Incremented on each update for worker cache coherency. */
readonly version?: number
diff --git a/products/logs/frontend/generated/api.zod.ts b/products/logs/frontend/generated/api.zod.ts
index f204227938f2..2a44c2feaa84 100644
--- a/products/logs/frontend/generated/api.zod.ts
+++ b/products/logs/frontend/generated/api.zod.ts
@@ -944,7 +944,7 @@ export const LogsSamplingRulesCreateBody = /* @__PURE__ */ zod.object({
config: zod
.unknown()
.describe(
- 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
+ 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
),
})
@@ -997,7 +997,7 @@ export const LogsSamplingRulesUpdateBody = /* @__PURE__ */ zod.object({
config: zod
.unknown()
.describe(
- 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
+ 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
),
})
@@ -1056,7 +1056,7 @@ export const LogsSamplingRulesPartialUpdateBody = /* @__PURE__ */ zod.object({
.unknown()
.optional()
.describe(
- 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
+ 'Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND\/OR tree of property predicates evaluated per record) and\/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{\"type\":\"AND\",\"values\":[{\"type\":\"AND\",\"values\":[{\"key\":\"service.name\",\"operator\":\"exact\",\"value\":\"api\"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB\/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes.'
),
})
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 54a0a762f077..ca9a17f05ef7 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -29061,7 +29061,7 @@ export namespace Schemas {
scope_path_pattern?: string | null;
/** Optional list of predicates over string attributes, e.g. [{"key":"http.route","op":"eq","value":"/api"}]. */
scope_attribute_filters?: LogsSamplingRuleScopeAttributeFiltersItem[];
- /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
+ /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
config: unknown;
/** Incremented on each update for worker cache coherency. */
readonly version: number;
@@ -38730,7 +38730,7 @@ export namespace Schemas {
scope_path_pattern?: string | null;
/** Optional list of predicates over string attributes, e.g. [{"key":"http.route","op":"eq","value":"/api"}]. */
scope_attribute_filters?: PatchedLogsSamplingRuleScopeAttributeFiltersItem[];
- /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
+ /** Type-specific JSON. For path_drop: object with optional `filter_group` (PropertyGroupFilter shape — AND/OR tree of property predicates evaluated per record) and/or legacy `patterns` (list of regex strings) + `match_attribute_key` (string). When both are present a record is dropped if EITHER matches. Filter group example: `{"type":"AND","values":[{"type":"AND","values":[{"key":"service.name","operator":"exact","value":"api"}]}]}`. Every group in `filter_group` must contain at least one filter — empty groups never match, so the rule would never apply. For severity_sampling: object with `actions` per severity level and optional `always_keep`. For rate_limit: object with EITHER `logs_per_second` (integer 1–1000000, optional `burst_logs` integer ≥ logs_per_second, max 10000000) OR `kb_per_second` (integer 1–1000000 = 1 GB/s, optional `burst_kb` integer ≥ kb_per_second, max 10000000) — not both. Plus optional `filter_group` to narrow which logs the cap applies to. KB-mode charges each log its own uncompressed byte size, matching how billing measures ingested bytes. */
config?: unknown;
/** Incremented on each update for worker cache coherency. */
readonly version?: number;