Skip to content

ANcpLua/Qyl.OpenTelemetry.SemanticConventions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qyl.OpenTelemetry.SemanticConventions

NuGet Qyl.OpenTelemetry.SemanticConventions NuGet Qyl.OpenTelemetry.SemanticConventions.Incubating NuGet Qyl.OpenTelemetry.SemanticConventions.SourceGeneration NuGet Qyl.OpenTelemetry.SemanticConventions.Analyzers NuGet Qyl.OpenTelemetry.SemanticConventions.Nuke CI .NET License: Apache 2.0

Five .NET packages covering the OpenTelemetry semantic-conventions lifecycle end to end — from the upstream registry, through Weaver-generated attribute-key constants and Roslyn source generation, to compile-time analyzers that keep consumer telemetry conformant. The Weaver and TypeSpec build pipeline ships as a reusable Nuke component.

Compatible with: OpenTelemetry Semantic Conventions v1.41.0 Targets: net10.0, netstandard2.0

Channel Package Contents
stable Qyl.OpenTelemetry.SemanticConventions Stable attribute-key constants, pre-generated by Weaver against the registry pinned at SemConvSchemaVersion, plus the embedded resolved schema.
stable Qyl.OpenTelemetry.SemanticConventions.Incubating Incubating attribute-key constants in a separate package — opt in to instability deliberately; breaking between minor versions.
stable Qyl.OpenTelemetry.SemanticConventions.SourceGeneration Roslyn incremental source generator. Emits typed attribute constants, Activity tag setters, metric descriptors, Meter factories, and event payloads from the embedded resolved registry, driven by [SemanticConvention*] marker attributes at consumer build time.
stable Qyl.OpenTelemetry.SemanticConventions.Analyzers Roslyn diagnostic analyzers + code fixes — flag deprecated semconv usage, missing required attributes, and schema-URL omission.
stable Qyl.OpenTelemetry.SemanticConventions.Nuke Nuke build component (IUpstreamConventions, IDomainConventionsApi, LockstepPolicy) exposing the Weaver and TypeSpec pipelines.

Analyzer reference: index · per-rule pages · migration catalog · SARIF v2.1.0 manifest · editorconfig profiles

Configuring analyzer severity

Switch the whole QYL00xx band from one MSBuild property instead of dropping editorconfig files:

<PropertyGroup>
  <OtelSemConvAnalysisMode>AllAsErrors</OtelSemConvAnalysisMode>
</PropertyGroup>
Value Effect
Default Descriptor-defined severities.
AllAsErrors Whole band as errors (strict CI).
Disabled Silence the band.
unset No editorconfig injection; consumer-side editorconfig stays authoritative.

The knob ships via buildTransitive/Qyl.OpenTelemetry.SemanticConventions.Analyzers.props in the NuGet. The name is deliberately not the bare <AnalysisMode> — that one is owned by Microsoft.CodeAnalysis.NetAnalyzers.

Build and regeneration

eng/build/ is a Nuke host; ./build.sh runs Compile — every project in the solution, with TreatWarningsAsErrors. Other targets:

  • GenerateDocs — re-render docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md from the analyzer assembly.
  • CheckDocs — CI guard; fails when the committed markdown drifts from what the generator would emit.
  • AuditDocs — print analyzer-catalog statistics (no file I/O).
  • EnforceIds — verify each analyzer's class name, XML-doc summary, and DiagnosticId const agree with the runtime descriptor it registers.
  • EnforceIdsApply — rewrite analyzer sources to realign those after an intentional rule-id change.
  • VerifyAttributesHash — hash the committed Attributes/**/*.g.cs against eng/semconv/attributes.lock.sha256; drift fails the build.
  • SeedAttributesHash — refresh that lock after an intentional regeneration.

Attribute constants are regenerated out of band: a human runs Weaver against the OTel registry pinned at SemConvSchemaVersion, commits the new .g.cs, then runs SeedAttributesHash. The build itself never invokes Weaver — the committed .g.cs is the source of truth, guarded in CI by VerifyAttributesHash.

Upstream path

If the upstream OpenTelemetry .NET source-generator effort (open-telemetry/opentelemetry-dotnet-contrib#4424) lands, the SourceGeneration, Analyzers, and Nuke packages ship as one cohesive unit. Type identities are preserved, so the only consumer-side change is the PackageReference id.

Siblings: ANcpLua.Agents · ANcpLua.Roslyn.Utilities · ANcpLua.NET.Sdk · ANcpLua.Analyzers

About

OpenTelemetry semantic-conventions for .NET — stable + incubating runtime constants, generator, analyzers, Nuke build component.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages