Conversation
…apping + gh-aw.engine Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a1ae35d9-70f1-47cb-86f6-58482f18ca34 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a1ae35d9-70f1-47cb-86f6-58482f18ca34 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates OTLP agent span attributes to align with OpenTelemetry GenAI semantic conventions so observability backends can correctly classify spans as GenAI.
Changes:
- Add an engine-id →
gen_ai.systemmapping table for known engines. - Replace
gen_ai.provider.namewith standardgen_ai.system, while preserving the original engine ID as a custom attribute. - Update Vitest assertions to reflect the new attribute names/values.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/send_otlp_span.cjs | Introduces ENGINE_TO_SYSTEM_MAP and emits gen_ai.system (mapped) plus a custom attribute for the raw engine ID on the agent span. |
| actions/setup/js/send_otlp_span.test.cjs | Updates tests to assert gen_ai.system and the preserved raw engine attribute instead of gen_ai.provider.name. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
actions/setup/js/send_otlp_span.cjs:38
- ENGINE_TO_SYSTEM_MAP is a plain object and the lookup uses
ENGINE_TO_SYSTEM_MAP[engineId]. IfengineIdis set to a prototype property name like"constructor"/"__proto__", the lookup can return a non-string and end up emittinggen_ai.systemas"[object Object]"or a function source string. Use a prototype-safe map (e.g.,Object.create(null)for the mapping object, orObject.hasOwn(...)/hasOwnPropertychecks before reading) and ensure the resolved value is a string.
const ENGINE_TO_SYSTEM_MAP = {
copilot: "github_models",
claude: "anthropic",
codex: "openai",
gemini: "google_vertex_ai",
};
actions/setup/js/send_otlp_span.cjs:940
- The agent span currently already includes
gh-aw.engine.idvia the sharedattributesarray, and this change adds a second, differently-named attributegh-aw.engine. This duplicates the same value and diverges from the existing naming convention (gh-aw.engine.id) used elsewhere in this file for engine IDs. Consider reusinggh-aw.engine.idfor the preserved engine ID (and only emittinggen_ai.systemas the mapped value) to avoid redundant attributes and inconsistent field names.
if (engineId) {
const genAiSystem = ENGINE_TO_SYSTEM_MAP[engineId] || engineId;
agentAttributes.push(buildAttr("gen_ai.system", genAiSystem));
agentAttributes.push(buildAttr("gh-aw.engine", engineId));
}
- Files reviewed: 2/2 changed files
- Comments generated: 2
| expect(attrs["gh-aw.engine"]).toBe("claude"); | ||
| expect(attrs["gen_ai.workflow.name"]).toBe("otel-advisor"); | ||
| }); | ||
|
|
| * `gen_ai.system` values expected by Grafana, Datadog, Honeycomb, and Sentry. | ||
| * Unknown engines fall back to the engine ID as-is. |
🧪 Test Quality Sentinel ReportTest Quality Score: 100/100✅ Excellent test quality
Test Classification Details
AnalysisBoth modified tests verify observable OTLP span attributes — the exact key names and values that consumers of telemetry data would see. This is a textbook behavioral contract test:
Mocking of Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
References: §25138992304
|
|
@copilot review all comments |
…date docs Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d7ed7311-03df-4287-a961-5b7a81ef3fce Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit
|
Agent spans were emitting the non-standard
gen_ai.provider.nameattribute with raw gh-aw engine IDs, causing OTel backends (Grafana, Datadog, Honeycomb) to treat them as plain INTERNAL spans rather than routing them to native GenAI dashboards.Changes
send_otlp_span.cjs: Adds a prototype-safeENGINE_TO_SYSTEM_MAP(usingObject.create(null)) and replacesgen_ai.provider.namewith the standardgen_ai.systemattribute on the agent span. Preserves the original engine ID in a newgh-aw.engineattribute.send_otlp_span.test.cjs: Updates assertions to match the new attribute names and mapped values. Adds a test for the unknown-engine fallback (raw engine ID passed through as-is).docs/src/content/docs/reference/frontmatter.md: Updates the agent span attributes table to documentgen_ai.systemandgh-aw.engine, and adds a migration note for users upgrading fromgen_ai.provider.name.Mapping
gen_ai.systemcopilotgithub_modelsclaudeanthropiccodexopenaigeminigoogle_vertex_aiAttribute diff on agent span