Part 2: Complete core metrics, tracing, and client instrumentation#329
Open
heruan wants to merge 15 commits into
Open
Part 2: Complete core metrics, tracing, and client instrumentation#329heruan wants to merge 15 commits into
heruan wants to merge 15 commits into
Conversation
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.
…nMetricsBinder final
…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.
…outcome tag; align header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #326.
Completes the framework-agnostic core (
observability-kit-micrometer) with the full instrumentation set, wired behindObservabilitySettingstoggles via the SPIMetricsServiceInitListener.What's included
vaadin.sessions.{active,created,duration}; session-lock contentionvaadin.session.lock.{wait,hold}(tagcontext) viaSessionLockListener(feat: add session lock request, acquire, release events flow#24498).vaadin.ui.{active,created}.vaadin.navigation(tagsroute,outcome) with a route-cardinality cap.vaadin.request.duration(tagoutcome),vaadin.errors(tagexception).vaadin.rpc.duration(tagstype,outcome) plusvaadin.rpcspans, viaRpcInvocationListener(feat: RPC invocation listener support flow#24499). Replaces the prototype's browser-XHR approximation.TracingExecutorpropagates context acrossUI.access(...);ObservabilityKitprovisions anObservationRegistry+ default meter handler when tracing is enabled.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
25.3-SNAPSHOT(contains the merged #24498 + #24499 SPIs).mvn verifygreen — 104 unit tests, including the client subsystem (untested in the prototype).Out of scope
Spring / Spring Boot integration (Parts 3–4).