Skip to content

docs: add governed action span metadata example - #4391

Open
jw-ond wants to merge 3 commits into
traceloop:mainfrom
jw-ond:osuite/governed-action-span-attributes-clean
Open

docs: add governed action span metadata example#4391
jw-ond wants to merge 3 commits into
traceloop:mainfrom
jw-ond:osuite/governed-action-span-attributes-clean

Conversation

@jw-ond

@jw-ond jw-ond commented Jul 31, 2026

Copy link
Copy Markdown

What

Adds a small sample showing how an agent runtime can attach governed action metadata to an OpenTelemetry span using application-owned app.governance.* attributes.

The sample includes an action reference, action hash, verdict, approval status, proof URL, and external verifier reference. It configures a console span processor so the sample can emit spans locally without requiring a Traceloop API key.

Why

Agent actions often need to connect runtime execution traces to a separately reviewed or approved action. This keeps that linkage in normal OpenTelemetry span data without occupying the gen_ai.* semantic-convention namespace.

Validation

  • python3 -m py_compile packages/sample-app/sample_app/governed_action_span_attributes.py
  • git diff --check origin/main..HEAD
  • verified the changed files do not use gen_ai.agent.action.* custom keys, instruments={}, or product-specific branding

Note

This replaces #4390 with commits authored from the GitHub-linked account email so the CLA check can evaluate normally.

Summary by CodeRabbit

  • New Features

    • Added a sample application demonstrating governed agent action metadata.
    • Added an agent.action tracing example with governance attributes in the app.governance.* namespace.
    • Added console output showing the recorded span and confirmation while the action runs.
  • Documentation

    • Added README guidance covering the example, governance attributes, and namespace.

@CLAassistant

CLAassistant commented Jul 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 536e7c4a-9eed-49be-b514-d4e207313740

📥 Commits

Reviewing files that changed from the base of the PR and between 0210b89 and 6e7ced1.

📒 Files selected for processing (1)
  • packages/sample-app/sample_app/governed_action_span_attributes.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/sample-app/sample_app/governed_action_span_attributes.py

📝 Walkthrough

Walkthrough

The sample app adds a governed-action tracing example. It records governance metadata on an agent.action span and documents the app.governance.* namespace.

Changes

Governed action tracing

Layer / File(s) Summary
Governed action metadata example
packages/sample-app/sample_app/governed_action_span_attributes.py, packages/sample-app/README.md
The sample defines governance attributes, configures synchronous console span export, records metadata on an agent.action span, and documents the attribute namespace and usage.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the governed action span metadata example added by the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants