You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 097f67b
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Align OpenTelemetry GenAI telemetry with current semantic conventions (#79090)
* Initial plan
* Align OTel GenAI specification and registry
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Add opt-in GenAI OTel runtime support
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Add GenAI OTel conformance coverage and docs
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Clarify GenAI spec attribute requirements
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Fix OTel compatibility checks
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Stabilize OTel compatibility golden test
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Address OTel review findings
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Isolate OTel tests from shared temp artifacts
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Track main merge and CI repair plan
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Fix OTel conformance and test failures
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Satisfy Go linters for rollout parsing
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Move GenAI conformance helpers under fixtures
Keep recognizable test suites discoverable and update conformance paths without changing validation behavior.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Fix current CI regressions
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Clarify deprecated GenAI telemetry migration
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Name GenAI opt-in gen_ai_v1 and preserve failure attribution
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 <223556219+Copilot@users.noreply.github.com>
* Compose typed telemetry registries for GenAI conformance
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 <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/aw/otel.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Resource attributes identify the service and workflow run, for example `service.
21
21
| Family | Examples |
22
22
|---|---|
23
23
| Workflow identity and outcome |`gh-aw.workflow.name`, `gh-aw.job.name`, `gh-aw.run.status`, `gh-aw.agent.conclusion`|
24
-
| Model usage |`gen_ai.system`, `gen_ai.request.model`, `gen_ai.response.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`|
24
+
| Model usage |`gen_ai.provider.name`, `gen_ai.agent.name`, `gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.response.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`|
25
25
| Cost and budget |`gh-aw.aic`, `gh-aw.max_ai_credits`, `gh-aw.max_ai_credits_exceeded`|
26
26
| Failures and export health |`gh-aw.error_count`, `exception`, `gh-aw.otlp.export_errors`|
27
27
| Routing, firewall, and tools |`gh-aw.model_routing.*`, `gh-aw.firewall.*`, `gh-aw.mcp.*`|
@@ -75,7 +75,7 @@ Choose the owning span first, then the attribute. Missing attributes mean unknow
75
75
|---|---|---|
76
76
| Agent latency | Span duration of `gh-aw.<job>.agent`| Dedicated agent span, when `agent_cli_start_ms` and `agent_output.json` timing allow it |
77
77
| Job wall time |`gh-aw.action_minutes` (minutes) | Conclusion span; computed as `(end - start) / 60000`|
78
-
| Tokens |`gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.cache_read.input_tokens`, `gen_ai.usage.cache_creation.input_tokens`, `gen_ai.usage.total_tokens`| Dedicated agent span; otherwise the conclusion span of the job that owns usage. `total_tokens` is input plus output only|
78
+
| Tokens |`gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.cache_read.input_tokens`, `gen_ai.usage.cache_write.input_tokens`| Dedicated agent span; otherwise the conclusion span of the job that owns usage. Compatibility mode also emits `gen_ai.usage.cache_creation.input_tokens` and `gen_ai.usage.total_tokens`|
79
79
| AI credits |`gh-aw.aic` (double) | Usage-owning span only; explicit zero is measured, absence is unknown |
| Attribute names | 200 names |`specs/otel/attributes.tsp`, generated into `actions/setup/js/otel_attributes_generated.cjs` and `pkg/workflow/otel_attributes_generated.go`| Identity |
114
114
115
-
No OTel metric emitter exists in `actions/`, `pkg/`, `cmd/`, or `scripts/`.
115
+
The JavaScript runtime emits `gh_aw.*` metrics and GenAI token counters when metrics are enabled; metric names and compatibility behavior are described in the public OpenTelemetry reference.
116
116
117
117
## Discrepancies with the specification
118
118
119
119
These describe current behavior. They do not change the normative specification.
120
120
121
-
-**Metrics (spec §11.2–11.3):**`gh_aw.*` and `cicd.*` metric instruments are not emitted. Treat all measurements as span attributes or events.
122
-
-**Span error type (spec §10.5):** The bare `error.type` key is not emitted. Work-queue spans use the prefixed `gh-aw.work_queue.error.type`. Built-in setup, conclusion, and agent spans use `status.code` and `exception` events.
121
+
-**Span error type (spec §10.5):** Built-in agent and agent-conclusion spans emit the low-cardinality `error.type` on failure, timeout, or cancellation. Work-queue spans use the prefixed `gh-aw.work_queue.error.type`.
123
122
-**Lifecycle events (spec §10.6):**`gh_aw.job.setup.completed`, `gh_aw.agent.retry`, and related events are not emitted.
124
123
-**Outcome spans (spec §13):** The `gh-aw.outcome.*` family appears in the public attribute reference and the spec, but no producer exists in this checkout. The corresponding formal tests in `pkg/workflow/otel_reliability_formal_test.go` are skipped.
125
-
-**Aliases not emitted:**`gen_ai.provider.name`, `gen_ai.usage.reasoning.output_tokens`, and `cicd.*` aliases are not emitted.
124
+
-**Aliases not emitted:**`gen_ai.usage.reasoning.output_tokens` is not emitted.
126
125
-**Local mirror redaction (spec §14.3):** Span payloads from `sendJobSetupSpan`, `sendJobConclusionSpan` (agent and conclusion), and their mirror writes call `appendToOTLPJSONL(payload)` without `sanitizeOTLPPayload`. The wire export (`sendOTLPSpan`) and `logSpan` do sanitize. Source-observed; not confirmed by a runtime test.
127
126
-**Validation status:**`specs/otel/attributes.tsp` already defines 200 attribute names, and they match the generated JavaScript and Go constants (verified by comparison). The TypeSpec compiler is not installed (`specs/otel/node_modules` is absent) and no lock installation is performed in this run. Compiler validation of `specs/otel/messages.tsp` is therefore deferred, and no TypeSpec file was created or changed.
0 commit comments