Represent missing instrumentation scope values as null in Rego input
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- devtools, testing-qa
Research direction
Start with the test named test_custom_rego_can_inspect_span_instrumentation_scope and trace how Weaver builds the Rego input for instrumentation_scope. Update the missing version and schema_url representation so the test's null checks pass, then run that test and confirm it reports the expected finding.
Written by the indexing model from the issue text.
Description
PR open-telemetry/semantic-conventions-conformance#180 validates instrumentation scope fields with custom Rego policies.
When version or schema_url is not provided, Weaver exposes it to Rego as an empty string:
input.instrumentation_scope.version == ""
input.instrumentation_scope.schema_url == ""
Missing values should instead be represented as null:
input.instrumentation_scope.version == null
input.instrumentation_scope.schema_url == null
The following test added to test_custom_rego_can_inspect_span_instrumentation_scope demonstrates the expected behavior:
deny contains make_advice(advice_type, advice_level, advice_context, message) if {
input.instrumentation_scope.name == "framework"
input.instrumentation_scope.version == null
input.instrumentation_scope.schema_url == null
advice_type := "instrumentation_scope_missing_values"
advice_level := "information"
advice_context := {"scope_name": "framework"}
message := "Missing instrumentation scope values are explicitly null"
}
The test constructs a scope with missing optional values and expects this finding. On current main, it fails with:
expected missing scope values to be explicitly null for Rego: []
- Dominant language
- Rust
- Stars
- 489
- Forks
- 108
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 40
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/weaver
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
open-telemetry/weaver#1624 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-telemetry/weaver#1611 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/weaver#1590 ·
-
model
Difficulty 3/5 1-2 days Newbie friendliness 74/100
open-telemetry/weaver#1752 ·
-
live-check
Difficulty 3/5 1-2 days Newbie friendliness 68/100
open-telemetry/weaver#1751 ·
All issues in open-telemetry/weaver
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100