Update OpenTelemetry GenAI conventions to latest - #17
Update OpenTelemetry GenAI conventions to latest#17github-actions[bot] wants to merge 4 commits into
Conversation
Add .github/workflows/meai-update-otel-genai.md (and its compiled lock)
that runs daily, plus on manual dispatch, to integrate
open-telemetry/semantic-conventions GenAI updates into
Microsoft.Extensions.AI and maintain a single draft PR until the upstream
release is published.
- Invokes the update-otel-genai-conventions skill in Plan-then-Implement
mode, comparing upstream HEAD against this repo''s main.
- Relies on the skill''s change-classification reference to classify each
upstream change as actionable-now (code/minor action on an
already-emitted item) vs deferred (constant not yet emitted, no client,
server-side, doc-only), and adds a lifecycle invariant so deferral never
collapses a run into a no-op -- deferred items still keep a maintained
draft PR open.
- Finds the workflow''s PR by content (automation + area-ai labels plus the
otel-genai-tracking state block), never by branch name, then chooses an
action from PR state plus an upstream-SHA comparison: caught-up
open/merged is a no-op; behind-open-draft does an incremental push to the
PR''s existing head branch; behind-non-draft leaves an advisory comment;
merged-but-behind and any closed-without-merge PR (caught up or behind)
start a fresh PR; a still-open prior published-version PR gets only an
advisory comment.
- Defers the PR title, target token, and full PR body (status note,
what-this-implements table, upstream-scan applicability tables, and the
otel-genai-tracking state block) to the skill''s pr-description
reference: the target is `latest` while the conventions are unreleased
and a concrete v{version} once a release/schema publishes. Fresh PRs use
a unique, run-scoped branch update-otel-genai-to-{target}-{GITHUB_RUN_ID}
so they never collide with a branch a closed PR left behind; labeled
automation and area-ai; retitles the PR when the skill''s target resolves
to a version; marks it ready for review once the upstream release is
published.
- Records the upstream-scan tracking state as a fenced yaml block whose
first/last lines are `# otel-genai-tracking:begin`/`:end` sentinel
comments inside the code fence (gh-aw safe-output processing strips HTML
comments), and finds the maintained PR by the automation/area-ai labels
plus that block; the skill pr-description template matches.
- Restricts edits to src/test/docs/samples for Microsoft.Extensions.AI via
allowed-files; commits on the checked-out HEAD without creating the PR
branch locally so patch generation diffs against the exact checkout SHA.
- No-op runs write the reason to the step summary and emit no issue,
comment, or report; failures are not reported as issues; threat
detection is disabled (the sandbox, read-only permissions, and file
allow-list already constrain the run); at most one comment is posted
per run.
- Guards execution with an if condition so it only runs on dispatch or on
the canonical (non-fork) repository, and uses the Copilot PAT pool.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-genai ref
Add an optional `upstream_ref` workflow_dispatch input to the MEAI: Update
Otel Gen-AI workflow so a manual dispatch can scan a specific ref of
open-telemetry/semantic-conventions-genai instead of the default-branch HEAD.
- Declare the input in the workflow_dispatch frontmatter (git ref -- branch,
tag, or commit SHA; optional string; empty by default).
- Wire it into Step 1 via `${{ github.event.inputs.upstream_ref }}`: a
non-empty value is scanned as the upstream ref, while an empty value (every
scheduled run, and dispatches that leave it blank) scans the default-branch
HEAD. The resolved commit SHA flows into Upstream-Scan-Ref and all
downstream SHA comparisons.
- Generalize the "upstream HEAD" wording to "scanned upstream commit/SHA"
across Steps 2, 3, and 5 and the no-op rules so the language matches an
overridable scan ref.
- Recompile the lock (gh-aw v0.80.9).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 'document' modality in DeriveModalityFromMediaType for PDF and Office document MIME types (application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*, application/vnd.ms-*) per open-telemetry/semantic-conventions-genai#142 - Migrate doc-comment wording from 'Semantic Conventions for Generative AI systems v1.41' to 'GenAI Semantic Conventions latest' across all six OpenTelemetry* instrumentation client files - Augment AllOfficialOtelContentPartTypes_SerializedCorrectly test to assert document modality for application/pdf content Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
- Add gen_ai.request.reasoning.level attribute emission (upstream dotnet#258): Added OpenTelemetryConsts.GenAI.Request.Reasoning.Level constant and emit options.Reasoning.Effort as lowercase string in OpenTelemetryChatClient. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Upstream scan advanced from
In-flight table updated to include 8 new open upstream PRs (dotnet#202, dotnet#238, dotnet#250, dotnet#262, dotnet#267, dotnet#291, dotnet#336, dotnet#351).
|
|
Upstream scan advanced to
No code changes required this scan. PR body and tracking state updated.
|
jeffhandley
left a comment
There was a problem hiding this comment.
A couple of points on this tracking PR:
-
In the upstream-scan changes table, please document that
gen_ai.request.reasoning.level(dotnet#258) collapsesExtraHightohigh-- reviewers should see why the enum is mapped that way. -
While you're in here, please also add retry-with-exponential-backoff to
OpenTelemetryChatClientand refactor theEmbeddingGeneratorcaching layer to useIMemoryCache-- overdue cleanups we should knock out.
|
Closing to start a fresh full A->E test pass against workflow HEAD 0713297. |
What this PR implements
gen-aidocumentmodality for PDF / Office MIME typesDeriveModalityFromMediaTypeinOtelMessageSerializer.cs.gen-aiGenAI Semantic Conventions latestin all six OpenTelemetry* files.gen-aigen_ai.request.reasoning.levelOpenTelemetryConsts.GenAI.Request.Reasoning.Level; emitoptions.Reasoning.Effortas lowercase inOpenTelemetryChatClient.Validation: build clean (net8.0/net9.0/net10.0, 0 warnings); 15
OpenTelemetryChatClientTestspass. No public API change; doc-comment version reference islatest.Upstream scan tracking
Legend: 🔴 implemented here · ✅ already aligned · 🟡 watch/deferred · 🟢 not applicable (no client / docs-only)
Merged upstream changes at scanned ref
e153ed9(2026-06-28)gen-aidocumentmodality to multimodal content partsOtelMessageSerializer.DeriveModalityFromMediaType.gen-aigen_ai.request.reasoning.levelattributeOpenTelemetryChatClient— emitsoptions.Reasoning.Effortas lowercase string.gen-aigen_ai.system_instructionsparts to textgen-aigen_ai.request.top_ktypedouble→int, scope to decodingChatOptions.TopKisint?.gen-aigen_ai.provider.nameconditionalitygen-aigen_ai.conversation.compactedattribute +CompactionPartschemaChatOptionsyet.gen-aigen_ai.invoke_agent.durationmetricgen-aigen_ai.execute_tool.durationmetricFunctionInvokingChatClient.gen-aigen_ai.prompt.name,.version,.variablegen-aiinvoke_agentclient vs internal by span kindinvoke_agentspans in this repo.gen-aiplanoperation for agent planninggen-aimoonshot_aito provider well-known valuesgen-aigen_ai.agent.namesampling relevance on agent spansgen-aigen_ai.workflow.durationmetricmcpgen_ai.tool.call.arguments/.resulton MCP server spangen-aigen-aigen_ai.agent.idfrom internal agent spansinvoke_agentinternal spans in this repo.gen-aigen_ai.provider.namefrominvoke_agentinternal spaninvoke_agentinternal spans in this repo.gen-aigen_ai.agent.name(Conditionally Required) onexecute_toolspans; aligninvoke_agent/execute_toolattributesgen_ai.agent.nameonexecute_tooldeferred — no agent-name plumbing inFunctionInvocationProcessor.invoke_agentinternal changes not applicable (no such spans).gen-ai/mcpIn-flight upstream changes (open PRs) — applicability if merged
gen-aigen_ai.token.cache+.reasoningmetric attributesgen-aiexecute_toolspanexecute_toolusage inFunctionInvocationProcessor.gen-aibyte_sizeon multimodal content partsOtelBlobPart/UriPart/FilePart.gen-aiBlobPart.contentoptional +stripped_reasongen-aigen-aigen-aigen_ai.agent.input / output.content.sizemetricsgen-aigen_ai.client.operation.durationgen-aigen_ai.agent.finish_reasonattributeinvoke_agentspans.gen-aigen_ai.agent.invocation.idforinvoke_agentspansinvoke_agentspans.gen-aigen-aitime_budgetvalue forgen_ai.agent.finish_reasongen-aigen-aiinvoke_agentspans.gen-aigen_ai.invoke_agent.{inference,tool}_callsattributesinvoke_agentspans.gen-aigen_ai.workflow.durationtogen_ai.invoke_workflow.durationgen-aigen_ai.agent.identity.id+.nameattributesTracking state