Skip to content

chore(telemetry): govern semantic conventions centrally#449

Merged
yordis merged 1 commit into
masterfrom
yordis/chore-otel-weaver-contracts
Jul 20, 2026
Merged

chore(telemetry): govern semantic conventions centrally#449
yordis merged 1 commit into
masterfrom
yordis/chore-otel-weaver-contracts

Conversation

@yordis

@yordis yordis commented Jul 20, 2026

Copy link
Copy Markdown
Member
  • Shared telemetry vocabulary is needed to prevent components from drifting into incompatible names and meanings.
  • Portable contracts need to remain independent from runtime instrumentation choices so every component can consume them safely.
  • Generated artifacts need automated enforcement so schema changes cannot silently diverge from the reusable package.

@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Behavior should be unchanged because attribute string values are identical; risk is mainly new CI/tooling and a small telemetry wiring refactor.

Overview
Introduces a packable, dependency-free TrogonEventStore.SemanticConventions library whose AttributeNames constants are generated from the pinned OpenTelemetry registry (v1.43.0) via Weaver and custom templates under otel/semconv. Mise tasks semconv:generate / semconv:check regenerate and diff committed output so generated code cannot drift.

CI gains a dedicated semantic-conventions job (mise run semconv:check) and a dotnet pack step for the new package. EventStore.Core references the library; OpenTelemetryLogger OTLP resource attributes now use AttributeNames instead of inline "service.*" strings (same values).

Reviewed by Cursor Bugbot for commit 80dde3a. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yordis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 reviews.

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5a47a33-db61-453d-b411-7658df11eccb

📥 Commits

Reviewing files that changed from the base of the PR and between 369c221 and 80dde3a.

