feat: Spring Boot starter + integration tests (Part 4)#333
Merged
Conversation
… for reuse by the starter
…ndant starter deps
…shared test base - Aggregator artifactId: observability-kit-micrometer-test → observability-kit-tests - New observability-kit-test-common (jar) with AbstractIT in pkg com.vaadin.observability.tests.common; compile-scope testbench deps - Standalone IT dir renamed to observability-kit-tests-micrometer, artifactId observability-kit-tests-micrometer, pkg com.vaadin.observability.tests.micrometer; depends on test-common
…lity-kit-tests-starter)
…ests-common Align the shared IT base module with the agreed observability-kit-tests-* naming scheme (it was the lone module still using the singular 'test-' prefix). Updates the directory, artifactId, aggregator module entry, and the three dependent test poms.
ObservabilityConfiguration bound the session-id traces flag from the dotted key vaadin.observability.traces.session-id, the lone non-flat key in the module. The Boot starter binds the same flag from the flat vaadin.observability.traces-session-id (the canonical key in the design spec), so a user copying properties between the two flavours would have the setting silently dropped. Switch the plain-Spring @value to the flat key so both modules and the spec agree.
The unique value isolates the shutdown handshake, not the HTTP listen port (which stays Jetty's default 8080); the reactor runs IT modules sequentially.
…ut of the box observability-kit-starter only attached to a pre-existing MeterRegistry; it never set Micrometer up, so the kit was not a real Micrometer starter — users had to wire metrics themselves. Depend on Boot's spring-boot-starter-micrometer-metrics (compile) so MetricsAutoConfiguration + CompositeMeterRegistryAutoConfiguration are present: a MeterRegistry is wired out of the box and the Vaadin instrumentation activates with no further setup. The registry backend (Prometheus, OTLP, ...) and Actuator endpoint exposure remain the application's choice. With those autoconfig classes now guaranteed on the classpath, switch @autoConfiguration(afterName = {strings}) to the type-safe after = {MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class}. Drop the unused optional spring-boot-actuator-autoconfigure dependency (the starter references no actuator types). Add an ApplicationContextRunner test asserting that with the metrics autoconfig present and no hand-supplied registry, both a MeterRegistry and the listener appear.
caalador
reviewed
Jun 9, 2026
- Use a descriptive withFailMessage on the request-duration .contains assertions (BootMetricsIT, SpringMetricsIT) so a failure reports what was missing instead of dumping the whole scrape body (caalador review). - Switch both ITs to static AssertJ imports (assertThat), matching the unit test and the project's test conventions.
caalador
approved these changes
Jun 9, 2026
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 #328.
Final part of the Micrometer rewrite: the Spring Boot starter plus the remaining integration tests (plain-Spring and Boot/Prometheus). The standalone IT already landed in #330; this part renames it into the shared scheme and adds the rest.
Spring Boot starter (
observability-kit-starter)ObservabilityAutoConfiguration—@AutoConfigurationordered after Boot'sMetricsAutoConfiguration/CompositeMeterRegistryAutoConfiguration; gated by@ConditionalOnClass({MeterRegistry, VaadinService})and@ConditionalOnProperty("vaadin.observability.enabled", matchIfMissing = true). Registers theObservabilitySettingsbean (@ConditionalOnMissingBean) and the listener (@ConditionalOnBean(MeterRegistry)+@ConditionalOnMissingBean).ObservabilityProperties—@ConfigurationProperties("vaadin.observability");toSettings()maps every flag exceptenabled.SpringMetricsServiceInitListener, extracted fromObservabilityConfigurationinobservability-kit-springso plain-Spring and Boot share one listener.ApplicationContextRunnerunit tests (AssertJ): default-on registers beans,enabled=falsedisables, property binding honored, user@ConditionalOnMissingBeanoverrides respected, no-MeterRegistry⇒ no listener.Integration tests (under the
observability-kit-testsaggregator)observability-kit-tests-common— sharedAbstractIT(+DriverSupplier) as a jar, consumed test-scope.observability-kit-tests-micrometer— the standalone IT from test: add it tests for micrometer core #330, renamed into the scheme (pkgcom.vaadin.observability.tests.micrometer) and refactored onto the shared base.observability-kit-tests-spring— plain-Spring MVC WAR on Jetty; scrapes/metrics; assertsvaadin.sessions.created/vaadin.ui.created/vaadin.sessions.active/vaadin.request.duration.maven-enforcerbansorg.springframework.boot.observability-kit-tests-starter— Spring Boot + Prometheus on Jetty (Tomcat excluded); scrapes/actuator/prometheus; asserts the Prometheus-renamedvaadin_sessions_total/vaadin_ui_total/vaadin_sessions_active/vaadin_request_duration_seconds.All IT modules use
com.vaadin.observability.tests.<flavor>packages and the agreedobservability-kit-tests-*naming.Notes
vaadin.observability.traces.session-id, while the Boot starter and the design use the flatvaadin.observability.traces-session-id. Both now use the flat key.mvn spotless:check install -DskipItgreen across the production reactor; full reactor (9 modules) resolves. Browser ITs run in CI.