Qyl.Telemetry.SemanticConventions.SourceGeneration
4.3.0
See the version list below for details.
dotnet add package Qyl.Telemetry.SemanticConventions.SourceGeneration --version 4.3.0
NuGet\Install-Package Qyl.Telemetry.SemanticConventions.SourceGeneration -Version 4.3.0
<PackageReference Include="Qyl.Telemetry.SemanticConventions.SourceGeneration" Version="4.3.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Qyl.Telemetry.SemanticConventions.SourceGeneration" Version="4.3.0" />
<PackageReference Include="Qyl.Telemetry.SemanticConventions.SourceGeneration"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Qyl.Telemetry.SemanticConventions.SourceGeneration --version 4.3.0
#r "nuget: Qyl.Telemetry.SemanticConventions.SourceGeneration, 4.3.0"
#:package Qyl.Telemetry.SemanticConventions.SourceGeneration@4.3.0
#addin nuget:?package=Qyl.Telemetry.SemanticConventions.SourceGeneration&version=4.3.0
#tool nuget:?package=Qyl.Telemetry.SemanticConventions.SourceGeneration&version=4.3.0
Qyl.Telemetry.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.
When to use this package
This is the application-side consumption mode: the generator emits only the
declared groups into your own assembly — internal visibility, no runtime package
dependency, tree-shaken by construction. Libraries that need one pinned registry
version across a package family (for example
Qyl.OpenTelemetry.AutoInstrumentation) reference the compiled
Qyl.Telemetry.SemanticConventions packages instead and alias their
constants; see the repository README's "Choosing between the compiled packages
and the source generator" section.
Use
using Qyl.Telemetry.SemanticConventions.SourceGeneration;
[SemanticConventionAttributes("http")]
internal static partial class HttpAttributes;
[SemanticConventionIncubatingAttributes("http")]
internal static partial class HttpIncubatingAttributes;
[SemanticConventionMetrics("http.server")]
internal static partial class HttpServerMetrics;
[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 static Histogram<double> CreateHttpServerRequestDurationHistogram(this Meter meter)
// public static Activity SetHttpRoute(this Activity activity, string value)
Generator surfaces
All four source generators use the same Roslyn shape: publish stable and
incubating marker attributes during post-initialization, discover annotated
partial classes with ForAttributeWithMetadataName, extract the requested
semantic-convention prefix into a marker model, then emit source from the
matching registry projection.
| Surface | Marker attributes | Registry projection | Emitter | Generated shape |
|---|---|---|---|---|
| Attributes | SemanticConventionAttributes, SemanticConventionIncubatingAttributes |
RegistryLoader.Registry |
AttributesEmitter |
Attribute-key constants and typed enum-value helpers. |
| Activities | SemanticConventionActivities, SemanticConventionIncubatingActivities |
ActivityRegistryLoader.Registry |
ActivityExtensionsEmitter |
Activity extension methods that set typed semantic tags. |
| Metrics | SemanticConventionMetrics, SemanticConventionIncubatingMetrics |
RegistryLoader.Instruments |
MetricsEmitter |
Metric names, descriptors, units, instrument kinds, and attribute keys. |
| Meters | SemanticConventionMeters, SemanticConventionIncubatingMeters |
RegistryLoader.Instruments |
MetersEmitter |
Meter extension methods that create semantic instruments. |
The marker attributes are themselves 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.
Versioning
Tracks two source registries:
| Source | Canonical pin | Generated exact provenance |
|---|---|---|
| Core semantic conventions | Version.props |
The core entry in resolved-registry.json |
| GenAI semantic conventions | Version.props |
The genai entry in resolved-registry.json |
The generated provenance entries carry the exact resolved ref, commit, and schema URL; they are regenerated from the canonical pins instead of copied into this document.
The GenAI registry is development-stage. It is pinned by commit SHA and must not be presented as a stable v1.42.0 release.
The embedded registry is regenerated by scripts/generate.sh with the Weaver
version pinned in Version.props; generation fails on a different binary. The script
runs Weaver twice, once for core and once for GenAI, then merges the qyl-owned
projections while preserving per-row source metadata. The
core run excludes gen-ai, mcp, openai, and aws-bedrock, so those rows come
only from the GenAI source.
The merge also fingerprints every effective model file, preserves both manifests, and embeds every referenced GenAI JSON Schema. Two generated consumers share that same projection:
emit_registry_resources.pypublishes the complete resolved registry and raw structured-payload schemas through the incubating package.emit_analyzer_registry.pyderives attribute types, enum spellings, GenAI/MCP span requirements, provider refinements, and metric names for the analyzer project.
Both scripts support --check; normal repository builds and CI fail when their
committed outputs drift from resolved-registry.json.
The generated member shape is snapshot-tested per stability tier on the repository's
net10.0 test host. The release gate also restores the packed source generator into
a clean net10.0 consumer, compiles generated members, and executes the result.
Licensed under Apache-2.0. Generated content is derived from the Apache-2.0 OpenTelemetry semantic-conventions registries.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.Analyzers (>= 5.6.0)
- Microsoft.CodeAnalysis.CSharp (>= 5.6.0)
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 |
|---|---|---|
| 8.1.0 | 97 | 9/4/2026 |
| 8.0.1 | 100 | 9/4/2026 |
| 8.0.0 | 137 | 9/3/2026 |
| 7.1.1 | 134 | 9/2/2026 |
| 7.1.0 | 99 | 9/2/2026 |
| 7.0.0 | 142 | 9/2/2026 |
| 6.0.0 | 160 | 8/28/2026 |
| 5.2.0 | 136 | 8/22/2026 |
| 5.1.0 | 108 | 8/22/2026 |
| 5.0.0 | 101 | 8/21/2026 |
| 4.5.0 | 102 | 8/21/2026 |
| 4.4.0 | 428 | 8/21/2026 |
| 4.3.0 | 161 | 8/20/2026 |
| 4.2.0 | 169 | 8/14/2026 |
| 4.1.0 | 116 | 8/1/2026 |
| 1.0.0 | 431 | 7/27/2026 |