Arinti.Langfuse.Tracing.SemanticConventions 1.0.0-alpha.1

This is a prerelease version of Arinti.Langfuse.Tracing.SemanticConventions.
dotnet add package Arinti.Langfuse.Tracing.SemanticConventions --version 1.0.0-alpha.1
                    
NuGet\Install-Package Arinti.Langfuse.Tracing.SemanticConventions -Version 1.0.0-alpha.1
                    
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="Arinti.Langfuse.Tracing.SemanticConventions" Version="1.0.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arinti.Langfuse.Tracing.SemanticConventions" Version="1.0.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="Arinti.Langfuse.Tracing.SemanticConventions" />
                    
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 Arinti.Langfuse.Tracing.SemanticConventions --version 1.0.0-alpha.1
                    
#r "nuget: Arinti.Langfuse.Tracing.SemanticConventions, 1.0.0-alpha.1"
                    
#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 Arinti.Langfuse.Tracing.SemanticConventions@1.0.0-alpha.1
                    
#: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=Arinti.Langfuse.Tracing.SemanticConventions&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Arinti.Langfuse.Tracing.SemanticConventions&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

Arinti.Langfuse.Tracing.SemanticConventions

Strongly typed C# constants for three related attribute namespaces:

  • GenAIAttributes — OpenTelemetry semantic conventions for Generative AI spans (SemConv 1.41 GenAI), e.g. gen_ai.operation.name, gen_ai.request.model, gen_ai.usage.input_tokens.
  • LangfuseAttributes — Langfuse-specific attributes (langfuse.trace.*, langfuse.observation.*) that override or supplement the OTel spec when a span is destined for Langfuse OTLP ingestion.
  • OtelAttributes — the small cross-cutting OTel namespaces (user.*, session.*, deployment.*) that Langfuse recognises as fallbacks for its langfuse.* keys when you prefer portable instrumentation over the Langfuse-prefixed form.

No runtime dependencies. Drop the package into any project that writes to Activity / ActivitySource and you stop typing magic keys. Attribute values ("chat", "openai", "generation", …) stay as string literals — the package ships attribute names only, since that's all the upstream SemConv registries declare. See SemConv 1.41 GenAI for the allowed values per attribute.

Usage

using Arinti.Langfuse.Tracing.SemanticConventions;

using Activity? chat = source.StartActivity($"chat {model}");
chat?.SetTag(GenAIAttributes.Operation.Name, "chat");
chat?.SetTag(GenAIAttributes.Provider.Name, "openai");
chat?.SetTag(GenAIAttributes.Request.Model, model);
chat?.SetTag(GenAIAttributes.Request.Temperature, 0.2);
chat?.SetTag(GenAIAttributes.Response.TimeToFirstChunk, ttftSeconds);
chat?.SetTag(GenAIAttributes.Usage.InputTokens, usage.InputTokens);
chat?.SetTag(GenAIAttributes.Usage.OutputTokens, usage.OutputTokens);

// Langfuse-specific identity overrides
chat?.SetTag(LangfuseAttributes.Trace.SessionId, sessionId);
chat?.SetTag(LangfuseAttributes.Trace.UserId, userId);
chat?.SetTag(LangfuseAttributes.Observation.Type, "generation");

When you have both gen_ai.* and langfuse.observation.* set

Langfuse honours langfuse.observation.* with higher precedence — see the Property Mapping section of the Langfuse OpenTelemetry docs for the full priority order.

Several observation-level attributes (ModelName, ModelParameters, UsageDetails, Input, Output) are redundant if you already emit their gen_ai.* equivalents — Langfuse resolves the same field from the fallback chain. The constants exist for consumers that prefer the Langfuse-prefixed shape; each carries a <seealso/> pointing at the spec-portable alternative.

Generated, not hand-written

GenAIAttributes.cs, OtelAttributes.cs, and LangfuseAttributes.cs are produced by the OpenTelemetry Weaver tool from the upstream SemConv registry (pinned in weaver/registry/manifest.yaml) and a local langfuse.* registry under weaver/model/langfuse/. Do not edit those files by hand — they carry an <auto-generated> marker and any manual change is overwritten the next time anyone re-runs generation.

To refresh against a newer SemConv release or after editing the Langfuse registry, clone this repo and run:

weaver/generate.sh
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Arinti.Langfuse.Tracing.SemanticConventions:

Package Downloads
Arinti.Langfuse.Tracing.MEAI

An IChatClient middleware that records a Langfuse `generation` observation per provider request, shaped per OTel GenAI semantic conventions (chat span). Plug into a ChatClientBuilder pipeline; works with any Microsoft.Extensions.AI adapter (OpenAI, Azure OpenAI, Mistral, Gemini, …).

Arinti.Langfuse.Tracing.SemanticKernel

OpenTelemetry tracing primitives for Microsoft.SemanticKernel — filters, hooks, and helpers that shape SK pipeline activity into the OTel GenAI span conventions Langfuse ingests natively.

Arinti.Langfuse.Tracing.ContextPropagation

OpenTelemetry context propagation that lets a .NET process emit a Langfuse semantic trace tree in parallel with its technical trace tree, with Langfuse-to-Langfuse parent links preserved across async boundaries and HTTP calls.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.1 446 7/10/2026
1.0.0-alpha.0 188 6/21/2026