Skip to content

Add rule_id field to Policy to identify matched rule#72

Open
annacai21 wants to merge 1 commit into
mainfrom
anna.cai/add-rule-id-policy-schema
Open

Add rule_id field to Policy to identify matched rule#72
annacai21 wants to merge 1 commit into
mainfrom
anna.cai/add-rule-id-policy-schema

Conversation

@annacai21

Copy link
Copy Markdown
Contributor

Adds a rule_id field to the Policy table in the FlatBuffers schema so an evaluation outcome can be traced back to the rule that produced it. For Remote Config rules this carries the rule's UUID; for hardcoded/built-in policies it is the label "hardcoded".

This is the schema groundwork for surfacing the deciding rule in injection telemetry and linking a skipped or instrumented process back to its rule on the Instrumentation Rules page.

@datadog-official

datadog-official Bot commented Jun 29, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 21.66%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4153300 | Docs | Datadog PR Page | Give us feedback!

Comment thread fbs-schema/policy.fbs
/// or instrumented process back to the rule on the Instrumentation Rules page).
/// For Remote Config rules this is the rule's UUID; for hardcoded/built-in
/// policies it is the sentinel "hardcoded".
rule_id: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I thought the rule_id would be added to a node, not to Policy 🤔

Also the comment looks wrong. It says UUID or "hardcoded" sentinel, but I believe the RFC says it could be an UUID, or a description, or the "hardcoded" sentinel

@annacai21 annacai21 Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the RFC to say that we're putting rule_id on Policy. For RC policies, one rule compiles to one Policy, so it makes more sense to add this field here instead of to a node that's just one condition of a rule. It's also simpler on the engine side: the action fires for the matched Policy, so the engine can read Policy.rule_id directly, without having to pick out which node within the rule carries the id.

I also updated the doc so rule_id only ever contains the UUID the backend already uses (here) or the string "hardcoded". It does not contain the description.

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.

2 participants