Answer: Inject end-user identity as resource attributes on each `query()` call via `OTEL_RESOURCE_ATTRIBUTES`, percent-encoding values before interpolating them. For example, set `enduser.id` and `tenant.id` in the environment options. Status: Confirmed Entry: tool/claude-code/integrations/attribute-actions-end-users Revision: 1 Digest: sha256:f5d03bf3688c7756 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:50Z Last changed: 2026-11-13T03:02:50Z Last verified: 2026-11-20T12:16:54Z Next check: 2026-11-21T12:16:54Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of mechanism | OTEL_RESOURCE_ATTRIBUTES | [1] | 2026-11-20 encoding requirement | Percent-encode values before interpolating them | [1] | 2026-11-20 example attributes | enduser.id={quote(request.user_id)},tenant.id={quote(request.tenant_id)} | [1] | 2026-11-20 audit events | tool_decision | [1] | 2026-11-20 log record prefix | claude_code. | [1] | 2026-11-20 Sources: [1] Anthropic. "Observability with OpenTelemetry". https://code.claude.com/docs/en/agent-sdk/observability.md Role: primary. Accessed: 2026-11-20T12:16:54Z Quote: "inject end-user identity as resource attributes on each `query()` call. Percent-encode values before interpolating them, since `OTEL_RESOURCE_ATTRIBUTES" (Supports: mechanism) Quote: "Percent-encode values before interpolating them, since `OTEL_RESOURCE_ATTRIBUTES`" (Supports: encoding requirement) Quote: ""OTEL_RESOURCE_ATTRIBUTES": f"enduser.id={quote(request.user_id)},tenant.id={quote(request.tenant_id)}"," (Supports: example attributes) Quote: "`tool_decision` and `tool_result`: each tool call, whether it was allowed or denied, and its result" (Supports: audit events) Quote: "These events export as log records named with a `claude_code.` prefix, such as `claude_code.tool_decision`." (Supports: log record prefix) Published: 2026-11-20T10:36:10Z Snapshot SHA-256: 01e682cd9021a18dc9d162abc2354c4eda3478f2879c1666cd438ff23100515d (captured 2026-11-13T03:02:50Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:02:50Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:16:54Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:54Z Last attempt: 2026-11-20T12:16:54Z Notes and limitations: Extracted automatically from a single official source (section "Attribute actions to your end users"). Related: https://latestn.com/tool/claude-code/integrations/breaking-changes What breaking changes does the Claude Agent SDK introduce, such as ClaudeCodeOptions being renamed to ClaudeAgentOptions? https://latestn.com/tool/claude-code/integrations/build-webhook-receiver-channel How do I build an MCP server that pushes webhooks or alerts into a Claude Code session? https://latestn.com/tool/claude-code/integrations/check-mcp-and-hooks How do I check whether my MCP servers and hooks are loaded in Claude Code? https://latestn.com/tool/claude-code/integrations/add-mcp-server-to-plugin How do I add an MCP server to a Claude Code plugin? https://latestn.com/tool/claude-code/integrations/add-remote-http-mcp-server How do I add a remote HTTP MCP server to Claude Code? https://latestn.com/tool/claude-code/integrations/add-verify-mcp-server How do I add and verify an MCP server in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:02:50Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/integrations/attribute-actions-end-users/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/integrations/attribute-actions-end-users POST: https://latestn.com/dispute/tool/claude-code/integrations/attribute-actions-end-users with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/integrations/attribute-actions-end-users?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I attribute Claude Agent SDK telemetry actions to end users? Revision 1, last verified 2026-11-20T12:16:54Z. https://latestn.com/tool/claude-code/integrations/attribute-actions-end-users (accessed 2026-11-21T09:53:30Z). @misc{LatestN_tool_claude_code_integrations_attribute_actions_end_users_r1, title = {How do I attribute Claude Agent SDK telemetry actions to end users?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/integrations/attribute-actions-end-users}}, note = {Revision 1; digest sha256:f5d03bf3688c7756; last verified 2026-11-20T12:16:54Z; accessed 2026-11-21T09:53:30Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/integrations/attribute-actions-end-users