Add rule_id field to Policy to identify matched rule#72
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 4153300 | Docs | Datadog PR Page | Give us feedback! |
| /// 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Adds a
rule_idfield to thePolicytable 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.