Skip to content

feat: plain Spring integration (observability-kit-spring)#331

Merged
heruan merged 6 commits into
micrometerfrom
feat/micrometer-spring
Jun 9, 2026
Merged

feat: plain Spring integration (observability-kit-spring)#331
heruan merged 6 commits into
micrometerfrom
feat/micrometer-spring

Conversation

@heruan

@heruan heruan commented Jun 8, 2026

Copy link
Copy Markdown
Member

Closes #327.

Adds the observability-kit-spring module — plain (non-Boot) Spring integration, opt-in via @Import(ObservabilityConfiguration.class).

What's included

  • ObservabilityConfiguration (@Configuration): binds vaadin.observability.* via constructor injection into an ObservabilitySettings, and exposes a MetricsServiceInitListener bean. Uses a Spring-aware listener subclass that:
    • skips default observation-handler registration (Spring/Boot already registers a DefaultMeterObservationHandler — avoids double Timer emission), and
    • enriches Spring's HTTP server-request observation (/vaadin/<type>, http <method> vaadin <type>) so the request type is visible on the parent HTTP span.
  • SpringHttpObservationEnricher: best-effort lift of the Vaadin request type into Spring's ServerRequestObservationContext; no-ops without spring-web.
  • Reuses the core listener's installDefaultObservationHandlers / enrichHttpObservation hooks (added in Part 2).

Notes

  • Non-Boot on purpose: properties are bound with @Value constructor injection, not @ConfigurationProperties (that's a Spring Boot feature — it arrives with the starter in Part 4). No Spring Boot dependency here.
  • Minimal public surface: only ObservabilityConfiguration is public (required so users can @Import it); its constructor, both @Bean methods, the enricher, and the listener subclass are all package-private.
  • Exposes the full settings surface incl. client / client-rate-per-session (the prototype omitted these).
  • Tests use AssertJ + the Mockito JUnit 5 extension; mvn verify green (7 module tests; 111 across the reactor).

Dependencies

  • vaadin-spring (flow-bom), spring-context, spring-web (optional); Spring Boot 4.0.5 BOM for spring-* version management; assertj-core + mockito-junit-jupiter (test).

Out of scope

Spring Boot auto-configuration / starter + integration-test modules (Part 4, #328).

heruan added 6 commits June 8, 2026 11:40
… observation enricher)

Port Flow's vaadin-micrometer-spring into the observability-kit-spring module with package/class
renames and the additional client/clientRatePerSession property bindings beyond the prototype.
@heruan heruan changed the title Part 3: Plain Spring integration (observability-kit-spring) feat: plain Spring integration (observability-kit-spring) Jun 8, 2026
@heruan heruan linked an issue Jun 8, 2026 that may be closed by this pull request
@heruan heruan self-assigned this Jun 8, 2026
@heruan heruan merged commit 6bb7bb8 into micrometer Jun 9, 2026
2 checks passed
@heruan heruan deleted the feat/micrometer-spring branch June 9, 2026 08:14
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.

Part 3: Plain Spring integration (observability-kit-spring)

2 participants