⛔ Files ignored due to path filters (1)
  • src/TrogonEventStore.SemanticConventions/Generated/AttributeNames.g.cs is excluded by !**/generated/**
📒 Files selected for processing (12)
  • .config/mise/tasks/semconv/check
  • .config/mise/tasks/semconv/generate
  • .github/workflows/common.yml
  • mise.toml
  • otel/semconv/registry-version
  • otel/semconv/templates/registry/csharp/attribute-names.cs.j2
  • otel/semconv/templates/registry/csharp/weaver.yaml
  • src/EventStore.Core/EventStore.Core.csproj
  • src/EventStore.Core/Log/OpenTelemetryLogger.cs
  • src/EventStore.sln
  • src/TrogonEventStore.SemanticConventions/README.md
  • src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj

Walkthrough

Adds a generated C# semantic-conventions package, configures Weaver-based generation for selected service attributes, integrates the constants into logging, and adds local and CI validation plus package packing.

Changes

Semantic conventions integration

Layer / File(s) Summary
Registry and code generation
.config/mise/tasks/semconv/*, mise.toml, otel/semconv/*
Pins Weaver, selects registry version v1.43.0, configures C# templates for service attributes, and adds generation and consistency-check tasks.
Packaged constants and logger usage
src/TrogonEventStore.SemanticConventions/*, src/EventStore.sln, src/EventStore.Core/EventStore.Core.csproj, src/EventStore.Core/Log/OpenTelemetryLogger.cs
Adds the netstandard2.0 package project, includes it in the solution and core project, documents generation commands, and uses generated constants for logger resource attributes.
CI generation and package checks
.github/workflows/common.yml
Runs semantic-convention consistency checks and packs the semantic-conventions project during C# quality checks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RegistryVersion as registry-version
  participant GenerateTask as semconv generate task
  participant Weaver
  participant SemanticConventions as SemanticConventions package
  participant OpenTelemetryLogger
  GenerateTask->>RegistryVersion: read v1.43.0
  GenerateTask->>Weaver: generate C# constants
  Weaver->>SemanticConventions: write AttributeNames.g.cs
  OpenTelemetryLogger->>SemanticConventions: read AttributeNames constants
Loading

Poem

A rabbit hops through templates bright,
Weaver spins constants into light.
Service names neatly line the way,
CI checks the pack today.
“Sniff,” says the bunny, “clean builds stay!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: centralizing governance of semantic conventions.
Description check ✅ Passed The description matches the changeset and the stated goal of centralizing and enforcing semantic conventions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/chore-otel-weaver-contracts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj (1)

14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider using PackageIcon instead of the deprecated PackageIconUrl.

PackageIconUrl is deprecated in modern NuGet packages in favor of PackageIcon, which embeds the image directly into the package.

Since you are removing ouro.png in the ItemGroup below, if you intend to use an icon, you should pack it and reference it via <PackageIcon>. If you don't intend to use an icon, you can simply remove this empty element.

🛠️ Proposed fix
-		<PackageIconUrl></PackageIconUrl>
🤖 Prompt for 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.

In
`@src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj`
at line 14, Remove the empty PackageIconUrl element from the project metadata;
since ouro.png is also being removed and no replacement icon is indicated, do
not add a PackageIcon entry.
🤖 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/common.yml:
- Around line 34-35: Update the Checkout step’s actions/checkout reference from
the nonexistent v7 to the valid v4 major version, and set persist-credentials to
false in that action configuration.

In `@otel/semconv/registry/manifest.yaml`:
- Line 3: Replace the master-based schema URL in
otel/semconv/registry/manifest.yaml at lines 3-3 with an immutable tag- or
commit-backed reference, and update the corresponding URL in
otel/semconv/schemas/0.1.0 at lines 2-2 to use the exact same reference.

In `@scripts/semconv-generate.sh`:
- Around line 12-22: Update the generation flow around the weaver registry
generate command to write artifacts into a temporary staging directory,
preserving existing *.g.cs files while generation runs. Only after successful
generation should the script remove the old generated files and move the staged
outputs into the configured output directory; clean up the temporary directory
on failure or completion.

---

Nitpick comments:
In
`@src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj`:
- Line 14: Remove the empty PackageIconUrl element from the project metadata;
since ouro.png is also being removed and no replacement icon is indicated, do
not add a PackageIcon entry.
🪄 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: 962335a7-e218-43a3-b224-92b0741f4931

📥 Commits

Reviewing files that changed from the base of the PR and between 95fe10a and 78d1b69.

⛔ Files ignored due to path filters (1)
  • src/TrogonEventStore.SemanticConventions/Generated/AttributeNames.g.cs is excluded by !**/generated/**
📒 Files selected for processing (14)
  • .github/workflows/common.yml
  • mise.toml
  • otel/semconv/registry/manifest.yaml
  • otel/semconv/registry/resources.yaml
  • otel/semconv/schemas/0.1.0
  • otel/semconv/templates/registry/csharp/attribute-names.cs.j2
  • otel/semconv/templates/registry/csharp/weaver.yaml
  • scripts/semconv-check.sh
  • scripts/semconv-generate.sh
  • src/EventStore.Core/EventStore.Core.csproj
  • src/EventStore.Core/Log/OpenTelemetryLogger.cs
  • src/EventStore.sln
  • src/TrogonEventStore.SemanticConventions/README.md
  • src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj

Comment thread .github/workflows/common.yml
Comment thread otel/semconv/registry/manifest.yaml Outdated
Comment thread scripts/semconv-generate.sh Outdated
@yordis
yordis force-pushed the yordis/chore-otel-weaver-contracts branch 2 times, most recently from 5803b57 to 061d618 Compare July 20, 2026 14:40

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 061d618. Configure here.

Comment thread .config/mise/tasks/semconv/generate
@yordis
yordis force-pushed the yordis/chore-otel-weaver-contracts branch 2 times, most recently from de11379 to 369c221 Compare July 20, 2026 14:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/common.yml:
- Line 39: Update the jdx/mise-action@v4.2.1 step in the workflow to disable
caching for release-capable push events by setting its cache option to false.
Preserve the existing action version and workflow behavior.
🪄 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: 749b95f8-653b-44a8-9ace-8a34e90183d5

📥 Commits

Reviewing files that changed from the base of the PR and between 78d1b69 and 369c221.

⛔ Files ignored due to path filters (1)
  • src/TrogonEventStore.SemanticConventions/Generated/AttributeNames.g.cs is excluded by !**/generated/**
📒 Files selected for processing (12)
  • .config/mise/tasks/semconv/check
  • .config/mise/tasks/semconv/generate
  • .github/workflows/common.yml
  • mise.toml
  • otel/semconv/registry-version
  • otel/semconv/templates/registry/csharp/attribute-names.cs.j2
  • otel/semconv/templates/registry/csharp/weaver.yaml
  • src/EventStore.Core/EventStore.Core.csproj
  • src/EventStore.Core/Log/OpenTelemetryLogger.cs
  • src/EventStore.sln
  • src/TrogonEventStore.SemanticConventions/README.md
  • src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/TrogonEventStore.SemanticConventions/README.md
  • otel/semconv/templates/registry/csharp/weaver.yaml
  • src/EventStore.Core/EventStore.Core.csproj
  • src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj
  • src/EventStore.Core/Log/OpenTelemetryLogger.cs
  • src/EventStore.sln

Comment thread .github/workflows/common.yml
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/chore-otel-weaver-contracts branch from 369c221 to 80dde3a Compare July 20, 2026 15:17
@yordis
yordis merged commit de4851c into master Jul 20, 2026
23 checks passed
@yordis
yordis deleted the yordis/chore-otel-weaver-contracts branch July 20, 2026 15:42
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.

1 participant