Add OpenTelemetry trace correlation across gateway activity
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Problem Statement
OpenShell documents OCSF JSON export for SIEM-style events, but a multi-step agent action still needs distributed trace context so operators can see one tree across invocation, tool call, policy decision, broker token acquisition, downstream request, and response. Compliance mapping to EU AI Act Annex IV and NIST AI RMF should be a follow-up documentation issue; this issue stays focused on OTel trace emission and correlation identifiers.
Proposed Design
- Emit OTel spans for agent invocation, tool call, policy decision, sandbox lifecycle, credential-broker actions, downstream request, and response.
- Carry stable correlation fields on every span:
agent_id,session_id,user_principalwhere applicable,tool_name,binary_path,binary_sha256where available,policy_decision,policy_rule_matched, resource/host, and outcome. - Preserve OCSF JSON export and align OCSF event correlation IDs with OTel trace/span identifiers where practical.
- Document a minimal collector setup for Tempo or Jaeger.
Acceptance criteria:
- A multi-step agent action appears as a single trace tree from invocation through downstream response.
-
agent_idandsession_idcorrelate consistently across OCSF events and OTel spans. - Trace emission can be enabled without disabling existing OCSF JSON export.
- A reference deployment exports traces to a stock OTel collector and at least one common backend such as Tempo or Jaeger.
Alternatives Considered
- Keep only OCSF logs: useful for SIEM, but weaker for reconstructing multi-hop execution paths.
- Rely on downstream service traces only: misses gateway policy and sandbox lifecycle decisions.
- Add compliance reporting first: useful, but depends on stable event and trace identifiers.
Agent Investigation
- OCSF JSON export exists and should continue unchanged.
- The Providers v2 Roadmap explicitly lists "Refresh telemetry as OCSF events" as future work — refresh logs today are secret-safe gateway logs only.
- Current public docs do not describe OTel trace export with consistent
agent_id/session_idcorrelation across gateway activity.
References:
- OpenShell OCSF JSON export: https://docs.nvidia.com/openshell/observability/ocsf-json-export
- OpenShell Providers v2 (Roadmap): https://docs.nvidia.com/openshell/sandboxes/providers-v2
- OpenTelemetry semantic conventions: https://opentelemetry.io/docs/specs/semconv/
- EU AI Act (for follow-up mapping issue): https://eur-lex.europa.eu/eli/reg/2024/1689/oj
- NIST AI RMF (for follow-up mapping issue): https://www.nist.gov/itl/ai-risk-management-framework
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by reading the existing OCSF JSON export and tracing the gateway activity paths described in the issue, then compare the proposed identifiers with OpenTelemetry semantic conventions. Done means a multi-step action forms one trace tree, preserves OCSF export, correlates agent_id and session_id, and reaches a stock collector and a listed backend.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, distributed-systems, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100