feat(semconv): adopt OpenTelemetry Weaver registry - #407
Conversation
yordis
commented
Jun 26, 2026
- Telemetry metric, span, and attribute names are currently hand-coded strings spread across crates and governed only by human review, so they drift and cannot be enforced.
- A Weaver semantic-convention registry makes naming a single, machine-checked contract that CI validates against the otel-name-* conventions.
- Placing it at the repository root keeps it runtime-neutral so every service (Rust today, Go and TypeScript later) can generate bindings from one source of truth, mirroring the existing proto/ workflow.
PR SummaryLow Risk Overview Tooling: Rust: New workspace crate Scope: Registry is an as-is inventory of what crates emit today; call-site adoption and stricter naming (e.g. Reviewed by Cursor Bugbot for commit 2c3c70a. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reached
More reviews will be available in 8 minutes and 34 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (21)
WalkthroughAdds semconv registry definitions, validation policy, Rust generation templates, a generated Rust crate, and automation for checking and generating semantic conventions in CI and local tasks. ChangesSemconv registry generation pipeline
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci-semconv.yml:
- Around line 9-12: The ci-semconv workflow only checks the registry and does
not verify that generated bindings match the committed output. Update the
workflow to also trigger when files under the generated crate output path
change, and add a regeneration step for the semconv generation flow so the job
fails if rsworkspace/crates/trogon-semconv/src/gen/ is stale or manually edited;
use the existing registry check and generated crate workflow as the places to
wire this in.
In `@semconv/policies/trogon_naming.rego`:
- Around line 16-84: The policy file currently covers only metric names and
attribute ids, so span-name validation is missing. Add deny rules in
trogon_naming.rego for groups where group.type == "span", using the Weaver span
naming field, and mirror the existing metric checks for lowercase, reserved
namespaces, delimiter/format constraints, and any required metadata. Reference
the existing metric_name_* rules and the attribute_id_* section to keep the span
policy consistent and easy to locate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f37fc1c3-99ec-4025-a70f-078749f0a63c
⛔ Files ignored due to path filters (4)
rsworkspace/Cargo.lockis excluded by!**/*.lockrsworkspace/crates/trogon-semconv/src/gen/attribute.rsis excluded by!**/gen/**rsworkspace/crates/trogon-semconv/src/gen/metric.rsis excluded by!**/gen/**rsworkspace/crates/trogon-semconv/src/gen/mod.rsis excluded by!**/gen/**
📒 Files selected for processing (13)
.github/workflows/ci-semconv.yml.mise.tomlrsworkspace/Cargo.tomlrsworkspace/crates/trogon-semconv/Cargo.tomlrsworkspace/crates/trogon-semconv/src/lib.rssemconv/README.mdsemconv/policies/trogon_naming.regosemconv/registry/manifest.yamlsemconv/registry/scheduler.yamlsemconv/templates/registry/rust/attribute.rs.j2semconv/templates/registry/rust/metric.rs.j2semconv/templates/registry/rust/mod.rs.j2semconv/templates/registry/rust/weaver.yaml
Code Coverage SummaryDetailsDiff against mainResults for commit: 2c3c70a Minimum allowed coverage is ♻️ This comment has been updated with latest results |
17e3b43 to
c43e5eb
Compare
fcaba7b to
33f907f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 33f907f. Configure here.
Establish a single, machine-checked source of truth for telemetry naming that every runtime can generate bindings from, instead of hand-coded strings governed only by review. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
33f907f to
2c3c70a
Compare
