Skip to content

Conversation

@trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:

This commit adds tracIDs to the sampled queries captured by Goldfish, and adds links to explore in the UI for both the traces and logs (via traceId line filter). It also refactors the duplicate database logic between the quertee and UI into a new, shared, goldfish package.

Key features added:

  • Capture and store trace IDs from both query cells (cell A and cell B)
  • Generate Grafana Explore links for traces when Tempo datasource is configured
  • Generate Grafana Explore links for logs when Loki datasource is configured
  • Display trace IDs in the UI with clickable links to explore
  • Add namespace configuration for cell-specific log queries

Database refactoring:

  • Extract shared goldfish storage logic from tools/querytee into pkg/goldfish
  • Create unified Storage interface used by both querytee and UI
  • Move database migrations to shared pkg/goldfish/migrations
  • Consolidate MySQL storage implementations (CloudSQL, RDS) into single implementation
  • Add performance optimization indexes for query retrieval

Database schema changes:

  • Add cell_a_trace_id and cell_b_trace_id columns to sampled_queries table
  • Add performance indexes for faster query filtering and pagination
  • Migration 20250729000002 adds trace ID columns
  • Migration 20250805000001 adds performance indexes

Frontend improvements:

  • Display trace IDs in query diff view with visual indicators
  • Show clickable links when explore configuration is available
  • Add namespace labels to cell headers when configured
  • Update TypeScript types to include trace ID fields

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

trevorwhitney and others added 2 commits August 1, 2025 11:38
This commit adds comprehensive trace ID tracking and visualization to the
goldfish query comparison tool, along with major architectural refactoring.

Key features added:
- Capture and store trace IDs from both query cells (cell A and cell B)
- Generate Grafana Explore links for traces when Tempo datasource is configured
- Generate Grafana Explore links for logs when Loki datasource is configured
- Display trace IDs in the UI with clickable links to explore
- Add namespace configuration for cell-specific log queries

Major refactoring:
- Extract shared goldfish storage logic from tools/querytee into pkg/goldfish
- Create unified Storage interface used by both querytee and UI
- Move database migrations to shared pkg/goldfish/migrations
- Consolidate MySQL storage implementations (CloudSQL, RDS) into single implementation
- Add performance optimization indexes for query retrieval

Database schema changes:
- Add cell_a_trace_id and cell_b_trace_id columns to sampled_queries table
- Add performance indexes for faster query filtering and pagination
- Migration 20250729000002 adds trace ID columns
- Migration 20250805000001 adds performance indexes

Configuration additions:
- GOLDFISH_GRAFANA_URL: Base URL for Grafana instance
- GOLDFISH_TRACES_DATASOURCE_UID: Tempo datasource UID for trace exploration
- GOLDFISH_LOGS_DATASOURCE_UID: Loki datasource UID for log exploration
- GOLDFISH_CELL_A_NAMESPACE: Namespace for cell A log queries
- GOLDFISH_CELL_B_NAMESPACE: Namespace for cell B log queries

Frontend improvements:
- Display trace IDs in query diff view with visual indicators
- Show clickable links when explore configuration is available
- Add namespace labels to cell headers when configured
- Update TypeScript types to include trace ID fields

This enables developers to quickly navigate from query comparison results
to the underlying distributed traces and logs, significantly improving
the debugging workflow for query performance issues.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@trevorwhitney trevorwhitney requested a review from a team as a code owner August 5, 2025 18:46
@trevorwhitney trevorwhitney changed the title Goldfish UI improvements feat: add traceId to Goldfish UI Aug 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

💻 Deploy preview deleted.

Copy link
Contributor

@JordanRushing JordanRushing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no nits

@trevorwhitney trevorwhitney merged commit 4fabb8d into main Aug 5, 2025
71 checks passed
@trevorwhitney trevorwhitney deleted the goldfish-ui-improvements branch August 5, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants