Skip to content

Extract PR URLs from tool responses as a dedicated attribute #93

@GuyMoses

Description

@GuyMoses

Problem

When a user creates a PR via Claude Code (e.g., gh pr create), the PR URL is only available in the tool_response field which is redacted when OMIT_IO=true (default).

Claude Code surfaces PR links in its native UI, but this data isn't available in our telemetry.

Proposed solution

In PostToolUse event handling, scan tool_response for GitHub/GitLab PR URL patterns (e.g., github.com/.../pull/\d+) and emit them as a dedicated span attribute (vcs.pull_request.url) regardless of OMIT_IO setting.

This keeps PR metadata visible for observability without exposing other tool I/O content.

Considerations

  • Should work with GitHub, GitLab, Bitbucket URL patterns
  • Multiple PRs in a session could be collected as an array attribute
  • Could also extract PR number and repo name as separate attributes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions