Arconia Dev UI

The Arconia Dev UI is a web interface for the application you are developing: its configuration, its logs, the technologies it is built with, and the services it uses. Your application serves it while it runs in dev mode, and the libraries it uses contribute the pages. Add one dependency and open the Dev UI in your browser. No code or configuration is needed.

The Overview page of the Arconia Dev UI

The Dev UI is incubating. Its features and its configuration may change in any release.

The Dev UI is a development tool. Declared as a development-only dependency, it is left out of the packaged application. It is not active when your application runs in test mode or in production mode.

Quick Start

  1. Add the Arconia Dev dependency to your project, which brings the development tools of Arconia, including the Dev UI:

    • Gradle

    • Maven

    dependencies {
        developmentOnly 'io.arconia:arconia-dev'
    }
    <dependency>
        <groupId>io.arconia</groupId>
        <artifactId>arconia-dev</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
  2. Run your application as usual:

    • Gradle

    • Maven

    • CLI

    ./gradlew bootRun
    ./mvnw spring-boot:run
    arconia dev
  3. Open http://localhost:8080/a/dev in your browser. Your application logs the address of the Dev UI when it has started, with its real port and context path.

The Dev UI is available in Servlet web applications. It is served under the context path of your application: with server.servlet.context-path=/shop, it is at /shop/a/dev.

Using the Dev UI

The navigation on the left lists the pages: the Overview, where the Dev UI starts, the Modules, and the pages that the libraries of your application contribute. Each page has its own address, so you can bookmark it, reload it, or share it.

The top bar shows the name and the version of your application, so that you can tell which application a Dev UI is for when you have several open. It also has:

  • a button that restarts your application, when it uses Spring Boot DevTools with its restart support on;

  • a Help button, with links to this documentation and to the forms for reporting a bug or requesting a feature;

  • a button that switches between the color scheme of your operating system, light, and dark.

A page shows your application as it was when the page was loaded. Reload the page to see it as it is now.

When your application restarts, as it does with Spring Boot DevTools after a change in the code, the Dev UI notices the next time you come back to it or open a page. While your application is down, the page shows that it is waiting and retries on its own. Once your application is back, the Dev UI reloads at the same address.

The Dev UI remembers in your browser the sections of the navigation you closed, the color scheme, and whether the log console is open and how tall it is.

Overview

The Overview is where the Dev UI starts. It shows what identifies your application and where it runs, with a card each for your application and its build, Spring, Java, and the system.

Modules

The Modules page has a card for each technology of your application that has something to show while it runs, such as the Spring Boot auto-configurations, your database migrations, or your caches. See Dev UI Modules for the modules and what each one shows.

Dev Services

When your application uses Arconia Dev Services, the Dev Services page has a card for each of them, with the state of its container, how to connect to it, and what you can open from it.

The Dev Services page
The card of the Grafana LGTM Dev Service
  • A tag shows when the container is not just for this application: Discovered, when another application started it, and Shared, when other applications can connect to it (see Reusing Dev Services).

  • Each port of the container is shown with the port of your machine to connect to, which stands out.

  • The links open the tools of the Dev Service in a new tab, such as the Grafana console of the Grafana LGTM Dev Service.

  • The logs of the container open in a dialog and follow the log live.

The logs of the PostgreSQL container

Configuration

The Configuration section of the navigation has three pages.

Properties

The Properties page lists every configuration property that your application and its libraries document, whether it is set or not, with the source that sets it. An environment variable such as SERVER_PORT is shown as what it is for Spring Boot: the value of server.port.

The Properties page

Type in the filter to find a property, such as spring.cache. The filter is part of the address of the page, so you can bookmark or share a filtered table. Open a row to see more about the property.

The properties come from the configuration metadata that libraries ship in their jars, which IDEs also use to complete property names. As a consequence:

  • A property that is set but not documented is listed without a description.

  • An entry of a map or a list, such as logging.level.org.springframework.web, has a row of its own.

  • The default value is the one the metadata documents. Some properties compute their default when your application runs, so a property without a documented default may still have one.

  • System properties and environment variables are listed only when they set a documented property. The Environment page lists all of them.

The value is the one in the environment of your application, with placeholders resolved. Your code can still change what a library ends up using.

Environment

The Environment page lists every property of every source your application reads its configuration from: command line arguments, system properties, environment variables, configuration files, and any source a library adds. The sources are in the order Spring looks them up, so the first one that holds a property gives it its value. Each row shows whether its value is effective or overridden by an earlier source.

The Environment page

Choose a source to see only its properties, such as the ones Spring Boot DevTools sets during development. Open a row to see where in a file the property is set, and which source overrides it.

Loggers

The Loggers page lists the loggers of your application and lets you change their level while it runs. A logger without a level of its own is shown as Inherited: it logs at the level of the closest logger above it that has one. The first rows are the logger groups, such as web and sql, and the ones your application defines with logging.group.*. Setting the level of a group sets it for all its members.

The Loggers page

Choose another level for a logger to change it. The change applies right away, and you can follow its effect in the log console.

A change only lasts while your application runs, as with the loggers endpoint of Spring Boot Actuator. To keep a level, set it with a logging.level.* property.

Secrets

On the Properties and Environment pages, a value that is likely to be a secret is hidden. Click the eye next to it to show it. A hidden value is not searched by the filter.

A property whose value is hidden

What counts as a secret is decided by the sanitizer of Spring Boot, the one the Actuator endpoints use. A value is hidden when the name of its property ends with password, secret, key, or token, or contains credentials. It is also hidden when it is a URL that carries a password or another secret, such as redis://:secret@localhost or jdbc:postgresql://localhost/shop?password=secret. If your application defines SanitizingFunction beans, the Dev UI follows them too.

Hiding a value protects it from someone looking at your screen. It doesn’t protect it from anyone who can use the Dev UI, which is why the Dev UI only accepts requests from your own machine (see Accessing the Dev UI).

Dependencies

The Dependencies page lists the libraries your application is built with, each with its version, its group, and its license. That is where to check which version of a library you really run, or which licenses your dependencies come with. Choose a license to see only the libraries under it, and open a row to see what requires a library, which is how you find out where it comes from.

The Dependencies page

The page reads the software bill of materials (SBOM) of your application, a CycloneDX file that your build generates. Spring Boot sets that up when the build applies the CycloneDX plugin (see SBOM in the Spring Boot documentation), and the file is then generated as part of your build. Without it, the Dev UI has no Dependencies page.

  • Gradle

  • Maven

plugins {
    id 'org.cyclonedx.bom' version '<version>'
}
<plugin>
    <groupId>org.cyclonedx</groupId>
    <artifactId>cyclonedx-maven-plugin</artifactId>
</plugin>

The page shows what the SBOM describes. Which libraries that covers, for example whether the ones used only during development are in it, depends on how your build configures the CycloneDX plugin.

Logs

The logs of your application are in a console at the bottom of every page. Click Logs to open or close it, and drag its top edge to change its height.

The log console

The console shows the most recent lines and follows the new ones as they are logged. You can filter the lines by level or by text, copy them, and clear them, for example before reproducing a problem. Click Loggers to change log levels on the Loggers page, with the console still open below it.

A line logged with an exception shows the exception below it. Click it to see its stack trace.

The log console

When your application restarts, the console keeps the lines of the run that ended and marks where the new one begins.

The console is available when your application logs with Logback, the default in Spring Boot. It keeps the last 2000 lines in memory.

Welcome and Error Pages

In an application that uses Spring MVC, the Dev UI replaces the whitelabel error page of Spring Boot with pages that help while you develop:

  • a welcome page at the root path, when your application serves nothing there yet. It confirms that your application is running and shows how to add a first endpoint;

  • a page for a path that doesn’t exist;

  • a page for a request that failed, with the exception and its stack trace.

The welcome page of a new application

Once your application has endpoints, the welcome page and the page for a path that doesn’t exist list them, so that a mistyped path is easy to spot.

The welcome page of an application with endpoints but nothing at its root path

The page for a failed request starts from the root cause: the exception at the origin of the failure, which is often wrapped in other exceptions. The frames of your application are highlighted in the stack trace.

The page for a failed request

These pages only take the place of the whitelabel error page. What your application defines is left as it is: a mapping or an index.html at the root path, an error template, a custom error view, or a custom error controller. A client that asks for JSON gets the error as JSON, as usual. The pages are only shown for requests that the Dev UI accepts (see Accessing the Dev UI), since the page for a failed request shows its stack trace.

To keep the whitelabel error page, set arconia.dev.ui.error-pages.enabled to false.

Accessing the Dev UI

The Dev UI only accepts requests that come from your own machine and are addressed to localhost, 127.0.0.1, or ::1. It rejects requests from other machines and requests addressed to any other host name. It also rejects requests sent by the pages of other websites, and of other applications on your machine, even when the CORS configuration of your application lets them read its responses.

A rejected request is reported in the log of your application, with the reason.

The Dev UI has no login, and the security of your application doesn’t apply to it. Its requests are handled before Spring Security and the other filters of your application, so the Dev UI is available whatever they do: ask for a login, resolve the current tenant, or reject a request they don’t recognize. Your application keeps its security configuration for all its own paths.

Applications That Run Somewhere Else

The Dev UI is for an application that runs on the machine you work on. When your application runs somewhere else, such as a container or a remote machine, requests that reach it through a published port or another host name are rejected.

What works is port forwarding that connects to localhost on the side of your application, as ssh -L 8080:localhost:8080 does. You then open http://localhost:8080/a/dev in your browser.

Proxies

The Dev UI rejects a request that carries a forwarded header (Forwarded, or one that starts with X-Forwarded-), because it was passed on by something else and could come from anywhere. So you cannot reach the Dev UI through a proxy that adds those headers: open it at the address of your application itself.

Another machine can’t pretend to be yours by putting your address or your host name in a header. That holds however your application handles forwarded headers (server.forward-headers-strategy).

Observability

The requests to the Dev UI are left out of the metrics and traces of your application. They are not requests to your application, and they would get in the way when you look at its telemetry. To include them, set arconia.dev.ui.observations.enabled to true.

Configuration Properties

Property Default Description

arconia.dev.ui.enabled

true

Whether to enable the Dev UI.

arconia.dev.ui.error-pages.enabled

true

Whether to show the welcome page and the error pages of the Dev UI in place of the whitelabel error page.

arconia.dev.ui.observations.enabled

false

Whether to include the requests to the Dev UI in the metrics and traces of the application.

Extending the Dev UI

Libraries can add their own pages and modules to the Dev UI, as Arconia Dev Services does. Learn how in Extending the Dev UI.