Skip to content

Update open-telemetry/semantic-conventions-genai to latest - #13

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

Update open-telemetry/semantic-conventions-genai to latest#13
github-actions[bot] wants to merge 4 commits into
mainfrom
update-otel-genai-to-latest-28273251078

Conversation

@github-actions

Copy link
Copy Markdown

Integrate unreleased gen-ai semantic conventions changes from upstream HEAD (e153ed9) in open-telemetry/semantic-conventions-genai.

This PR maintains continuous alignment with the OpenTelemetry GenAI semantic conventions (Development stability) by implementing actionable changes and documenting deferred items until they have emission sites in Microsoft.Extensions.AI.

Supersedes #11 (closed without merge).

What this PR implements

Change Impact Implementation
gen_ai.request.reasoning.level attribute added 🟡 Enhancement Added constant to OpenTelemetryConsts.cs and emission in OpenTelemetryChatClient.cs. Maps ChatOptions.Reasoning.Effort enum to lowercase string values ("none", "low", "medium", "high", "extra_high").
document modality value added to message schemas 🟡 Enhancement Updated DeriveModalityFromMediaType() to return "document" for application/* media types (e.g., PDF, DOCX).
moonshot_ai provider value added 🟢 Spec update No code change required — gen_ai.provider.name already accepts any string value. This is a well-known value addition to the spec.

Deferred Changes (Documented Only)

Change Type Rationale
gen_ai.conversation.compacted attribute 🟢 Deferred New attribute. No emission site — conversation compaction not yet instrumented.
gen_ai.prompt.version and gen_ai.prompt.variable attributes 🟢 Deferred New attributes. No emission site — prompt management/templating not yet instrumented.
gen_ai.workflow.duration metric 🟢 Deferred New metric. Workflow orchestration not yet instrumented.
gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration metrics 🟢 Deferred New metrics. Agent/tool duration tracking not yet instrumented beyond basic spans.
Memory operation spans and attributes (create/delete store, CRUD records) 🟢 Deferred New capability. Memory store operations not yet instrumented.
plan operation name for agent planning spans 🟢 Deferred New operation. Planning/task-decomposition not yet instrumented as a distinct operation.
Agent/tool sampling-relevance changes 🟢 Deferred Attribute scope/requiredness changes for uninstrumented capabilities.
MCP context propagation clarification 🟢 Clarification Documentation update for MCP params._meta keys per SEP-414. No code impact.
Token count guidance (billed vs. consumed) 🟢 Clarification Documentation clarification. M.E.AI already emits what providers report.
GenAI span duration guidance (includes retries) 🟢 Clarification Documentation clarification. M.E.AI spans already cover full operation duration.
gen_ai.conversation.id guidance (no fallback UUIDs) 🟢 Clarification Documentation clarification. M.E.AI already emits only available conversation IDs.
gen_ai.provider.name generalization 🟢 Clarification Documentation update removing inference-centric language. No code impact.
gen_ai.provider.name relaxed to Conditionally Required on duration metric 🟢 Clarification Requiredness change for metric already emitted. No functional impact.
gen_ai.system_instructions part types limited to text 🟢 Clarification Schema constraint. M.E.AI already only emits text system instructions.
gen_ai.request.top_k type change and scoping 🟢 Clarification Type changed from double to int and scoped to decoding only (retrieval uses new gen_ai.retrieval.top_k). M.E.AI already uses int and only emits for chat (decoding context).

Testing

  • Added test coverage for gen_ai.request.reasoning.level emission with ReasoningEffort.High
  • Added test coverage for document modality with application/pdf content
  • All existing tests pass

Upstream Tracking

Upstream-Repo: open-telemetry/semantic-conventions-genai
Upstream-Scan-Ref: e153ed94728993acd0ee6a958559032ca8b20afe
Upstream-Scan-Date: 2026-06-27T00:45:34Z
Upstream-Release: none
Core-Semconv-Dependency: v1.42.0
DotnetExtensions-Implemented-Version: v1.41

Generated by MEAI: Update Otel Gen-AI · ● 25M ·

jeffhandley and others added 4 commits June 26, 2026 19:39
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.
- 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>
Integrate unreleased gen-ai semantic conventions changes from upstream HEAD (e153ed94728993acd0ee6a958559032ca8b20afe).

- Add gen_ai.request.reasoning.level attribute for capturing requested reasoning effort level from ChatOptions.Reasoning.Effort, mapping ReasoningEffort enum to normalized lowercase tokens (none, low, medium, high, extra_high)
- Add 'document' modality value for application/* media types (e.g., PDF, DOCX) in DeriveModalityFromMediaType
- Update tests to cover new reasoning.level attribute with ReasoningEffort.High and document modality with application/pdf

The moonshot_ai provider value is a spec documentation addition only (no code change required).

Other upstream changes (gen_ai.conversation.compacted, gen_ai.prompt.version/variable, gen_ai.invoke_agent.duration, gen_ai.execute_tool.duration, memory/workflow/agent spans) are deferred as they have no current emission site in M.E.AI or require capabilities not yet instrumented.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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