Repository navigation
Add model observation inference attributes - #261
Pujarini Mohapatra (biswapm) merged 5 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Multiword operation names become unrecognized and are dropped by the exporter; late-recording tests and the changelog also need completion.
3 open findings
What changed in this PR
Adds model-observation attributes to manual inference telemetry.
Changes:
- Records response models and cache token counts.
- Normalizes inference operation names.
- Adds semantic-convention constants and focused tests.
| File | Description |
|---|---|
src/a365/contracts.ts |
Extends inference details with response fields. |
src/a365/scopes/InferenceScope.ts |
Emits new attributes and adds late-recording methods. |
src/genai/semconv.ts |
Defines cache token attribute constants. |
test/internal/unit/a365/scopes.test.ts |
Tests new inference attributes and methods. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the two missing canonical operation values to the baggage enrichment allowlist documentation so it matches GEN_AI_OPERATION_NAMES. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Fixed in ae0c7c6: added \ ext_completion\ and \generate_content\ to the documented baggage-enrichment allowlist in A365_DOCUMENTATION.md so it matches \GEN_AI_OPERATION_NAMES. |
Nikhil Navakiran (nikhilNava)
left a comment
There was a problem hiding this comment.
Two points on operation-name normalization: handling unmapped runtime strings without silently dropping spans, and using the canonical operation in the span name as well as its attribute.
Accept canonical inference strings alongside enum values and resolve the operation once for both the attribute and span name. Cover all supported inputs through scope creation and export partitioning, and document the behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



Summary
Adds the privacy-safe OpenTelemetry attributes required by the Model Observation pipeline.
gen_ai.response.modelwhen the provider returns the canonical served model.gen_ai.usage.cache_read.input_tokens.gen_ai.usage.cache_write.input_tokens.gen_ai.operation.namevalue to lowercase OTel values, includingchat.server.addressand an optional numericserver.port.Validation
The repository’s targeted inference tests, build, formatting, and linting checks pass.