Skip to content

Part 2: Complete core metrics, tracing, and client instrumentation#329

Open
heruan wants to merge 15 commits into
micrometerfrom
feat/micrometer-instrumentation
Open

Part 2: Complete core metrics, tracing, and client instrumentation#329
heruan wants to merge 15 commits into
micrometerfrom
feat/micrometer-instrumentation

Conversation

@heruan
Copy link
Copy Markdown
Member

@heruan heruan commented Jun 5, 2026

Closes #326.

Completes the framework-agnostic core (observability-kit-micrometer) with the full instrumentation set, wired behind ObservabilitySettings toggles via the SPI MetricsServiceInitListener.

What's included

  • Sessionsvaadin.sessions.{active,created,duration}; session-lock contention vaadin.session.lock.{wait,hold} (tag context) via SessionLockListener (feat: add session lock request, acquire, release events flow#24498).
  • UIvaadin.ui.{active,created}.
  • Navigationvaadin.navigation (tags route, outcome) with a route-cardinality cap.
  • Requests/errorsvaadin.request.duration (tag outcome), vaadin.errors (tag exception).
  • RPC (server-side)vaadin.rpc.duration (tags type, outcome) plus vaadin.rpc spans, via RpcInvocationListener (feat: RPC invocation listener support flow#24499). Replaces the prototype's browser-XHR approximation.
  • Tracing — observation-based; TracingExecutor propagates context across UI.access(...); ObservabilityKit provisions an ObservationRegistry + default meter handler when tracing is enabled.
  • Client (browser→server)vaadin.client.{bootstrap.duration,navigation.duration,web_vitals.lcp,web_vitals.fcp,errors} with per-session rate limiting; client-side RPC timing removed (now server-side).

Notes

  • Requires Flow 25.3-SNAPSHOT (contains the merged #24498 + #24499 SPIs).
  • Cardinality-guarded: RPC/route/client tags never carry raw names, node ids, or paths/fragments.
  • Two latent prototype issues were fixed in passing (route tag length-cap ordering; client-only config not registering the UI listener).
  • mvn verify green — 104 unit tests, including the client subsystem (untested in the prototype).

Out of scope

Spring / Spring Boot integration (Parts 3–4).

heruan added 15 commits June 5, 2026 11:32
Expands SessionMetricsBinder with vaadin.sessions.created counter and
vaadin.sessions.duration timer; adds SessionLockMetricsBinder tracking
vaadin.session.lock.wait and vaadin.session.lock.hold timers tagged with
context=request|access via Flow's SessionLockListener SPI (#24498).
…tion relay

Ports RequestInteraction (thread-local relay), RouteTagResolver (cardinality-
capped route tag mapping), and NavigationMetricsBinder (vaadin.navigation timer
with route+outcome tags, plus observation path) from Flow's prototype, with
package and type renames for Observability Kit.
…ice init listener

Port TracingExecutor from Flow prototype: wraps the service Executor to propagate
thread-local context via ContextSnapshotFactory and emit a vaadin.ui.access
Observation per UI.access() task when an ObservationRegistry is present.

Refactor MetricsServiceInitListener to match the prototype's structure: three
constructors (no-arg SPI, 2-arg, 3-arg DI), installDefaultObservationHandlers
hook called from the 3-arg ctor (fixing the DI path so an injected
ObservationRegistry is actually wired), bind() method that consolidates all
binder wiring plus executor wrapping when traces are enabled.
Implement RpcMetricsBinder (implements RpcInvocationListener) that records
vaadin.rpc.duration timers tagged with type and outcome for each server-side
RPC invocation. When traces are enabled, each invocation is driven through the
Observation API producing a vaadin.rpc.<type> span; otherwise the Timer is
recorded directly. Wire RpcMetricsBinder into MetricsServiceInitListener,
gated on isRequests().
…client RPC timing

Ports the Flow prototype client subsystem (ClientSample, ClientMetricNames,
ClientRateLimiter, ClientMetricsBinder, MetricsCollectorElement, VaadinMetricsClient.js)
into com.vaadin.observability.micrometer.client with one deliberate reduction:
CLIENT_RPC_DURATION is excluded from ClientMetricNames.ALLOWED and the XHR-RPC
timing block is removed from the JS, because RPC is measured server-side (Task 8).
Wires MetricsCollectorElement into UiMetricsBinder when settings.isClient() is true.
Adds 34 unit tests covering the rate limiter, name allowlist, and metrics binder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant