Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

sentry logs: add --trace / --trace-id filter flag #317

Closed

Description

@sentry-junior

Summary

Users should be able to filter logs by trace ID directly from the CLI via sentry logs --trace <id> (or --trace-id <id>). Currently navigating from a trace to its associated logs requires going through the UI or running a separate query manually.

Analysis

  • Current behavior: sentry logs does not accept a trace ID filter flag.
  • Gap: trace-centric workflows are common; users often start from a trace and want to inspect associated logs without leaving the CLI.
  • Direction: add --trace / --trace-id flag to sentry logs that scopes the query to the given trace ID; also consider sentry trace logs <id> as a subcommand alias for discoverability.

Concerns

  • Decide on flag name consistency: --trace vs --trace-id — pick one canonical form and alias the other.

Activity

  1. sentry-junior commented on Mar 2, 2026

    @sentry-junior
    ContributorAuthor

    PR #311 (feat(trace): add sentry trace logs subcommand) covers related ground — cross-linking for tracking.

    What #311 implements

    • New sentry trace logs <trace-id> subcommand (not a flag on sentry logs)
    • Uses /organizations/{org}/trace-logs/ endpoint — org-scoped, queries all projects automatically
    • Flags: --period, --limit, --query, --web, --json
    • Input forms: <trace-id>, <org> <trace-id>, <org>/<trace-id>

    Gap analysis vs. this issue

    Aspect #311 (PR) This issue (#317)
    Entry point sentry trace logs <id> subcommand sentry logs --trace <id> flag
    Discoverability Requires knowing trace subcommand exists Natural extension of sentry logs workflow
    API endpoint /trace-logs/ (trace-correlated) Likely Explore/Events logs API with trace: filter
    Flag --trace on sentry logs ❌ Not implemented ✅ This issue's core ask

    Recommendation

    #311 is NOT a full resolution of this issue. The two are complementary:

    Consider closing this issue as "covered" only if sentry trace logs is deemed sufficient UX and sentry logs --trace is intentionally skipped. Otherwise, both should land.

  2. added a commit that references this issue on Mar 5, 2026
    f7933f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions