feat(logs-sampling-rule): manage logs sampling rules as code - #97
Open
pl wants to merge 3 commits into
Open
Conversation
Add logs_sampling_rules list/create/retrieve/partial_update/destroy to the openapi-filter allowlist and regenerate src/generated/api.d.ts. The reorder endpoint is intentionally omitted — ordering is controlled via the settable, PATCH-updatable `priority` field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Manage logs sampling rules (projects/{id}/logs/sampling_rules) as code — the
campaign's first order-sensitive collection. Identity rides a trailing
HTML-comment marker in `name` (subscriptions pattern; maxLength 255, guarded).
Ordering: `priority` (lower first, first-match-wins) is a settable AND
PATCH-updatable field that round-trips, so order is handled as a normal hashed
field — a priority change is a real, pushable diff. No reorder-endpoint
machinery or generic pipeline extension needed; the order-awareness is the hash
projection including `priority`. `config` is a type-specific passthrough bag;
`enabled`/`rule_type`/scope fields round-trip; `description`/`tags` are dropped
by the create serializer (live-verified). Real PATCH update + real DELETE (204).
Includes pull codegen, unit tests (incl. the priority-change diff), two
examples with explicit priorities, README scope (logs:read/write), resources.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Seed one disabled logs sampling rule per smoke run, add logs-sampling-rules to SMOKE_KINDS, and wire --logs-sampling-rule=<key> into smoke-cleanup.ts. Verified in isolation: seed -> apply -> pull --all-rows -> tag-back -> dry-run no-op -> cleanup. (Full `pnpm smoke` is blocked upstream of this resource by a pre-existing gap: `actions` is in SMOKE_KINDS but has no pull codegen on pl/spec-migration, so pull fails at args validation.) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pl
added a commit
that referenced
this pull request
Jul 24, 2026
Logs sampling rules (#97), warehouse saved queries (#99), and batch exports (#100) complete the buildable surface. Logs alerts/metric rules, warehouse tables/view links deferred; group types excluded; notebooks parked. Adds a status section with the post-merge follow-up list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Adds logs sampling rules (
projects/{id}/logs/sampling_rules) as a managed resource — the campaign's first order-sensitive collection.Design
name(subscriptions pattern; maxLength 255, guarded). Notags/description—nameis the only free-text field;description/tagsare silently dropped by the create serializer (live-verified).priority(lower first, first-match-wins) is a settable AND PATCH-updatable field that round-trips, so ordering is handled as a normal hashed field — a priority change is a real, pushable diff. No reorder-endpoint machinery and no generic pipeline extension were needed; the order-awareness is the hash projection includingpriority. Live-verified: priority 10→42 → single update → clean no-op.config(type-specific passthrough bag),enabled,rule_type, and scope fields round-trip. RealPATCH(200) and realDELETE(204).Verification (dev project 806)
create → no-op re-apply → edit config → single update → no-op → priority-only change → single update → no-op (order-aware) → orphan left untouched → hand-built rule (no marker) invisible to plan/orphans (safety invariant) → scoped prune via direct
pruneLogsSamplingRule. All rows cleaned up. Gates:typecheck/typecheck:examples/lint/test(303) all pass. Smoke seed verified in isolation (seed→apply→pull--all-rows→tag-back→dry-run no-op→cleanup).Stacking
Stacks on #81 (
pl/spec-migration, codegen-only base). Retarget tomasterwhen #81 merges. First commit is the codegen regen (skippable in review);docs/resources.mdLogs rows are provisional ahead of the full matrix refresh (#78).🤖 Generated with Claude Code