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

feat: trace components improvements and refactoring#8

Merged
andersonleal merged 4 commits intomainfrom
feat/traces-improvs
Feb 12, 2026
Merged

feat: trace components improvements and refactoring#8
andersonleal merged 4 commits intomainfrom
feat/traces-improvs

Conversation

@andersonleal
Copy link
Copy Markdown
Contributor

Trace components improvements and refactoring

Summary

This PR refactors and enhances the trace visualization components in the iii-console, improving code reuse, performance, and maintainability. Key changes include:

Frontend (console-frontend)

  • New traceUtils.ts — Centralized utility functions:

    • formatDuration() — Duration formatting (μs, ms, s)
    • useCopyToClipboard() — Reusable copy-to-clipboard hook with timeout
    • getServiceName() — Extract service name from span
    • STATUS_CONFIG — Shared status styling (OK, ERROR, UNSET)
  • useTraceFilters hook — Filter handling improvements:

    • Switched from useState to useRef for debounce timers (avoids stale closures and unnecessary re-renders)
    • Split apiParams into filterOnlyParams + pagination for stable references when only page changes
    • Added getFilterOnlyParams() for consumers that need filter params without pagination
    • More granular useMemo dependencies to reduce unnecessary recomputation
  • Trace components — Refactored to use shared utilities:

    • ServiceBreakdown — Uses formatDuration, getServiceName; simplified layout; collapsible section
    • SpanPanel, SpanInfoTab, SpanTagsTab, SpanLogsTab, SpanErrorsTab, SpanBaggageTab — Use traceUtils for copy, status badges, duration formatting
    • TraceHeader — Enhanced with utility functions
    • WaterfallChart, ViewSwitcher — Minor tweaks
  • README — Streamlined and updated

Rust (console-rust)

  • iii-sdk — Updated from 0.0.2-alpha.20260211151315 to 0.0.4
  • Bridge functionstreams.listAllstream.listAll (API alignment)
  • OTEL flag — Switched from --otel (opt-in) to --no-otel (opt-out)

Type of Change

  • refactor — Code change that neither fixes a bug nor adds a feature
  • chore — Changes to build process, dependencies, or tooling
  • bugfix — Non-breaking change which fixes an issue
  • feature — Non-breaking change which adds functionality
  • breaking — Fix or feature that would cause existing functionality to break

Checklist

  • I have run pnpm run lint (or equivalent) and fixed any issues
  • I have run cargo build in packages/console-rust/ and verified compilation
  • I have reviewed my changes for correctness and completeness
  • I have added/updated tests (if applicable)
  • I have updated documentation (if applicable)

Additional Context

  • Files changed: 19 files (frontend: ~1156 insertions, ~854 deletions)
  • Sdk: iii-sdk version bump aligns with latest engine API
  • Performance: Filter hook refactor reduces unnecessary re-renders and query refetches when only pagination changes

- Rename the project from "iii Developer Console" to "iii-console" and revise the installation instructions to reflect the new standalone binary format.
- Simplify the ServiceBreakdown component by adding a collapsible header for better UI/UX, integrating a summary of percentiles, and improving the layout of service statistics.
- Introduce clipboard functionality for copying baggage entries in the SpanBaggageTab and stack traces in the SpanErrorsTab, enhancing user interaction.
- Update the SpanInfoTab and SpanLogsTab components for improved readability and usability, including better formatting and additional information display.

These changes improve the overall user experience and maintainability of the console-frontend application.
- Update README to reflect the new command for running the console.
- Refactor ServiceBreakdown component to improve UI/UX with collapsible sections and accessibility features.
- Introduce a new utility file for common functions, including formatDuration and useCopyToClipboard, to streamline code across components.
- Replace local copy functionality in SpanBaggageTab, SpanErrorsTab, SpanInfoTab, and SpanTagsTab with the new useCopyToClipboard hook for consistency.
- Improve performance of SpanTagsTab by memoizing filtered entries based on search query.

These changes enhance the maintainability and user experience of the console-frontend application.
- Separate filter-only parameters from full API parameters to enhance performance and stability.
- Introduce getFilterOnlyParams function for better access to filter parameters without pagination.
- Update TracesPage to utilize getFilterOnlyParams for loading traces, ensuring consistent pagination handling.

These changes streamline the trace filtering logic and improve the maintainability of the codebase.
…ance improvements

- Introduce getServiceName utility function to standardize service name extraction across components.
- Update ServiceBreakdown, SpanInfoTab, SpanPanel, and TraceHeader components to utilize getServiceName for improved readability and consistency.
- Optimize SpanBaggageTab and SpanTagsTab by memoizing entries to enhance performance.
- Refactor useTraceFilters hook to use refs for timer management, improving clarity and efficiency.

These changes streamline the codebase and enhance the performance and maintainability of the trace components.
@andersonleal andersonleal merged commit 93ce2af into main Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants