Console

Traces guide

Group model calls with session_id, run_id, user_id, and user_name in X-Shieldon-Metadata, and inspect execution trees, timelines, and on-demand payloads.

What is Traces?

Workspace → Traces groups multiple model calls that belong to the same Agent or workflow execution (run_id) and multi-turn conversation (session_id), so you can inspect latency, retries/fallbacks, token usage, Credits, and captured input/output in one view.

Data hierarchy:

session_id (multi-turn conversation or session)
└── run_id (single Agent or workflow execution)
    └── Model request (Chat Completions / Responses / Embeddings, etc.)
        └── _shieldon.lifecycle spans (routing, guardrails, attempts, retry/fallback)

Traces is an aggregate query view built on recorded model calls and system Metadata. It does not infer unrecorded business steps, external tool calls, or business completion state. Calls without a run_id remain in Request logs.

Get started in 3 steps

  1. Publish a Release with system Metadata fields: Every Gateway API key includes built-in session_id, run_id, user_id, and user_name fields once published. No manual variable creation is needed; optionally mark fields as required under API Keys → Manage Metadata.
  2. Send X-Shieldon-Metadata on Gateway requests: Reuse the same run_id across model calls within one execution, and the same session_id across executions in one conversation.
  3. Inspect in the console: Open Workspace → Traces. Rows are grouped by session_id by default—click a session row to expand its run_id rows in place, then click any run_id to open the split-pane inspector.

Request examples

Set SHIELDON_GATEWAY_BASE_URL (including /v1) and SHIELDON_GATEWAY_API_KEY, and replace the model with an ID returned by GET /v1/models. Other protocols (such as Anthropic Messages and OpenAI Responses) also accept X-Shieldon-Metadata.

curl "$SHIELDON_GATEWAY_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $SHIELDON_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H 'X-Shieldon-Metadata: {"session_id":"sess_checkout_01","run_id":"run_step_01","user_id":"cust_1042","user_name":"Alice"}' \
  -d '{
    "model": "@your-integration/your-model",
    "messages": [
      { "role": "user", "content": "Summarize today'\''s order anomalies." }
    ]
  }'

System Metadata fields

FieldPurposeGrouping & filteringRules & boundaries
run_idIdentifies one Agent or workflow executionRequired for Traces; exact filter and run_id viewNon-empty string, max 128 chars; internal retries/fallbacks do not create new Runs
session_idIdentifies a multi-run conversationDefault view groups by session_id; exact filterOptional; never send auth tokens or secrets
user_idStable business end-user identifierExact filterAttribution only; distinct from Shieldon login identity
user_nameDisplay name at request timeDisplay only in table and details; not filterableNever used for identity merging or guessed on conflicts
  • Strict isolation: Organization, Workspace, and Gateway API key define the isolation boundary. Identical session_id or run_id values under different Workspaces or API keys are never merged.
  • Validation: Values must be non-blank strings without control characters and cannot have static defaults configured on a key.

Inspecting Traces in the console

Traces list

  • View switcher: Grouped by session_id by default; click a row to expand its run_id items in place, or switch to run_id view to list Runs directly.
  • Filters: Filter by session_id, run_id, user_id, API key, and date range (24h, 7d, 30d, or custom range). Clicking a user_id or session_id cell applies that filter immediately.
  • Aggregation semantics: Request counts, failures/cancellations, known tokens, and Credits are aggregated across all matching requests in the selected time range—independent of pagination. The observed time range reflects the earliest start to latest completion, not business task completion.

Split-pane detail inspector

  • Left tree & timeline: Select the top Run root for a Run summary and loaded request table, or expand any request to inspect _shieldon.lifecycle spans. Supports Tree / Timeline toggle, search filtering, expand/collapse all, resizable split, and ↑ / ↓ keyboard navigation.
  • Right inspector: Shows observation overview, routing/guardrail diagnostics, Metadata (Table / JSON), and on-demand Input / Output (Formatted / JSON).
  • Content permissions & audit: Input and output payloads follow Workspace capture settings and encrypted storage rules. Content is fetched only when an authorized administrator clicks Load content, generating an immutable audit event.

Troubleshooting

  • Sent requests do not appear in Traces:
    1. Ensure X-Shieldon-Metadata includes a non-empty run_id (requests with only session_id remain in Request logs).
    2. Verify the selected date range (defaults to 7d) and API Key filter match the request.
    3. Confirm the Workspace has an active Release published with system Metadata support.
  • Conflicting attribution: Multiple distinct session_id or user_id values appeared inside the same run_id, or multiple user_id values appeared within one session_id. Runs with conflicting session_id attribution stay separate to avoid double counting.
  • Incomplete usage / Unpriced requests: Missing upstream token counts are never treated as zero; calls without effective published Credit rates are marked unpriced rather than free.

Next steps