Class InsightsService

java.lang.Object
com.vaadin.observability.micrometer.insights.InsightsService

public class InsightsService extends Object
Turns captured interactions into insights, and renders the payload served at /actuator/vaadin/observability. Interactions are grouped so that N users hitting the same problem produce ONE insight with N occurrences; each insight type is a rule over the shared interaction buffer:
  • user-interaction-error: failed interactions, grouped by (route, component, event, exception);
  • slow-user-interaction: successful interactions over the UX budget, grouped by (route, component, event);
  • client-error: errors raised in a browser, grouped by (route, kind, source, frame), most occurrences first and capped at MAX_CLIENT_ERROR_INSIGHTS groups. These come from the in-browser collector rather than the interaction buffer, and are the one insight kind that can describe a failure the server never saw — and the one whose grouping key is partly the browser's to choose, hence the cap.
The output is a stable, AI-agent-readable contract: an agent with access to the application codebase can open evidence.applicationFrame (or the component's event handler), verify the problem and propose a fix; a human can follow replay to reproduce.
  • Constructor Details

    • InsightsService

      public InsightsService(@Nullable RecentInteractions buffer)
      Parameters:
      buffer - the interactions recorded so far, or null when the kit registered no instrumentation — the payload then says so explicitly instead of reporting an empty result
    • InsightsService

      public InsightsService(@Nullable RecentInteractions buffer, @Nullable RecentQueries queries)
      Parameters:
      buffer - retained interactions, or null when the interaction collector was not registered
      queries - retained data provider queries, or null when the query collector was not registered
    • InsightsService

      public InsightsService(@Nullable RecentInteractions buffer, @Nullable RecentQueries queries, @Nullable RecentClientErrors clientErrors)
      Parameters:
      buffer - retained interactions, or null when the interaction collector was not registered
      queries - retained data provider queries, or null when the query collector was not registered
      clientErrors - retained browser errors, or null when the in-browser collector was not registered
  • Method Details