Skip to content

feat: support filtering spans by project within a trace #737

@betegon

Description

@betegon

Description

When investigating cross-project traces, there is no way to filter spans by project. The trace view returns all spans from all projects, and you have to manually parse the JSON to find spans from a specific service.

Context

Trace: e998143883414695ad5600a058581fcb
UI: https://sentry.sentry.io/explore/traces/trace/e998143883414695ad5600a058581fcb/

This trace spans cli, cli-server, sentry, and release-registry (463 spans). Most spans were Sentry internal DB queries — the interesting ones were the ~20 cli-server workflow steps. Had to write a Python script to walk the JSON tree and filter by project_slug == "cli-server".

Proposed solution

Support a --project filter on trace/span commands:

sentry trace view <trace-id> --project cli-server --json
sentry span list <trace-id> --project cli-server

Or at minimum, a --fields project_slug on span list so the project is visible and filterable with jq.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    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