Class ComponentResolver

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

public final class ComponentResolver extends Object
Resolves the Component an RPC invocation targets. Shared by the instrumentation that enriches spans and the insights collector that records interactions.
  • Method Details

    • resolveComponentType

      public static Optional<String> resolveComponentType(com.vaadin.flow.server.communication.AbstractRpcInvocationEvent event)
      Resolves the class name of the component the invocation targets, by looking up the target StateNode in the UI's state tree and walking up to the nearest enclosing component. Returns Optional.empty() if the invocation does not target a node, the node is no longer attached, or no component can be resolved. Resolution is best-effort enrichment and never throws.
      Parameters:
      event - the RPC invocation to resolve the target component for
      Returns:
      the fully-qualified component class name, or empty