Class ObservabilitySettings

java.lang.Object
com.vaadin.observability.micrometer.ObservabilitySettings

public final class ObservabilitySettings extends Object
Immutable settings for Observability Kit instrumentation. Build instances with builder().
  • Method Details

    • builder

      public static ObservabilitySettings.Builder builder()
    • isSessions

      public boolean isSessions()
    • isUis

      public boolean isUis()
    • isUiState

      public boolean isUiState()
      Whether to measure how much state each UI holds and publish the vaadin.ui.state.* aggregates. Off by default: it walks the component tree of the UI an interaction touched, which costs work outside the request's own path.
      Returns:
      true if UI state metrics are enabled
    • isNavigation

      public boolean isNavigation()
    • isData

      public boolean isData()
      Whether the data provider queries made by lazy-loading components are measured. On by default: for a data-heavy view these queries are usually where a slow interaction spends its time.
      Returns:
      true if data query metrics are recorded
    • isRequests

      public boolean isRequests()
    • isErrors

      public boolean isErrors()
    • isClient

      public boolean isClient()
    • isResync

      public boolean isResync()
      Whether to observe UIDL message resends and resynchronizations.
    • isTraces

      public boolean isTraces()
    • isTracesSessionId

      public boolean isTracesSessionId()
    • isInsights

      public boolean isInsights()
      Whether failed and over-budget user interactions are retained so the insights endpoint can backtrack a user report to a replicable interaction. On by default.

      Independent of isInsightsDetails(), which only governs how much detail a retained interaction carries. Collection still requires isErrors() for failures and isRequests() for slow interactions, since those supply the respective capture paths.

    • isInsightsDetails

      public boolean isInsightsDetails()
      Whether interaction insights may carry potentially sensitive detail: the raw session id, the exception message and the top stack frames.

      Off by default. The insights payload is meant to travel — into issue trackers, AI agents and whatever a consumer forwards it to — so the detail that could contain personal or secret data is withheld unless an application asks for it. What remains is still actionable: the route, the component, the event, the exception type and the first application stack frame. With this off the session id is reduced to a short one-way hash, which still correlates the examples of one insight without identifying the session.

    • isDatabase

      public boolean isDatabase()
    • isDatabaseStatement

      public boolean isDatabaseStatement()
    • getRouteCardinalityLimit

      public int getRouteCardinalityLimit()
    • getClientRatePerSession

      public int getClientRatePerSession()
    • getUiStateSampleInterval

      public int getUiStateSampleInterval()
      Minimum milliseconds between two measurements of the same UI, so a burst of interactions costs one tree walk rather than one per event.

      One measurement walks the whole component tree of one UI while its session lock is held, so the work this setting bounds is proportional to tree size times interaction rate: on a grid-heavy application with many concurrent users, a short interval adds measurable time to the lock that vaadin.session.lock.hold reports. The gauges describe a capacity trend rather than a live value, so the default is deliberately coarse.

      Returns:
      the per-UI sampling interval in milliseconds
    • getUiStateBytesPerNode

      public int getUiStateBytesPerNode()
      Bytes to attribute to one state-tree node when publishing vaadin.ui.state.size, or 0 to publish no byte figure at all.

      There is no default value that would be right: nodes are a proxy for retained heap, not a measurement of it, and one Grid node backed by 100 000 rows counts as a single node. Measure the cost for the application at hand — settle the heap, build a number of copies of a representative view, keep them reachable, and read the difference — and set the result here. Left at zero, the gauge is not registered, because a guessed byte figure published as a metric is worse than a missing one.

      Returns:
      bytes per state-tree node, or 0 when not configured
    • getInsightsCapacity

      public int getInsightsCapacity()
      Maximum number of records retained for the insights endpoint, applied to each buffer rather than shared between them: interactions, data provider queries and browser errors are retained separately, so with all three collectors active the total is three times this value. Keeping them apart means a burst of slow queries cannot evict the failed interactions, and neither can the flood of buffered reports that arrives when a network outage ends.
      Returns:
      the per-buffer capacity