Attribute guardrail blocks in telemetry for /v1/responses and /v1/embeddings (Blocked tab under-counts)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 157
- Forks
- 32
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 145
Description
Summary
/v1/chat/completions threads applied_guardrails and sets guardrail_blocked=true on the UsageEvent so the dashboard's Blocked tab reflects guardrail blocks. /v1/responses and /v1/embeddings (input guardrails added in #541) emit only a generic zero-token error event (error_class=content_filter) on a block — no guardrail_blocked flag and no applied_guardrails set.
Impact
Low (observability only): the dashboard Blocked tab and applied-guardrail analytics under-count guardrail blocks on the non-chat surfaces. The embeddings handler already documents that bypass-telemetry plumbing for non-chat handlers is deferred.
Fix
Thread applied_guardrails + a guardrail_blocked signal through the responses/embeddings dispatch return + emit paths, mirroring chat.rs.
Surfaced by the independent audit of #541. Refs #719.
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
Start with chat.rs to trace how applied_guardrails and guardrail_blocked reach UsageEvent, then follow the /v1/responses and /v1/embeddings dispatch return and emit paths. Confirm how input-guardrail blocks currently produce the zero-token content_filter event. Done means both non-chat surfaces record the applied guardrails and guardrail_blocked signal so the dashboard Blocked tab and guardrail analytics include those blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100