Skip to content

Document Rego policy input/data and add live-check advice input schema - #1975

Open
lmolkova wants to merge 6 commits into
open-telemetry:mainfrom
lmolkova:docs/rego-data-model
Open

lmolkova wants to merge 6 commits into
open-telemetry:mainfrom
lmolkova:docs/rego-data-model

Conversation

@lmolkova

@lmolkova lmolkova commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #694

  • Document the Rego input and data of each policy stage, and replace the stale examples with a working v2 example and links to shared policies.
  • Add JSON schemas for live-check advice policy input (weaver registry json-schema -j live-check-advice-input-v2).

Follow-ups: #1972, #1973, #1974.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-12-06 05:49 UTC

Respond to 2 review items (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1, 2
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.1%. Comparing base (2e2334c) to head (050950e).

Files with missing lines Patch % Lines
...rates/weaver_live_check/src/advice/type_advisor.rs 14.2% 6 Missing ⚠️
crates/weaver_live_check/src/lib.rs 60.0% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1975   +/-   ##
=====================================
  Coverage   88.1%   88.1%           
=====================================
  Files        169     169           
  Lines      19574   19574           
=====================================
  Hits       17263   17263           
  Misses      2311    2311           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The README’s rule example uses id instead of resolved attributes’ name, preventing it from reporting removed attributes.

1 open issue
What changed in this PR

Documents Weaver’s Rego policy inputs and context, and adds live-check advice input schemas to support policy authors.

Changes:

  • Documents v1 and v2 policy stages and corrects stale examples.
  • Adds schema-generation commands and a committed v2 schema checked in CI.
  • Separates v2 matched signal types while preserving serialized policy input.
File Description
src/​registry/​json_schema.rs Adds advice input schema commands.
schemas/​live-check.advice-input.v2.json Defines the v2 advice input schema.
docs/​usage.md Documents new schema options.
crates/​weaver_live_check/​src/​sample_span.rs Updates matched span handling.
crates/​weaver_live_check/​src/​sample_metric.rs Updates matched metric handling.
crates/​weaver_live_check/​src/​sample_log.rs Updates matched event handling.
crates/​weaver_live_check/​src/​matcher.rs Adapts matching and tests to v2 types.
crates/​weaver_live_check/​src/​live_checker.rs Updates signal construction and lookup.
crates/​weaver_live_check/​src/​lib.rs Introduces schema-capable matched signal types.
crates/​weaver_live_check/​src/​advice/​type_advisor.rs Adapts advice checks to v2 types.
crates/​weaver_live_check/​src/​advice/​rego_advisor.rs Adds input schema generation and key tests.
crates/​weaver_live_check/​src/​advice/​mod.rs Exports advice input schema types.
crates/​weaver_live_check/​README.md Explains advice input and policy data.
crates/​weaver_checker/​README.md Documents policy stages and relocates comparison example.
CONTRIBUTING.md Adds schema regeneration instructions.
CHANGELOG.md Records schemas and documentation updates.
.github/​workflows/​ci.yml Checks committed schema consistency.

Review effort: Balanced

Comment thread crates/weaver_checker/README.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the policy-input documentation and schema changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@lmolkova
lmolkova marked this pull request as ready for review December 4, 2026 04:07
@lmolkova
lmolkova requested a review from a team as a code owner December 4, 2026 04:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The README misstates policy input formats before resolution and for pre-resolved v2 registries, which could lead readers to write policies against incorrect fields and silently miss findings.

2 open issues

Review effort: Balanced

verification of policies against semantic conventions and telemetry schemas.
| Package | Properties |
|---------|------------|
| `before_resolution` | `input`: unresolved [semconv files](/schemas/semconv-syntax.md) |
Comment on lines +155 to +156
receive the v2 materialized registry. Without it, policies get the v1 resolved
registry, even for `definition/2` files.
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.

Document exact datamodel for values sent to REGO policies

2 participants