Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 18, 2025

This PR implements a comprehensive telemetry interface that allows users to query Jaeger OpenTelemetry data and visualize call graphs directly from the Sentrius web interface, with robust error handling and user experience improvements.

Key Features

New Telemetry Page: Added a dedicated telemetry page accessible from the main sidebar navigation (requires CAN_MANAGE_APPLICATION permission) that provides:

  • Advanced Query Interface: Search traces by service name, operation, time range, duration thresholds, and custom tags
  • Interactive Call Graph Visualization: Uses the existing Cytoscape.js library to display span relationships in a hierarchical graph layout
  • Paginated Trace Results: Clean list view with configurable page sizes (10, 20, 50, 100 results per page) and navigation controls
  • Real-time Service Discovery: Automatically loads available services from the connected Jaeger instance

Backend Integration:

  • TelemetryApiController provides RESTful endpoints (/api/v1/telemetry/traces, /services, /trace/{id}) that communicate with Jaeger's query API
  • Configurable Jaeger endpoint via jaeger.query.url property (defaults to http://localhost:16686)
  • Robust error handling with graceful fallback when Jaeger is unavailable
  • Smart service defaulting to sentrius-api to prevent query failures

Mock Data Support:

  • MockJaegerApiController provides realistic sample traces for demonstration and testing when Jaeger is not deployed
  • Enables full UI testing without requiring a live Jaeger instance

UI/UX Enhancements:

  • Consistent dark theme matching existing Sentrius branding
  • Responsive Bootstrap 5 grid layout that properly positions content alongside the sidebar
  • Pagination controls with Previous/Next navigation and result range display
  • Loading states and comprehensive error messaging for better user experience
  • Default service selection for immediate functionality

Technical Implementation

The implementation leverages existing infrastructure:

  • Uses the project's existing RestTemplate for HTTP communication
  • Integrates with the current Spring Security and access control system
  • Follows established controller patterns by extending BaseController
  • Utilizes Cytoscape.js already present in package.json for graph visualization
  • Implements proper Bootstrap grid structure matching the dashboard layout

Error Handling & Reliability

  • 500 Error Prevention: API defaults to sentrius-api service when no service parameter provided
  • Layout Stability: Uses flex-nowrap grid structure to ensure content displays correctly beside sidebar
  • Pagination Limits: Configurable result limits with backend validation (max 100 per page)
  • Service Fallback: Graceful handling when "All Services" selection fails

Testing

Comprehensive test coverage includes:

  • Unit tests for all new controllers (9 tests total including pagination scenarios)
  • Mock data validation and API response structure verification
  • Error handling scenarios for invalid Jaeger connections and empty parameters
  • View controller routing validation
  • Pagination parameter validation

The feature is production-ready and provides immediate value for monitoring distributed traces in Sentrius deployments with Jaeger, while maintaining reliability even when Jaeger is unavailable.

Fixes #98.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits August 18, 2025 01:04
Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
Copilot AI changed the title [WIP] Add UI to query jaeger otel data Add Jaeger OpenTelemetry UI for trace querying and call graph visualization Aug 18, 2025
Copilot AI requested a review from phrocker August 18, 2025 01:13
Copy link
Contributor

@phrocker phrocker left a comment

Choose a reason for hiding this comment

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

There is a 500 when not entering any params, but can query and display when selecting services. Also, the sidebar is on the left. when displaying the graph and query results, the results and graph are below the sidebar, as if they are too large to fit on the right. Additionally, the number of results seems unconstrained or at least not paginated.

@copilot please fix the layout and default to sentrius-api if you need to since "all services" isn't working. alternatively feel free to fix that issue.

@phrocker phrocker marked this pull request as ready for review August 18, 2025 10:27
@phrocker
Copy link
Contributor

There is a 500 when not entering any params, but can query and display when selecting services. Also, the sidebar is on the left. when displaying the graph and query results, the results and graph are below the sidebar, as if they are too large to fit on the right. Additionally, the number of results seems unconstrained or at least not paginated.

@copilot please fix the layout and default to sentrius-api if you need to since "all services" isn't working. alternatively feel free to fix that issue.

Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 18, 2025

There is a 500 when not entering any params, but can query and display when selecting services. Also, the sidebar is on the left. when displaying the graph and query results, the results and graph are...

Fixed all the reported issues in commit ef71b6a:

500 Error Fix: Modified the API controller to default to "sentrius-api" service when no parameters are provided, preventing the 500 error when "All Services" is selected.

Layout Fix: Updated the grid structure to use row flex-nowrap with proper sidebar column classes, ensuring results and graph display to the right of the sidebar instead of below it.

Pagination Added: Implemented comprehensive pagination controls including:

  • Results per page selector (10, 20, 50, 100)
  • Previous/Next navigation buttons
  • Current page and result range display
  • Backend pagination with limit and start parameters

Default Service: Changed the dropdown default from "All Services" to "sentrius-api" to ensure queries work reliably out of the box.

Layout Fix Screenshot

The telemetry page now has proper responsive layout and constrained, paginated results.

There is a 500 when not entering any params, but can query and display when selecting services. Also, the sidebar is on the left. when displaying the graph and query results, the results and graph are...

All issues addressed in commit ef71b6a:

500 error fixed - API now defaults to "sentrius-api" when no service specified
Layout fixed - Results and graph now display to the right of sidebar using proper Bootstrap grid
Pagination added - Results are now constrained with navigation controls and configurable page sizes
Default service - Dropdown defaults to "sentrius-api" instead of problematic "All Services"

The interface is now fully functional with proper responsive design and pagination controls.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repository.jboss.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Sentrius/Sentrius org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add Jaeger OpenTelemetry UI for trace querying and call graph visualization Add Jaeger OpenTelemetry UI with improved layout, pagination, and error handling Aug 18, 2025
Copilot AI requested a review from phrocker August 18, 2025 10:54
@phrocker phrocker merged commit 24a768a into main Aug 19, 2025
9 checks passed
@phrocker phrocker deleted the copilot/fix-98 branch August 19, 2025 10:12
phrocker added a commit that referenced this pull request Nov 27, 2025
…and integrate launch tracking (#99)

* Initial plan

* Fix lineage to show complete family tree (ancestors and descendants)

Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>

* Add API endpoint to create next generation agents

Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>

* Record agent launches in agent_launches table when contextId is provided

Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add UI to query jaeger otel data

2 participants