docs(iorails): Telemetry - content capture docs#1984
Conversation
Documentation preview |
📝 WalkthroughWalkthroughThis PR adds comprehensive documentation for the Content Capture feature in guardrails tracing. It introduces a new dedicated guide, documents configuration options with defaults, updates existing configuration reference examples, and adds navigation links to integrate the new documentation into the tracing guides. ChangesContent Capture Tracing Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/observability/tracing/content-capture.md`:
- Around line 121-122: The sentence implying spans can be correlated "by name
alone" is misleading; update the line referencing `gen_ai.*` attributes and
event names to state that names are insufficient for correlation and that
backends should use trace/span context (trace_id/span_id or propagated context)
to link the outer request span with inner LLM spans, while noting shared
attributes/events can assist but must not be relied on as the primary
correlation mechanism.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e5cadf72-82a8-43f6-9b5a-724e1ea0087d
📒 Files selected for processing (4)
docs/configure-rails/configuration-reference.mddocs/configure-rails/yaml-schema/tracing-configuration.mddocs/observability/tracing/content-capture.mddocs/observability/tracing/index.md
|
@greptile-apps Review this PR |
Greptile SummaryThis docs-only PR adds a new
|
| Filename | Overview |
|---|---|
| docs/observability/tracing/content-capture.md | New how-to page documenting content-capture: env-var override, dual output formats (JSON attributes vs legacy events), per-span capture locations, streaming behaviour, and engine support matrix. Well-structured with appropriate IORails-only scope notes and privacy warnings. |
| docs/configure-rails/yaml-schema/tracing-configuration.md | Adds span_format and enable_content_capture rows to the options table and a clarifying note below the Trace Information table; the LLM Calls row still says 'prompts, and responses' which contradicts the new default-metadata-only note. |
| docs/configure-rails/configuration-reference.md | Adds an inline PII comment to the enable_content_capture example and a cross-reference link to the new content-capture page. Change is accurate and unambiguous. |
| docs/observability/tracing/index.md | Updates the Data Privacy risk bullet to point to content-capture.md and adds the new page to the related-links and toctree. Clean, accurate updates. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Guardrails Request] --> B{enable_content_capture?}
B -- "false (default)" --> C[Metadata only\ntiming, token counts, finish reasons]
B -- true --> D{OTEL_INSTRUMENTATION_GENAI\n_CAPTURE_MESSAGE_CONTENT}
D -- "false / 0" --> C
D -- "true / 1 or unset" --> E{OTEL_SEMCONV_STABILITY\n_OPT_IN contains\ngen_ai_latest_experimental?}
E -- Yes --> F[JSON Span Attributes\ngen_ai.input.messages\ngen_ai.output.messages\ngen_ai.system_instructions]
E -- No/unset --> G[Legacy Span Events\ngen_ai.system.message\ngen_ai.user.message\ngen_ai.choice ...]
F --> H[guardrails.request span\nguardrails.rail span\ngen_ai LLM spans]
G --> H
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
docs/configure-rails/yaml-schema/tracing-configuration.md:120
The "LLM Calls" table row says it captures "prompts, and responses," but the note added directly below the table says that, by default, "traces capture only metadata" and "Prompt and response content is recorded only when content capture is enabled." A reader who scans the table but not the note will incorrectly believe prompts and responses are always recorded. The row should be updated to describe what is *always* captured (invocation metadata), leaving the prompt/response detail to the note below.
```suggestion
| **LLM Calls** | LLM invocations and performance metadata (token counts, latency, model) |
```
Reviews (7): Last reviewed commit: "Update docs to reflect final merged stat..." | Re-trigger Greptile
This comment was marked as outdated.
This comment was marked as outdated.
c11aa12 to
0abc773
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| | `span_format` | Span structure used by the LLMRails adapter: `opentelemetry` or `legacy` | `opentelemetry` | | ||
| | `enable_content_capture` | Record prompts and responses on spans. Captures potentially sensitive data (PII); see [](../../observability/tracing/content-capture.md) for full behavior and engine-specific differences | `false` | |
There was a problem hiding this comment.
is this really necessary? it is a field and we briefly mention what it does. We can refer users go GenAI SemConv to understand the risk etc. IMO, the two other changes are sufficient.
Also IORails deserves to be discoverable! Right now the docs are kind of mixed, sometimes we are talking about IORails, sometimes LLMRails, sometimes both... I think we should do something about it.
b088f8d to
20c274f
Compare
PR merge guidance@tgasser-nv thanks for the PR. GitHub is currently blocking merge for one or more repository requirements:
Relevant guide: |
Description
Stacked PR On top of #1972 .
Doc updates for the tracing content-capture feature.
Related Issue(s)
#1972 - Code changes to implement content-capture in tracing
Checklist