Class UiObservationSupport

java.lang.Object
io.jmix.flowui.observation.UiObservationSupport

@Component("flowui_UiObservationSupport") public class UiObservationSupport extends Object
Support class for observing UI events such as view lifecycle events and action executions.

This class uses an ObservationRegistry if observation functionality is enabled in the application configuration.

Observation functionality can be turned on or off using the jmix.ui.ui-observation-enabled property in the application's configuration.

See Also:
  • Field Details

    • OBSERVATION_NAME_PREFIX

      public static final String OBSERVATION_NAME_PREFIX
      Shared prefix of every jmix.ui.* observation/metric name produced by this support class.
      See Also:
    • VIEW_OBSERVATION_NAME

      public static final String VIEW_OBSERVATION_NAME
      See Also:
    • FRAGMENT_OBSERVATION_NAME

      public static final String FRAGMENT_OBSERVATION_NAME
      See Also:
    • ACTION_OBSERVATION_NAME

      public static final String ACTION_OBSERVATION_NAME
      See Also:
    • DATA_LOADER_OBSERVATION_NAME

      public static final String DATA_LOADER_OBSERVATION_NAME
      See Also:
    • VIEW_CONTEXTUAL_NAME

      public static final String VIEW_CONTEXTUAL_NAME
      Human-readable contextual name passed to the Observation of view lifecycle phases.
      See Also:
    • FRAGMENT_CONTEXTUAL_NAME

      public static final String FRAGMENT_CONTEXTUAL_NAME
      Human-readable contextual name passed to the Observation of fragment lifecycle phases.
      See Also:
    • DATA_LOADER_CONTEXTUAL_NAME

      public static final String DATA_LOADER_CONTEXTUAL_NAME
      Human-readable contextual name passed to the Observation of data loader lifecycle phases.
      See Also:
    • ACTION_CONTEXTUAL_NAME

      public static final String ACTION_CONTEXTUAL_NAME
      Human-readable contextual name passed to the Observation of action executions.
      See Also:
    • LIFECYCLE_NAME_TAG

      public static final String LIFECYCLE_NAME_TAG
      Tag key carrying the modern-schema lifecycle phase name on view / fragment / data-loader observations. Acts as the marker that distinguishes modern Observation meters from the legacy Timer-based schema; the legacy stack uses it to suppress modern Timer registrations under the same jmix.ui.* names (see LegacyUiTimerSupport).
      See Also:
    • VIEW_ID_TAG

      public static final String VIEW_ID_TAG
      Low-cardinality tag key carrying the enclosing view's id.
      See Also:
    • VIEW_CLASS_TAG

      public static final String VIEW_CLASS_TAG
      Low-cardinality tag key carrying the FQN of the view's class.
      See Also:
    • FRAGMENT_ID_TAG

      public static final String FRAGMENT_ID_TAG
      Low-cardinality tag key carrying the enclosing fragment's id.
      See Also:
    • FRAGMENT_CLASS_TAG

      public static final String FRAGMENT_CLASS_TAG
      Low-cardinality tag key carrying the FQN of the fragment's class.
      See Also:
    • LOADER_ID_TAG

      public static final String LOADER_ID_TAG
      Low-cardinality tag key carrying the data loader's id (or GENERATED_LOADER_ID_SENTINEL).
      See Also:
    • FULL_LOADER_ID_TAG

      public static final String FULL_LOADER_ID_TAG
      High-cardinality span attribute key preserving the original loader id when LOADER_ID_TAG collapses to the sentinel.
      See Also:
    • ACTION_ID_TAG

      public static final String ACTION_ID_TAG
      Low-cardinality tag key carrying the action's id on action-execution observations.
      See Also:
    • TARGET_ID_TAG

      public static final String TARGET_ID_TAG
      Low-cardinality tag key carrying the target component's id on action-execution observations.
      See Also:
    • NOT_AVAILABLE

      public static final String NOT_AVAILABLE
      Sentinel value placed into low-cardinality tags (VIEW_ID_TAG, FRAGMENT_ID_TAG, TARGET_ID_TAG) when the underlying id cannot be resolved (view/fragment/target absent or without an explicit id). The tag is added unconditionally so the Prometheus meter for a given metric name always carries the same set of tag keys — otherwise conditionally-added tags make PrometheusMeterRegistry reject one of the registrations and silently drop a slice of the data.
      See Also:
    • GENERATED_LOADER_ID_SENTINEL

      protected static final String GENERATED_LOADER_ID_SENTINEL
      Sentinel for the low-cardinality loader.id tag when the loader carries an auto-generated id (prefix generated_). Aggregates all anonymous loaders into a single time-series; the original id is preserved as a high-cardinality full_loader_id attribute on the span.
      See Also:
    • observationRegistry

      @Autowired(required=false) protected io.micrometer.observation.ObservationRegistry observationRegistry
    • legacyUiTimerSupport

      @Autowired protected LegacyUiTimerSupport legacyUiTimerSupport
    • observationEnabled

      protected boolean observationEnabled
  • Constructor Details

    • UiObservationSupport

      public UiObservationSupport(UiProperties uiProperties)
  • Method Details