Skip to content

Align OpenTelemetry GenAI telemetry with current semantic conventions - #79090

Merged
pelikhan merged 23 commits into
mainfrom
copilot/align-otel-spec-runtime
Nov 19, 2026
Merged

pelikhan merged 23 commits into
mainfrom
copilot/align-otel-spec-runtime

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Align the OTel specification, attribute registry, runtime, and documentation with OpenTelemetry's GenAI semantic conventions while preserving existing telemetry by default.

  • Add standard provider, agent, cache-write, CI/CD, and VCS attributes, plus the OpenTelemetry v1.45.0 schema URL.
  • Emit the four gen_ai.client.inference.usage.* token counters and gen_ai.invoke_agent.duration. Normalize input usage to include cache-read and cache-write tokens exactly once when cache semantics are known; omit unknown inclusive counts and zero-valued token measurements.
  • Add machine-readable error.type values for failed, timed-out, and cancelled agent invocations.
  • Update the specification, generated attribute inventories, reference documentation, and minor-release changeset.

Compatibility and opt-in

Existing span names, kinds, success statuses, token meanings, and compatibility signals remain the default. Set OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental to use invoke_agent INTERNAL spans, leave successful statuses UNSET, adopt cache-inclusive input-token semantics, and omit superseded compatibility-only names.

The gh-aw.* attributes and gh_aw.* metrics remain supported in both modes. This change does not deprecate the default compatibility output or add runtime dependencies.

Coverage and CI

Add a legacy-output golden contract, focused span/metric/token-accounting tests, expanded OTLP protobuf interoperability coverage, and success/failure conformance scenarios using pinned OpenTelemetry conformance tooling and Weaver. Wire conformance validation into CI and make validate-otel-conformance.

Supporting CI repairs isolate telemetry tests from shared temporary artifacts, update workflow/schema compatibility, and tighten organization-rollout result parsing.

Fixes #79089

pelikhan and others added 3 commits November 18, 2026 18:44
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Copilot stopped work on behalf of pelikhan due to an error November 18, 2026 19:33
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot keep working on spec

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot keep working on spec

Clarified the §10.3 GenAI attribute requirements to match §9.5’s opt-in span-shape rules in commit 6c6892b8.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot

  • review that implementation matches spec with tests
  • maintain backward compatibility with existing OTEL messages BUT clearly mark which attributes are deprecated if they have been superseded by the new standard
  • add conformance validation

pelikhan and others added 2 commits November 18, 2026 20:35
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot

  • review that implementation matches spec with tests...

Fixed in fb92ce6. The legacy compatibility golden now isolates runner-provided environment values and OTLP export-error artifacts, and the fixture hashes match both the parent and updated runtimes. The focused OTel tests (539/539), typecheck, syntax check, and final repository gate pass.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot merg main. reflection completeness of implementation.

…ec-runtime

# Conflicts:
#	docs/src/content/docs/reference/open-telemetry.mdx

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 21:34
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 21:34
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot merg main. reflection completeness of implementation.

Merged main and reconciled its metrics reference with the GenAI compatibility/opt-in details in eb3a88f7. Completeness review: the spec, generated registry checks, dual-mode runtime, compatibility golden, 805 focused JS tests, typecheck, and CI conformance/wire-test wiring cover the requested changes. The final gate passed (366 workflows compiled; 233 existing warnings). I couldn't execute Weaver conformance or the SDK wire oracle locally because their isolated tools/SDK aren't installed; the earlier CJS type errors are fixed, and the current typecheck passes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An invalid checkout path prevents the conformance harness from running, incorrect OTLP assertions reject valid payloads, and token-normalization bugs produce inaccurate or missing telemetry.

11 open issues
1 file not reviewed
  • pkg/workflow/otel_attributes_generated.go: Generated file
What changed in this PR

Updates gh-aw’s observability contract and JavaScript runtime toward current OpenTelemetry GenAI conventions for #79089, while retaining compatibility output by default.

Changes:

  • Defines the staged migration contract and registers standard GenAI, CI/CD, and VCS attributes.
  • Adds provider and agent identity, cache-inclusive token accounting, standard metrics, and opt-in agent span behavior.
  • Adds compatibility and interoperability checks, a conformance CI job, documentation, and release notes.
