Skip to content

Sync swagger: flatten consumption trace filter to repeated span filters - #113

Draft
prateek wants to merge 6 commits into
mainfrom
prateek/sync-consumption-trace-filter
Draft

Sync swagger: flatten consumption trace filter to repeated span filters#113
prateek wants to merge 6 commits into
mainfrom
prateek/sync-consumption-trace-filter

Conversation

@prateek

@prateek prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Syncs the configv1 swagger spec and regenerates clients/models/CLI (make update-swagger, wholesale regen committed as CI requires).

What this brings

  • Flattened consumption trace filter: the partition filter condition on v1/config/ConsumptionConfig now carries a repeated trace_span_filters field directly — a list of the new top-level ConsumptionSpanFilter message (8 fields each: service, operation, parent_service, parent_operation, duration, error, tags, is_root_span). The old singular trace_filter field and its ConsumptionTraceFilter wrapper are gone. Matching happens at the span level: a span matches the condition only if it satisfies every span filter in the list (conjunctive); express alternatives with an IN string filter or with separate conditions. The field is preview, gated by the enable-consumption-trace-api feature flag.
  • Rider — trace-metrics group-by keys: PARENT_SERVICE, PARENT_OPERATION, ROOT_SERVICE, ROOT_OPERATION group-by key types on v1/config/TraceMetricsRules.
  • Rider — BREAKING sku_group removal: the deprecated sku_group field is removed from v1/config/ConsumptionBudget thresholds in favor of resource_group (which shipped in v1.28.0). Flagged as breaking in the CHANGELOG for the release team's versioning call.

Scope

The configv1 restructure only: delete Configv1ConsumptionTraceFilter and its nested span-filter model, add top-level Configv1ConsumptionSpanFilter, and rename PartitionFilterCondition.TraceFilter to TraceSpanFilters []*Configv1ConsumptionSpanFilter, plus the CHANGELOG reword. The wholesale make update-swagger also regenerated unrelated configunstable master drift (a new command-center-groups entity, SyntheticTest additions); that was reverted to keep this PR scoped to the trace filter — configunstable, statev1, and stateunstable are unchanged. Phase 2's pre-merge wholesale re-sync from master will pick that drift up in its own right.

Source

Specs synced from monorepo PR #87961 (the consumption trace restructure) at ca42bd7b. The worktree swagger source matches that branch tip — PR 3 commits touch no swagger, re-verified before this resync.

🤖 Generated with Claude Code

prateek and others added 2 commits June 11, 2026 23:35
Sync the configv1 spec from monorepo PR #87961 (head 53fc82773fa,
pre-merge; will be re-synced from master before this merges) and
regenerate clients/models/CLI.

The trace_filter field on ConsumptionConfig partition filter
conditions now takes the span-level ConsumptionTraceFilter shape
(span_filters; any-of semantics across filters, all criteria on a
single span) instead of the trace search filter shape. The field is
preview, gated by the enable-consumption-trace-api flag.

Riders picked up from configv1 spec drift (monorepo master vs the
v1.28.0 sync):
- PARENT_SERVICE/PARENT_OPERATION/ROOT_SERVICE/ROOT_OPERATION
  group-by key types on trace metrics rules.
- Removal of the deprecated sku_group threshold field (breaking;
  resource_group replaced it in v1.28.0).

The other three specs (configunstable, statev1, stateunstable) had
no drift.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Note in the changelog that the previous trace_filter shape was never
operative (the field is gated by enable-consumption-trace-api, which no
tenant has enabled), and that manifests using the new shape require this
release or newer since older chronoctl versions reject them at decode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@prateek

prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Review loop — iteration 1 (9 lenses; this PR's findings and fixes).

Fixed (7f02c05, CHANGELOG only):

  • The trace_filter "Changed" entry now carries the never-operative parenthetical (the old shape was always gated by enable-consumption-trace-api, enabled for no tenant, so no existing manifest is affected) — preempts both the release-versioning question and the customer shape-diff question.
  • Added the client-skew sentence: manifests containing the new trace_filter shape require this release or newer; older chronoctl versions reject them at decode and omit the filter when reading entities. (Distsys lens verified both skew directions fail loud — no silent-loss path.)

CI green (single "build" check is the repo's complete expected set).

🤖 Generated with Claude Code

Two precision fixes to the trace_filter migration note: older clients
do not drop the filter on read, their lenient unmarshal keeps the key
and renders an empty trace_filter object (the span_filters payload is
what gets lost); and the never-operative claim is scoped to customer
tenants during the old shape's lifetime, since the flag will be enabled
on rc-uat test tenants at gate G1.5 before this ships in a release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@prateek

prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Review loop — iteration 2. Fixed (8dc8ec0): two precision rewordings from the product lens — old clients "render the filter as an empty trace_filter object when reading entities" (not "omit": lenient unmarshal keeps the old-shaped key), and the never-operative claim is now scoped to customer tenants over the old shape's lifetime (the flag will be enabled on rc-uat test tenants at gate G1.5, so the present-tense global claim had an expiry date).

Iteration 3 incoming: PR #87961's final head changed the span_filters description from any-of to all-of semantics — a spec re-sync will pick up the new wording.

🤖 Generated with Claude Code

Re-sync the configv1 spec from monorepo PR #87961's squashed head
(86b49c4d68a), which flipped ConsumptionTraceFilter.span_filters
combination semantics from OR to AND: a span must now satisfy every
span filter in the list to match a condition, with alternatives
expressed via an IN string filter or separate conditions.

The diff is description-only (spec.json, regenerated model comment,
and scaffold YAML comment). The CHANGELOG entry for the trace_filter
shape change is updated to state the all-of contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@prateek

prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Review loop — iteration 3 (OR→AND contract-flip wave). Fixed (efd2d18): spec re-synced from PR #87961's squashed head — diff was description-only (the new all-of span_filters wording reaching spec.json, the regenerated model comment, and the scaffold YAML comment), with zero master-side riders. CHANGELOG entry reworded to the AND contract ("satisfies every span filter in the list; match alternatives with an IN string filter or with separate conditions").

🤖 Generated with Claude Code

@prateek

prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Review loop — iteration 4. One finding here, fixed body-only: the PR description still carried the pre-flip OR wording ("satisfies all criteria of one span filter") — now matches the CHANGELOG's conjunctive sentence, and the swagger-source line reflects that PR #87961's current head 91a4918 is byte-identical to the synced spec. No code changes; head stays efd2d18.

🤖 Generated with Claude Code

@prateek

prateek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Review loop — converged at iteration 6. All nine lenses clean (the single cosmetic finding — a duplicated sentence in the chronoctl PR body from an earlier edit — was fixed and verified in-round). Final state: monorepo #87970 @ 94c02c3b1ab with all 50 checks green and MERGEABLE on base #87961 @ fe94ba98da7; chronoctl #113 @ efd2d18, provider #220 @ ace2c08, scenarios #1184 @ 4fc0efd all green (scenarios live shard expected-red per its documented signatures). Loop totals across 6 iterations: 2 transient blockers, ~20 risks, ~25 nits found and fixed; 5 PR-1 base moves absorbed (2 with contract changes: OR→AND semantics, internal twin retype). Drafts now await PR #87961 (gate G1): wholesale external re-sync from master, then merges per the documented ordering.

🤖 Generated with Claude Code

prateek and others added 2 commits June 12, 2026 15:09
Re-sync from monorepo PR #87961 at dfaa7b975, which expanded the
ConsumptionSpanFilter tags description with a note that numeric
matchers also compare numeric-looking string tag values and that
alternatives need separate conditions. Description-only; no shape
change, so only the spec, the regenerated model comment, and the
scaffold YAML comment move.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-sync the configv1 public API swagger after the PR 1 restructure that
flattened the consumption trace contract. The ConsumptionTraceFilter
wrapper is deleted; the partition filter condition now carries a repeated
trace_span_filters field of the new top-level ConsumptionSpanFilter
message directly.

Generated changes:
- delete Configv1ConsumptionTraceFilter and its nested
  ConsumptionTraceFilterConsumptionSpanFilter model
- add top-level Configv1ConsumptionSpanFilter (the 8 span fields:
  service, operation, parent_service, parent_operation, duration,
  error, tags, is_root_span)
- PartitionFilterCondition.TraceFilter becomes
  TraceSpanFilters []*Configv1ConsumptionSpanFilter

Semantics are unchanged: a span matches the condition only if it
satisfies every span filter (conjunctive); express alternatives with an
IN matcher or separate conditions. The field stays in preview behind the
enable-consumption-trace-api flag.

Sync basis: monorepo ca42bd7b (PR 1 #87961).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@prateek prateek changed the title Sync swagger: span-level consumption trace filter Sync swagger: flatten consumption trace filter to repeated span filters Jun 15, 2026
@prateek
prateek force-pushed the prateek/sync-consumption-trace-filter branch from 951182f to 04823fc Compare June 15, 2026 21:51
@prateek prateek closed this Jun 15, 2026
@prateek prateek reopened this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant