Class VaadinTelemetryContext

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

public final class VaadinTelemetryContext extends Object
Exposes the Vaadin view context of the request currently being handled on this thread, so instrumentation living outside the Vaadin runtime (for example a JDBC DataSource proxy) can attribute its measurements to the view that triggered them.

The route is the template resolved by RouteTagResolver during navigation and is stored as a UI attribute that survives past the navigation event (unlike the transient timing state in NavigationMetricsBinder). Because Vaadin binds UI.getCurrent() to the request-handling thread, code running on that thread can read it back here.

  • Method Details

    • currentRoute

      public static String currentRoute()
      Returns the route template of the view bound to the current thread, or MeterNames.ROUTE_UNKNOWN when there is no current UI or no navigation has been recorded yet.
      Returns:
      the current route tag value, never null