Update OpenTelemetry GenAI conventions to latest - #18
Draft
github-actions[bot] wants to merge 18 commits into
Draft
Update OpenTelemetry GenAI conventions to latest#18github-actions[bot] wants to merge 18 commits into
github-actions[bot] wants to merge 18 commits into
Conversation
The OpenTelemetry GenAI semantic conventions moved from open-telemetry/semantic-conventions (under area:gen-ai) to a dedicated repo, open-telemetry/semantic-conventions-genai. The new repo also hosts mcp, openai, anthropic, aws-bedrock, and azure-ai-inference areas, has no releases yet (CHANGELOG Unreleased is the live view), no area: labels (every PR is in scope), and a GenAI-namespaced schema URL (opentelemetry.io/schemas/gen-ai/X.Y.Z) independent of core semconv. Changes (docs-only, no source code edits): - SKILL.md: new Migration Note + Cross-repo applicability sections; rewritten Input Handling for 4 input shapes (PR refs, CHANGELOG snapshot, date range, releases); In-scope areas table with concrete external repo references; broadened search terms in PR Preflight, Mode 1 spec, Mode 2/3/5; Gotchas updated with transitional version- reference grep regex and area-aware constants bullet. - references/file-inventory.md: pre/post-migration doc-comment wording, transitional grep regex, Provider-specific instrumentation table. - references/historical-releases.md: Migration Note prepended; pointers to new repo CHANGELOG/releases/PRs. - references/change-classification.md: Areas section; Area column added to audit and PR-description tables; example anthropic row reflects cross-repo flagging. - references/implementation-patterns.md: Area placement guidance callout; Pattern 6 rewritten with pre/post wording and one-shot migration guidance. - references/implementation-procedure.md: area-aware nested class bullet. - references/review-checklist.md: §6 transitional grep + wording- migration bullet; §7 area-aware nesting; §8 provider-scope bullet with cross-repo case. - references/prompt-template.md: 4-input-shape Background block; Area column in audit table; cross-repo flagging guidance. - references/pr-description.md: title clarifies independent GenAI version; Area column in PR table; old-repo catch-up linkage. - references/testing-guide.md: Per-area test files section. For provider-specific areas not instrumented in dotnet/extensions (anthropic, aws-bedrock), the skill can be applied in the corresponding SDK repos: anthropics/anthropic-sdk-csharp and the BedrockRuntime service library of aws/aws-sdk-net. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- SKILL.md Migration Note: drop point-in-time version examples (1.42.0 / v1.41.0 "at the time of writing") in favor of the X.Y.Z placeholder already used elsewhere. - SKILL.md "No releases yet" bullet: remove "as of this writing" and add a TODO marker to remove the framing once the first release ships. - implementation-procedure.md: split the dense constant-location bullet into a mini-list and link the area-placement table in implementation-patterns.md instead of restating areas inline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Spec URL now resolves to a 'Moved' stub; soften the claim, keep the <see href> for now, and add a TODO to retarget once a canonical URL exists - Note the schema URL (opentelemetry.io/schemas/gen-ai/X.Y.Z) is not yet published; derive the GenAI version from CHANGELOG/versions.env until then - Correct area-classification guidance: only gen-ai, mcp, openai, and aws-bedrock have a model/<area>/ registry; anthropic and azure-ai-inference are docs-only under docs/gen-ai/<provider>.md; all docs live under docs/gen-ai/ - Drop the broken schema-snapshot/ reference from Mode 1 step 4 - Note the new repo uses granular area:* labels (area:mcp, area:inference, etc.) - Apply the same corrections to the In-scope areas table header, change-classification.md, and implementation-patterns.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Self-review follow-ups found while verifying the skill against the live semantic-conventions-genai repo: - versions.env holds only the core semconv dependency (SEMCONV_VERSION, currently v1.42.0) and the Weaver version; it carries no GenAI version. Remove guidance that derived the GenAI version from versions.env and state that, until a GenAI release/schema URL exists, the update is identified by its Unreleased CHANGELOG snapshot (commit/ref/date) - file-inventory.md: drop the stale 'published spec page still resolves and renders the spec' claim; the page is now a 'Moved' stub, so keep the <see href> only until a canonical URL is published and read docs/gen-ai/ and model/<area>/ as the spec source - file-inventory.md / implementation-patterns.md: stop tying the doc-comment version to the unpublished schema URL; replace the v1.42.0 target-wording example (the core semconv version) with vX.Y.Z - pr-description.md: same version-source correction for the PR title Stop referring to a 'new repo' and an 'old repo'. Treat open-telemetry/semantic-conventions-genai as the current conventions repo and refer to open-telemetry/semantic-conventions as the consolidated repo where these conventions were previously managed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The semantic-conventions-genai CHANGELOG.md Unreleased section is empty (managed by Towncrier; fragments are compiled into it only at release time), so the live what's-new view is the changelog.d/ news fragments. - SKILL.md: Migration Note describes the Towncrier mechanism and points the what's-new view at changelog.d/ fragments; Input Handling snapshot form, Mode 1 step 4, and Mode 5 step 1 reference changelog.d/ instead of the CHANGELOG.md Unreleased section; intro lists "changelog snapshots". - references/file-inventory.md, implementation-patterns.md, pr-description.md: take the audited GenAI version from the changelog.d/ fragment snapshot. - references/historical-releases.md, prompt-template.md: link/label the changelog.d/ fragments as the snapshot source. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- references/pr-description.md Title: add a `latest` title form
("Update OpenTelemetry GenAI conventions to latest") for the unreleased
case (no release and no published schema URL), alongside the
versioned form; keep the title as `latest` and pin the changelog.d/
snapshot in the body until a version exists.
- references/pr-description.md Description: use `latest` in the Version
column and record the changelog.d/ fragment snapshot when no GenAI
version number is determined yet.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
references/pr-description.md: add an "Upstream scan tracking tables" subsection defining one shared column set for both the merged-changes table and the in-flight (open-PR) table: `| Upstream PR | Area | Change | Applicability | Status |`. The Applicability column holds the color symbol only; explanatory text goes in the separate Status column. Includes the applicability legend (implemented / aligned / watch / not applicable). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
references/pr-description.md: add guidance that the Change column must use
break opportunities (', ' or ' / ' with spaces) instead of long
unbroken /-separated runs, which browsers do not wrap and which force the
table wider than the viewport.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- pr-description.md: add an "Upstream-scan tracking PR body template" section laying out the body in order -- status note, "What this PR implements" table, the merged and in-flight applicability tables, and the otel-genai-tracking state block as the final section. - Keep the refresh procedure out of the PR body: document it in a "Refreshing the tracking PR" skill section that drives the update-otel-genai-conventions skill (Mode 1 Audit, Input Handling git log diff, change-classification, version-reference migration). - SKILL.md: point "PR Title and Description Guidance" at the full body template; note in Preflight that the tracking PR is the scan record to refresh, not a blocking duplicate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add ReasoningLevel constant to OpenTelemetryConsts.GenAI.Request - Emit gen_ai.request.reasoning.level from ChatOptions.Reasoning.Effort (lowercased enum name) in OpenTelemetryChatClient - Augment ExpectedInformationLogged_Async test with Reasoning option and gen_ai.request.reasoning.level assertion - Refactor DeriveModalityFromMediaType to check IsDocumentMediaType before top-level type parsing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Commit pushed:
|
…entions-genai#201) - Add GenAI.ExecuteTool.Duration metric constants (Name, Description, ExplicitBucketBoundaries) to OpenTelemetryConsts.cs - Add CreateGenAIExecuteToolDurationHistogram factory to OtelMetricHelpers.cs - FunctionInvocationProcessor accepts optional Histogram<double>? and emits gen_ai.execute_tool.duration on each function call with gen_ai.tool.name, gen_ai.tool.type, and error.type (on failure) tags - FunctionInvokingChatClient and FunctionInvokingRealtimeClientSession create/own/dispose a Meter and Histogram, wiring it to FunctionInvocationProcessor - Augment FunctionInvocationTrackedWithActivity test to assert on the execute_tool duration metric - Fix stale 'v1.41' wording in custom Realtime attributes doc-comment Deferred (no emission site): - gen_ai.invoke_agent.duration (PR dotnet#201): no invoke_agent client in this repo - gen_ai.prompt.name/version/variable (PR dotnet#179): no ChatOptions property to emit from Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Commit pushed:
|
Author
|
Upstream scan update — ref Three new upstream changes merged since the last scan (
No code changes required. PR body updated with new scan reference.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR implements
gen-aigen_ai.request.reasoning.levelReasoningLevelconstant; emit fromChatOptions.Reasoning.Effort; test augmented.gen-aidocumentmodality for PDF/OpenXMLDeriveModalityFromMediaTypereturns"document"forapplication/pdfand OpenXML MIME types; test augmented.gen-aiSemantic Conventions for Generative AI systems v1.41toGenAI Semantic Conventions latest.gen-aigen_ai.execute_tool.durationhistogramGenAI.ExecuteTool.Durationconstants;CreateGenAIExecuteToolDurationHistogramfactory;FunctionInvocationProcessoremits per-call withgen_ai.tool.name,gen_ai.tool.type,error.type;FunctionInvokingChatClient+FunctionInvokingRealtimeClientSessionown theMeter; test augmented.gen-aigen_ai.invoke_agent.duration+gen_ai.prompt.*(deferred)invoke_agentclient; noChatOptionsprompt-identity property today.Validation: build clean (net8.0/net9.0/net10.0, 0 warnings); all tests pass. Supersedes #17.
Upstream scan tracking
Legend: 🔴 implemented · ✅ aligned · 🟡 deferred/watch · 🟢 not applicable
Merged (Unreleased) — scanned ref
e153ed9(2026-06-26)gen-aigen_ai.request.reasoning.levelOpenTelemetryChatClient.gen-aiprovider.namerequired oninvoke_agentinvoke_agentspan emits it.gen-aigen_ai.conversation.compacted+CompactionPartgen-aidocumentmodalityOtelMessageSerializer.DeriveModalityFromMediaType.gen-aigen_ai.system_instructionstext-onlyOtelGenericPart(text) emitted.gen-aitop_kdouble→intChatOptions.TopKisint?.gen-aiprovider.nameon metricgen-aiplanoperation namegen-aigen_ai.execute_tool.durationhistogramFunctionInvocationProcessor;OpenTelemetryConsts.GenAI.ExecuteTool.Duration.gen-aigen_ai.invoke_agent.durationhistograminvoke_agentclient.gen-aigen_ai.prompt.name/version/variableChatOptionsprompt-identity property; constant deferred.gen-aigen_ai.invoke_agent.durationin-proc / internal span clarificationinvoke_agentclient in this repo.gen-aigen_ai.tool.name/gen_ai.tool.typesampling-relevant on execute_tool;gen_ai.agent.nameadded (agent context); invoke_agent attribute alignmentgen_ai.tool.nameandgen_ai.tool.typealready passed as initial tags at activity creation.gen_ai.agent.namedeferred — no agent-name source in generic layer. invoke_agent changes not applicable.gen-aiIn-flight (open PRs)
gen-aiBlobPart.contentoptional +stripped_reasonOtelBlobPartserialization.gen-aibyte_sizeon content partsgen-aigen_ai.usage.*attributes.gen-aigen_ai.client.operation.durationgen-aigen-aigen_ai.agent.finish_reason+time_budgetgen-aiinvoke_agentspan attributesgen-aiworkflow.durationgen-aigen-aigen-aigen-aiexecute_toolspangen_ai.execute_tool.duration.gen-aigen_ai.token.cache/reasoningmetricsgen-aigen-aiTracking state