vaadin / vaadin/observability-kit

Restore renderer cost instrumentation lost in the 5.0 rewrite

Open
#362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
7
Forks
5
Avg merge
2d 16h
Merged PRs (30d)
25

Description

There is no visibility into what a ComponentRenderer costs. For a ComboBox or Grid that renders a component per item, this is often the dominant cost of a page load and the main reason a UIDL response is large, and right now nothing measures it.

Also a 5.0 regression

The agent-based kit had ComponentRendererInstrumentation, which put advice on com.vaadin.flow.data.renderer.ComponentRenderer.createComponent and emitted a span Component creation with a vaadin.component attribute. It went away with the agent in the 5.0 rewrite.

Why the kit cannot do it today

ComponentRenderer.createComponent has no listener, callback or interceptor. Unlike data provider queries, there is no Flow SPI in flight for it either.

There is a partial shim for Grid and TreeGrid: both implement HasDataGenerators, so a DataGenerator can be attached and its generateData calls counted and timed per component. That measures the whole per-item JSON generation, renderer included, rather than the renderer alone. ComboBox does not expose it, since its generator is package private on ComboBoxDataController.

Proposed work

  1. Ship the DataGenerator-based measurement for Grid and TreeGrid, which needs no Flow change, as vaadin.data.item.generate.duration tagged by component.
  2. Decide whether to ask Flow for a hook on ComponentRenderer.createComponent. Worth revisiting once vaadin/flow#25262 lands, since that establishes the pattern for this kind of observation point.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the DataGenerator integration points in Grid and TreeGrid, and compare their generateData calls with the proposed vaadin.data.item.generate.duration metric. Done means measurement is shipped for both components and tagged by component; separately assess whether ComponentRenderer.createComponent needs a Flow hook, considering vaadin/flow#25262.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.