Qyl.OpenTelemetry.SemanticConventions.SourceGeneration 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Qyl.OpenTelemetry.SemanticConventions.SourceGeneration --version 2.0.0
                    
NuGet\Install-Package Qyl.OpenTelemetry.SemanticConventions.SourceGeneration -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.SourceGeneration" Version="2.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Qyl.OpenTelemetry.SemanticConventions.SourceGeneration" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.SourceGeneration">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Qyl.OpenTelemetry.SemanticConventions.SourceGeneration --version 2.0.0
                    
#r "nuget: Qyl.OpenTelemetry.SemanticConventions.SourceGeneration, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Qyl.OpenTelemetry.SemanticConventions.SourceGeneration@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Qyl.OpenTelemetry.SemanticConventions.SourceGeneration&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Qyl.OpenTelemetry.SemanticConventions.SourceGeneration&version=2.0.0
                    
Install as a Cake Tool

Qyl.OpenTelemetry.SemanticConventions.SourceGeneration

Roslyn source generator for OpenTelemetry semantic-convention constants, descriptors, and thin helper APIs. It does not collect telemetry. Consumers own their Meter, ActivitySource, Logger, instrumentation scope, versioning, and enablement.

Use

using Qyl.OpenTelemetry.SemanticConventions.SourceGeneration;

[SemanticConventionAttributes("http")]
internal static partial class HttpAttributes;

[SemanticConventionIncubatingAttributes("http")]
internal static partial class HttpIncubatingAttributes;

[SemanticConventionMetrics("http.server")]
internal static partial class HttpServerMetrics;

[SemanticConventionIncubatingEvents("session")]
internal static partial class SessionEvents;

[SemanticConventionMeters("http.server")]
internal static partial class HttpServerMeters;

[SemanticConventionActivities("http")]
internal static partial class HttpActivityExtensions;

// Generated:
//   public const string AttributeHttpRequestMethod = "http.request.method";
//   public static partial class HttpServerRequestDurationDescriptor { ... }
//   public readonly record struct SessionStartPayload { ... }
//   public static Histogram<double> CreateHttpServerRequestDurationHistogram(this Meter meter)
//   public static Activity SetHttpRoute(this Activity activity, string value)

The marker attribute is itself generated (via RegisterPostInitializationOutput); no runtime dependency is added by consuming this package.

Stable markers emit stable rows plus deprecated migration symbols. Incubating markers are supersets: stable + development/alpha/beta/release-candidate + deprecated. This mirrors Java/Python's incubating package behavior and avoids breaking consumers when conventions are promoted.

Choose one projection per prefix in normal consumer code. Incubating is a superset, so declaring both stable and incubating meter/activity helpers for the same prefix in the same namespace can make shared extension methods ambiguous. If a test fixture intentionally declares both, call the generated static helper class explicitly.

Event rows in semconv v1.41.0 do not carry an ActivityEvent-vs-Logger/Event discriminator. The generator emits event names and payload structs; the caller chooses the emission API at use-site. If upstream adds a discriminator later, the event emitter has a single routing point for that field.

Versioning

Tracks open-telemetry/semantic-conventions v1.41.0 (commit e018fe6f91862f5ed63c082f87697cddac596784), embedded via Weaver v0.23.0. The embedded registry is regenerated by scripts/generate.sh. The projection preserves the resolved group surface across attribute groups, spans, entities, metrics, and events, then exposes metric/event convenience arrays for the signal-specific emitters.

The generated member shape is snapshot-tested per stability tier. Full-surface consumer smoke builds cover net472, netstandard2.0, net6.0, net8.0, net9.0, and net10.0.

Licensed under MIT (qyl); generated content is derived from OpenTelemetry semantic conventions, Apache-2.0.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.0 0 7/11/2026
3.3.0 45 7/8/2026
3.2.0 45 7/7/2026
3.1.0 126 6/26/2026
3.0.2 106 6/24/2026
3.0.1 111 6/4/2026
3.0.0 110 5/25/2026
2.0.1 113 5/25/2026
2.0.0 132 5/23/2026