File Description
specs/​otel/​attributes.tsp Registers the new standard attribute names.
specs/​otel-observability-spec.md Defines migration modes, telemetry requirements, and validation coverage.
pkg/​workflow/​otel_attributes_generated.go Updates generated Go attribute constants.
Makefile Adds the GenAI conformance validation target.
docs/​src/​content/​docs/​reference/​open-telemetry.mdx Documents migration behavior and standard metrics.
docs/​src/​content/​docs/​reference/​open-telemetry-attributes.mdx Describes current and compatibility GenAI attributes.
actions/​setup/​js/​send_otlp_span.test.cjs Covers provider mappings, resource aliases, and opt-in spans.
actions/​setup/​js/​send_otlp_span.cjs Implements standard attributes and opt-in span behavior.
actions/​setup/​js/​send_otlp_span_legacy_contract.test.cjs Checks default exports against compatibility snapshots.
actions/​setup/​js/​scripts/​test_otlp_protobuf.mjs Extends reference-SDK wire-format checks.
actions/​setup/​js/​scripts/​check_genai_conformance.mjs Validates required signals in conformance reports.
actions/​setup/​js/​parse_token_usage.test.cjs Extends usage fixtures and exported attribute expectations.
actions/​setup/​js/​parse_mcp_gateway_log.test.cjs Tests inclusive token aggregation.
actions/​setup/​js/​parse_mcp_gateway_log.cjs Aggregates cache-inclusive input counts from proxy records.
actions/​setup/​js/​otlp.cjs Adds pipeline resource context and opt-in success status.
actions/​setup/​js/​otlp_metrics.test.cjs Covers standard metrics, schemas, and resource filtering.
actions/​setup/​js/​otlp_metrics.cjs Adds inference counters and agent duration histograms.
actions/​setup/​js/​otel_contract.test.cjs Extends compatibility assertions for additive attributes.
actions/​setup/​js/​otel_attributes_generated.cjs Updates generated JavaScript attribute constants.
actions/​setup/​js/​model_costs.cjs Adds shared cache-inclusive token normalization.
actions/​setup/​js/​fixtures/​otel_legacy_contract.json Stores compatibility snapshot counts and hashes.
actions/​setup/​js/​conformance/​genai/​conformance.yaml Defines success, failure, and compatibility scenarios.
actions/​setup/​js/​conformance/​genai/​agent-run.cjs Generates telemetry for conformance scenarios.
actions/​setup/​js/​check_admission.cjs Supplies workflow context for admission resources.
.github/​workflows/​cjs.yml Adds an isolated GenAI conformance CI job.
.github/​aw/​otel.md Updates telemetry guidance and known implementation gaps.
.changeset/​minor-genai-semconv.md Announces the additive signals and experimental opt-in.

Review effort: Max (adaptive)

Comment thread .github/workflows/cjs.yml Resolved
Comment thread .github/workflows/cjs.yml Resolved
Comment thread actions/setup/js/model_costs.cjs Resolved
Comment thread actions/setup/js/send_otlp_span.cjs Resolved
Comment thread actions/setup/js/send_otlp_span.cjs Resolved
Comment thread actions/setup/js/send_otlp_span.cjs Resolved
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check GenAI semantic-convention conformance (FAILURE): Check run.
  3. Fix failing check OTLP protobuf SDK compatibility (FAILURE): Check run.
  4. Fix failing check Unit tests (N-R) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "895e205c0322d3d9c6402399f85560fc4df777c8",
  "kind": "requested",
  "schema_version": "1",
  "state": "5e4ca4dfa4774ea6f1dbefd0f09eb5cba4cda852461b26043d5e919890a58b9b",
  "work": [
    "1d69b8d4592eabee9d06f3768307b2b1f8e914d20ba295c7aaad4c09d30f7a36",
    "581146d0668351b73477c303f681964eb04e184e2ef09d5bec01b1c1d1a194eb",
    "e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 4 commits November 19, 2026 00:18
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Copilot stopped work on behalf of gh-aw-bot due to an error November 19, 2026 01:10
Copilot AI requested a review from gh-aw-bot November 19, 2026 01:10
@pelikhan pelikhan changed the title [WIP] Align the OTel spec and runtime with OpenTelemetry semantic-conventions-genai Align OpenTelemetry GenAI telemetry with current semantic conventions Nov 19, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot fix ci failures

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check build (FAILURE): Check run.
  3. Fix failing check GenAI semantic-convention conformance (FAILURE): Check run.
  4. Fix failing check JS Tests (shard 5/8) (FAILURE): Check run.
  5. Fix failing check Unit tests (H-M) (FAILURE): Check run.
  6. Fix failing check Unit tests (N-R) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "904316a8a793e678bd9f6792aac0e8db56b768c2",
  "kind": "requested",
  "schema_version": "1",
  "state": "dacf11f5fdd2fdadde88d621b2459f0e92f1577c91cef7d844647fbf501b60e7",
  "work": [
    "0215fa6a7e95d212b943e1dcdbb6a5dd7a082cda1dd71a971263c5c8122eb0a6",
    "581146d0668351b73477c303f681964eb04e184e2ef09d5bec01b1c1d1a194eb",
    "78cff96338665a216aed174395db53962090e0167d19046c48b8353c0696ba8f",
    "e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f",
    "f7883e8c8105930e955354caa741d783bcca067e66097fe9612fb72b90823998"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~4 AIC · ⊞ 7K · ◷
Comment /souschef to run again

pelikhan and others added 2 commits November 19, 2026 03:36
Keep recognizable test suites discoverable and update conformance paths without changing validation behavior.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
pelikhan and others added 4 commits November 19, 2026 04:12
Resolve the smoke monitor description using the upstream read-only wording and regenerate workflow artifacts.

Co-authored-by: Copilot App <[email protected]>
Propagate inferred agent errors to GenAI spans and duration metrics, and isolate legacy golden mirror mocks from host filesystem state.

Co-authored-by: Copilot App <[email protected]>
Preserve the pinned GenAI model and advice while registering shipped extensions and resolving core definitions locally. Exercise accepted mixed telemetry and rejected mutations with the actual pinned Weaver. Narrow compatibility exceptions and independently reject unregistered compatibility metrics.

Co-authored-by: Copilot App <[email protected]>
}},
]

def check(self, samples):
@pelikhan
pelikhan merged commit 097f67b into main Nov 19, 2026
13 checks passed
@pelikhan
pelikhan deleted the copilot/align-otel-spec-runtime branch November 19, 2026 13:10
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.

Observability: align the OTel spec and runtime with OpenTelemetry semantic-conventions-genai (provider, invoke_agent, token and agent metrics)

4 participants