Class ObservabilityDevToolsHandler

java.lang.Object
com.vaadin.observability.micrometer.devtools.ObservabilityDevToolsHandler
All Implemented Interfaces:
com.vaadin.base.devserver.DevToolsMessageHandler

@JsModule(value="./VaadinObservabilityDevTools.js", developmentOnly=true) public class ObservabilityDevToolsHandler extends Object implements com.vaadin.base.devserver.DevToolsMessageHandler
Dev-mode bridge between the live Micrometer MeterRegistry and the Vaadin Copilot metrics panel.

Discovered via the Java ServiceLoader by Flow's dev-tools server (see META-INF/services). It answers two requests from the browser over the shared dev-tools websocket: a meter snapshot of every vaadin.* meter, and the insights payload /actuator/vaadin/observability publishes. This is a developer-only convenience view; it has no effect in production where the dev-tools connection does not exist.

The two are separate commands because they are wanted at different times. The meter table is only worth polling while the panel is open, whereas the panel watches for new insights whether or not anyone is looking at it, and that background poll should not snapshot the whole registry every time.

The panel itself is the development-only module declared here, which the frontend build picks up because this class is a dev-tools entry point.

  • Constructor Details

    • ObservabilityDevToolsHandler

      public ObservabilityDevToolsHandler()
  • Method Details

    • handleConnect

      public void handleConnect(com.vaadin.base.devserver.DevToolsInterface devToolsInterface)
      Specified by:
      handleConnect in interface com.vaadin.base.devserver.DevToolsMessageHandler
    • handleMessage

      public boolean handleMessage(String command, tools.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface)
      Specified by:
      handleMessage in interface com.vaadin.base.devserver.DevToolsMessageHandler