Repository navigation
Align OpenTelemetry GenAI telemetry with current semantic conventions - #79090
Conversation
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 keep working on spec |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Clarified the §10.3 GenAI attribute requirements to match §9.5’s opt-in span-shape rules in commit |
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
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. |
|
@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]>
|
@copilot resolve the merge conflicts on this branch. |
Merged |
There was a problem hiding this comment.
🟡 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
Check out the conformance harness inside the workspace · New Assert schema URLs and span kinds using OTLP wire fields · New Verify Weaver against a pinned SHA-256 digest · New Clamp inclusive input totals to match the pricing calculation · New Preserve explicit inclusive input totals with incomplete cache details · New Recursively inspect Weaver advice and test nested findings · New Use GITHUB_WORKFLOW for the pipeline resource name · New Do not infer input tokens from an incomplete cache breakdown · New Classify agent failures from the computed error status · New Test opt-in exports preserve GitHub and gh-aw attributes · New Remove duplicated metric documentation · New
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)
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
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"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ec-runtime 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 fix ci failures |
…ec-runtime Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
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"
}
|
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]>
Co-authored-by: Copilot App <[email protected]>
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): |



Summary
Align the OTel specification, attribute registry, runtime, and documentation with OpenTelemetry's GenAI semantic conventions while preserving existing telemetry by default.
gen_ai.client.inference.usage.*token counters andgen_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.error.typevalues for failed, timed-out, and cancelled agent invocations.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_experimentalto useinvoke_agentINTERNAL spans, leave successful statuses UNSET, adopt cache-inclusive input-token semantics, and omit superseded compatibility-only names.The
gh-aw.*attributes andgh_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