Skip to content

Update OpenTelemetry GenAI conventions to latest - #15

Closed
github-actions[bot] wants to merge 2 commits into
mainfrom
update-otel-genai-to-latest-28307398081
Closed

Update OpenTelemetry GenAI conventions to latest#15
github-actions[bot] wants to merge 2 commits into
mainfrom
update-otel-genai-to-latest-28307398081

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Draft pending the first release of
open-telemetry/semantic-conventions-genai.
Both conventions are Development stability and unreleased. Merge once they ship in a tagged release.

What this PR implements

Area Convention Upstream Compensating change
gen-ai document modality in multimodal content parts #142 Added IsDocumentMediaType in OtelMessageSerializer; DeriveModalityFromMediaType returns "document" for PDF/Office/ODF MIME types. Augmented AllOfficialOtelContentPartTypes_SerializedCorrectly test.
gen-ai gen_ai.request.reasoning.level attribute #258 Added ReasoningLevel constant in OpenTelemetryConsts and emission in OpenTelemetryChatClient; maps ChatOptions.Reasoning?.Effort to "low"/"medium"/"high"/"extra_high". Augmented ExpectedInformationLogged_Async.
gen-ai Doc-comment wording migration Updated all OpenTelemetry* client files from Semantic Conventions for Generative AI systems v1.41 to GenAI Semantic Conventions latest.

Validation: build clean (net8.0/net9.0/net10.0, 0 warnings); 15 OpenTelemetryChatClientTests pass (all 3 TFMs). No public API surface change (OpenTelemetryConsts is internal); doc-comment at GenAI Semantic Conventions latest.

Upstream scan tracking

Legend: 🔴 implemented here · ✅ already aligned · 🟡 watch/deferred · 🟢 not applicable (no client / docs-only)

Merged upstream changes (Unreleased) -- applicability to dotnet/extensions

Scanned at commit 93de98a (2026-06-18).

Upstream PR Area Change Applicability Status
#97 gen-ai plan operation name for agent planning spans 🟡 Deferred — no planning span today.
#99 gen-ai moonshot_ai well-known value for gen_ai.provider.name 🟢 No code change needed.
#107 gen-ai gen_ai.agent.name marked sampling-relevant 🟢 No emission site in this repo.
#126 gen-ai gen_ai.workflow.duration metric + gen_ai.workflow.name 🟢 No workflow instrumentation today.
#136 mcp gen_ai.tool.call.arguments / result on MCP server span 🟢 No MCP server instrumentation.
#140 gen-ai GenAI memory operations + attributes 🟢 No memory client instrumentation today.
#142 gen-ai document modality in multimodal content parts 🔴 Implemented in OtelMessageSerializer.DeriveModalityFromMediaType.
#162 gen-ai gen_ai.conversation.compacted + CompactionPart schema 🟡 Deferred — no compaction support today.
#211 gen-ai Clarify billed vs. consumed token counts 🟢 Docs-only clarification.
#212 gen-ai Generalize gen_ai.provider.name description 🟢 Docs-only clarification.
#214 gen-ai gen_ai.provider.name relaxed to Conditionally Required Already aligned — emitted when available.
#216 gen-ai Span SHOULD cover full duration including retries 🟢 Docs-only clarification.
#217 gen-ai gen_ai.request.top_k type doubleint, decoding-only Already aligned — uses if (options.TopK is int topK).
#217 gen-ai Clarify top_k is sampling/decoding, not top_logprobs 🟢 Docs-only clarification.
#219 gen-ai gen_ai.conversation.id must not use fallback values 🟢 Docs-only clarification.
#220 mcp Clarify MCP context propagation per SEP-414 🟢 No MCP instrumentation.
#242 gen-ai gen_ai.agent.id scope clarified; removed from internal spans Already aligned — not emitted in this repo.
#257 gen-ai Limit gen_ai.system_instructions parts to text only Already aligned — serialized as text-only.
#258 gen-ai gen_ai.request.reasoning.level added to inference spans 🔴 Implemented in OpenTelemetryChatClient; maps ChatOptions.Reasoning?.Effort.
#289 gen-ai Remove gen_ai.provider.name from invoke_agent internal span 🟢 No invoke_agent instrumentation today.

In-flight upstream changes (open PRs) -- applicability if merged

Excluded dependency / CI / chore / server-only PRs: dotnet#112, dotnet#164, dotnet#202, dotnet#215, dotnet#252, dotnet#283, dotnet#290, dotnet#291, dotnet#324, dotnet#325, dotnet#328, dotnet#340, dotnet#351.

Upstream PR Area Change Applicability Status
#96 gen-ai gen_ai.token.cache / gen_ai.token.reasoning metric attributes 🟡 Watch — new breakdown attributes on gen_ai.client.token.usage.
#98 gen-ai Agent-to-agent handoff as execute_tool span 🟡 Watch — may affect FunctionInvocationProcessor span naming.
#143 gen-ai Optional byte_size on multimodal content parts 🟡 Watch — additive field on OtelBlobPart / OtelUriPart / OtelFilePart.
#144 gen-ai BlobPart.content optional + stripped_reason 🟡 Watch — may require OtelBlobPart.Content to be made optional.
#197 gen-ai Modality / cache / phase token-usage breakdown metrics 🟡 Watch — additive token-usage breakdown.
#238 gen-ai gen_ai.agent.finish_reason attribute 🟡 Watch — no invoke_agent instrumentation today.
#250 gen-ai gen_ai.agent.invocation.id attribute 🟡 Watch — no invoke_agent instrumentation today.
#270 gen-ai GenAI agent entity attributes 🟡 Watch — relevant when agent spans land.
#336 gen-ai gen_ai.invoke_agent.inference_calls / tool_calls metrics 🟡 Watch — no invoke_agent instrumentation today.
#341 gen-ai Rename gen_ai.workflow.durationgen_ai.invoke_workflow.duration 🟡 Watch — metric name change if workflow instrumentation lands.
#350 gen-ai gen_ai.agent.identity.id / gen_ai.agent.identity.name 🟡 Watch — relevant when agent spans land.

Tracking state

# otel-genai-tracking:begin
Upstream-Repo: open-telemetry/semantic-conventions-genai
Upstream-Scan-Ref: 93de98a5b1298ee6708c76ca87cb389861689732  # 2026-06-18; gen_ai.request.reasoning.level (#258) integrated
Upstream-Scan-Date: 2026-06-28T01:39:36Z
Upstream-Release: none                        # Unreleased; Towncrier fragments under changelog.d/
Core-Semconv-Dependency: v1.42.0              # versions.env SEMCONV_VERSION (core dep, NOT the GenAI version)
DotnetExtensions-Implemented-Version: latest  # doc-comment migrated to GenAI Semantic Conventions latest
# otel-genai-tracking:end

Generated by MEAI: Update Otel Gen-AI · 224.7 AIC · ⊞ 10.8K ·

Add document modality detection in OtelMessageSerializer.DeriveModalityFromMediaType
to support the new 'document' modality value added to the GenAI semantic conventions
(open-telemetry/semantic-conventions-genai#142). PDF, Office, and ODF file types
(application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/vnd.oasis.opendocument.*, application/rtf, text/rtf) now emit
modality: 'document' in message-part serialization.

Also migrate doc-comment wording in all OpenTelemetry* instrumentation client files
from 'Semantic Conventions for Generative AI systems v1.41' to
'GenAI Semantic Conventions latest' per the new standalone conventions repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#258)

Maps ChatOptions.Reasoning?.Effort to gen_ai.request.reasoning.level string tag
on GenAI inference spans. ReasoningEffort.Low/Medium/High/ExtraHigh emit
'low'/'medium'/'high'/'extra_high' respectively; None is not emitted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Author

Commit pushed: 83fe9f1

Generated by MEAI: Update Otel Gen-AI · 224.7 AIC · ⊞ 10.8K

@github-actions

Copy link
Copy Markdown
Author

Incremental update: integrated upstream semantic-conventions-genai#258 — scanned commit 93de98a (2026-06-18).

New convention implemented:

  • gen_ai.request.reasoning.level — added ReasoningLevel constant to OpenTelemetryConsts.GenAI.Request and emission in OpenTelemetryChatClient; maps ChatOptions.Reasoning?.Effort (Low/Medium/High/ExtraHigh) to the strings "low"/"medium"/"high"/"extra_high" respectively. ReasoningEffort.None does not emit the tag.

Validation: 15 OpenTelemetryChatClientTests pass on net8.0/net9.0/net10.0 (0 build warnings). No public API surface change.

Generated by MEAI: Update Otel Gen-AI · 224.7 AIC · ⊞ 10.8K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant