Skip to content

Unify OTel engine identity on agent spans and remove duplicate gen_ai.system#32801

Merged
pelikhan merged 2 commits into
mainfrom
copilot/otel-advisor-unify-gh-aw-engine-id
May 17, 2026
Merged

Unify OTel engine identity on agent spans and remove duplicate gen_ai.system#32801
pelikhan merged 2 commits into
mainfrom
copilot/otel-advisor-unify-gh-aw-engine-id

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

Agent spans were emitting engine identity under gh-aw.engine while setup/conclusion spans use gh-aw.engine.id, fragmenting cross-span engine queries. Agent spans also emitted gen_ai.system twice due to re-adding an attribute already present in inherited attributes.

  • Telemetry attribute normalization

    • Removed agent-span-specific emission of gh-aw.engine.
    • Agent spans now rely on shared attributes, so engine identity is consistently represented as gh-aw.engine.id across setup, conclusion, and agent spans.
  • Duplicate attribute removal

    • Removed redundant agent-span push of gen_ai.system.
    • Agent spans now carry a single gen_ai.system value (inherited from conclusion attributes).
  • Targeted test updates

    • Updated agent-span expectations from gh-aw.engine to gh-aw.engine.id.
    • Added an assertion that gen_ai.system appears exactly once on the agent span.
    • Kept unknown-engine fallback behavior intact (gen_ai.system falls back to raw engine ID).
const agentAttributes = [...attributes, ...usageAttrs];
agentAttributes.push(buildAttr("gen_ai.operation.name", "chat"));
// no extra push for gen_ai.system or gh-aw.engine;
// shared attributes already include gen_ai.system + gh-aw.engine.id

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve OTel instrumentation: unify gh-aw.engine.id across spans Unify OTel engine identity on agent spans and remove duplicate gen_ai.system May 17, 2026
Copilot AI requested a review from pelikhan May 17, 2026 12:19
@pelikhan pelikhan marked this pull request as ready for review May 17, 2026 12:20
Copilot AI review requested due to automatic review settings May 17, 2026 12:20
@pelikhan pelikhan merged commit aee2554 into main May 17, 2026
@pelikhan pelikhan deleted the copilot/otel-advisor-unify-gh-aw-engine-id branch May 17, 2026 12:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR normalizes telemetry attributes for agent spans so engine identity uses gh-aw.engine.id consistently and avoids duplicate gen_ai.system emission.

Changes:

  • Removed agent-span-specific emission of gen_ai.system and gh-aw.engine.
  • Updated agent span tests to expect inherited gh-aw.engine.id.
  • Added test coverage ensuring gen_ai.system appears only once.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Removes redundant agent span attributes so shared conclusion attributes provide engine/system identity.
actions/setup/js/send_otlp_span.test.cjs Updates expectations for normalized engine attributes and adds duplicate gen_ai.system coverage.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[otel-advisor] OTel improvement: unify gh-aw.engine.id across all span types and drop duplicate gen_ai.system on the agent span

3 participants