Skip to content

ANcpLua/Qyl.OpenTelemetry.SemanticConventions

Repository files navigation

Qyl.OpenTelemetry.SemanticConventions

A consolidated build of four .NET packages that together cover the OpenTelemetry semantic-conventions lifecycle — from upstream registry pull, through Roslyn-time constant generation, into compile-time analyzers that police consumer code.

Package Role
Qyl.OpenTelemetry.SemanticConventions Stable attribute keys, pre-generated by Weaver against the OTel registry pinned via SemConvSchemaVersion in Version.props.
Qyl.OpenTelemetry.SemanticConventions.Incubating Incubating attribute keys, separate package so consumers opt in to instability.
Qyl.OpenTelemetry.SemanticConventions.SourceGeneration Roslyn incremental source generator. Emits typed Activity, Event, Meter, metric, and attribute projections from an embedded resolved-registry, driven by [SemanticConvention*] marker attributes at consumer build time.
Qyl.OpenTelemetry.SemanticConventions.Analyzers Roslyn diagnostic analyzers + code fixes. Flag deprecated semconv usage, missing required attributes, schema-url omission, etc. Rule reference: docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md, regenerated by ./build.sh GenerateDocs.

The shared Nuke build component (IUpstreamConventions, IDomainConventionsApi, LockstepPolicy) is consumed from ANcpLua.OpenTelemetry.Conventions.Nuke, shipped from O-ANcppLua/ANcpLua.OpenTelemetry.Conventions.Nuke. This repo participates as a .NET-side consumer.

Build loop

eng/build/ is a Nuke host. ./build.sh compiles every project in the solution (the Compile target). Other targets:

  • ./build.sh GenerateDocs — re-render docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md.
  • ./build.sh CheckDocs — CI guard; fails if the committed markdown is stale.
  • ./build.sh AuditDocs — print analyzer-catalog statistics (no file I/O).
  • ./build.sh VerifyAttributesHash — hash the committed Attributes/**/*.g.cs against eng/semconv/attributes.lock.sha256; drift fails the build.
  • ./build.sh SeedAttributesHash — refresh the lock after an intentional regeneration.

Regeneration of Attributes/**/*.g.cs happens out-of-band: a human runs Weaver against the OTel registry pinned at SemConvSchemaVersion, commits the new .g.cs, then runs SeedAttributesHash.

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages