-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(checker): Add support for after_resolution policies.
- Loading branch information
Showing
13 changed files
with
238 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
21 changes: 21 additions & 0 deletions
21
crates/weaver_codegen_test/semconv_registry/http-post-resolution-policies.rego
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package after_resolution | ||
|
||
# Example of rules that will be applied on resolved semconv files | ||
|
||
# Detect `http.request.method` attribute and consider it invalid. | ||
# This is just an example for testing purposes. | ||
deny[invalid_attr_violation("invalid_http_attr", group.id, attr.name)] { | ||
group := input.groups[_] | ||
attr := group.attributes[_] | ||
attr.name == "http.request.method" | ||
} | ||
|
||
invalid_attr_violation(violation_id, group_id, attr_id) = violation { | ||
violation := { | ||
"id": violation_id, | ||
"type": "semconv_attribute", | ||
"category": "attrigute", | ||
"group": group_id, | ||
"attr": attr_id, | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
crates/weaver_codegen_test/semconv_registry/metrics-post-resolution-policies.rego
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package after_resolution | ||
|
||
# Example of rules that will be applied on resolved semconv files | ||
|
||
# Detect `system.cpu.logical_number` attribute and consider it invalid. | ||
# This is just an example for testing purposes. | ||
deny[invalid_attr_violation("invalid_metric_attr", group.id, attr.name)] { | ||
group := input.groups[_] | ||
attr := group.attributes[_] | ||
attr.name == "system.cpu.logical_number" | ||
} | ||
|
||
invalid_attr_violation(violation_id, group_id, attr_id) = violation { | ||
violation := { | ||
"id": violation_id, | ||
"type": "semconv_attribute", | ||
"category": "attrigute", | ||
"group": group_id, | ||
"attr": attr_id, | ||
} | ||
} |
File renamed without changes.
79 changes: 0 additions & 79 deletions
79
crates/weaver_codegen_test/semconv_registry/post-resolution.rego
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.