• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Administration console for Vert.x applications - GSoC '17

Vert.x Console

Release

This is a configurable, extensible administration console for Vert.x applications that provides a web interface for common administration and monitoring tasks. A video demo is available here. The backend component requires Vert.x-Web.

The frontend uses the PatternFly CSS framework with Vue.js components and the axios HTTP client. Note that there is no requirement for console pages to be written with Vue, simply exporting a Vue-compatible render function and appropriate mounted and destroyed methods (referencing this.$el) will allow you to use any framework you wish.

To use, merge the following into your POM (or the equivalent into your Gradle build script):

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<properties>
    <vertx.console.version>ed3ad105f3</vertx.console.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-base</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>
    <!-- Insert console pages here, e.g. -->
    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-services</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>
</dependencies>

Then, create a WebConsoleRegistry in your application with a specified path, add the pages you wish to display, and mount it to a router:

// Example with several pages loaded
WebConsoleRegistry.create("/admin")
        // Add pages
        .addPage(MetricsConsolePage.create(dropwizardRegistry))
        .addPage(ServicesConsolePage.create(discovery))
        .addPage(LoggingConsolePage.create())
        .addPage(CircuitBreakersConsolePage.create())
        .addPage(ShellConsolePage.create())
        .addPage(HealthConsolePage.create(healthChecks))
        .setCacheBusterEnabled(true) // Adds random query string to scripts
        // Mount to router
        .mount(vertx, router);

The available pages and their setup instructions are listed below.

For security reasons, you should set up an authentication mechanism and CSRF handler for the /admin/* route. See Vert.x Web documentation for details (regarding auth, regarding CSRF protection). Also consider enabling gzip compression in production, as it could potentially reduce bandwidth usage by a sizable amount.

The console will be accessible at the specified path (/admin in this example).

vertx-console-metrics

This page displays an overview of your application, and includes several important metrics (heap usage, HTTP requests, event bus, etc...) as well as the ability to deploy verticles. It requires the following dependencies (note: the versions listed may not be the most recent, you can use newer versions):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-metrics</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>
    <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dropwizard-metrics</artifactId>
        <version>3.5.4</version>
    </dependency>
    <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_hotspot</artifactId>
        <version>0.0.23</version>
    </dependency>
    <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_dropwizard</artifactId>
        <version>0.0.23</version>
    </dependency>
    <dependency>
        <groupId>com.github.yunyu</groupId>
        <artifactId>prometheus-jvm-extras</artifactId>
        <version>1.2-SNAPSHOT</version>
    </dependency>

Once these have been added, enable metrics when starting your application and set a name for the registry. For example, you can add the following flags:

-Dvertx.metrics.options.enabled=true -Dvertx.metrics.options.registryName=vertx-dw

Then, acquire a reference to the metrics registry to create the page. For example:

    MetricRegistry dropwizardRegistry = SharedMetricRegistries.getOrCreate(
            System.getProperty("vertx.metrics.options.registryName") // or use hardcoded name
    );
    // Set up web console registry
    webConsoleRegistry.addPage(MetricsConsolePage.create(dropwizardRegistry));

If you are not using the Vert.x launcher to start your application, you may need to pass the metrics flags into DropwizardMetricsOptions on startup.

The metrics page uses the default Prometheus registry. If you wish to use it with another registry, register the appropriate collectors as listed here, and use MetricsConsolePage.create(CollectorRegistry myPrometheusRegistry).

vertx-console-services

This page displays a filterable list of the service records available to Vert.x. It requires the following dependency (assuming that you have already set up service discovery):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-services</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once these have been added, pass your service discovery instance to the console page. For example:

    // ServiceDiscovery discovery = ...
    // Set up web console registry
    webConsoleRegistry.addPage(ServicesConsolePage.create(discovery));

vertx-console-logging

This page allows you to view and configure loggers and their outputs. It is currently only compatible with Logback and SLF4J (due to difficulties with integrating appenders with Log4J2). It requires the following dependency (assuming that you already have Logback and SLF4J configured in your application):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-logging</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once this has been added, you can add the console page directly. For example:

    // Set up web console registry
    webConsoleRegistry.addPage(LoggingConsolePage.create());

vertx-console-circuit-breakers

This page allows you to view the status of the circuit breakers in your application. It requires the following dependency (assuming that you have already set up circuit breakers):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-circuit-breakers</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once this has been added, you can add the console page directly. For example:

    // Set up web console registry
    webConsoleRegistry.addPage(CircuitBreakersConsolePage.create());

vertx-console-shell

This page allows you to administer your application via Vert.x-Shell. It requires the following dependencies (note: the versions listed may not be the most recent, you can use newer versions):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-shell</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>
    <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-shell</artifactId>
        <version>3.5.4</version>
    </dependency>

Once these have been added, you can add the console page directly. For example:

    // Set up web console registry
    webConsoleRegistry.addPage(ShellConsolePage.create());

vertx-console-health

This page allows you to view the status of the health checks in your application. It requires the following dependency (assuming that you have already set up health checks):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-health</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once these have been added, pass your health checks instance to the console page. For example:

    // Set up web console registry
    webConsoleRegistry.addPage(HealthConsolePage.create(healthChecks));

vertx-console-pools

This page allows you to view the status of the worker and data source pools in your application. You need to have a working metrics setup in order to use it (see the vertx-console-metrics section for details), but adding the Overview page is optional. It requires the following dependency (on top of the ones necessary for metrics):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-pools</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once these have been added, pass your MetricsService instance to the console page. For example:

    // Set up web console registry
    MetricsService metricsService = MetricsService.create(vertx);
    webConsoleRegistry.addPage(PoolsConsolePage.create(metricsService));

vertx-console-eventbus

This page provides an overview of the event bus activity in your application, with message rates for monitored addresses (see setup instructions). It requires the following dependency (on top of the ones necessary for metrics):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-eventbus</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once these have been added, pass your MetricsService instance to the console page. For example:

    // Set up web console registry
    MetricsService metricsService = MetricsService.create(vertx);
    webConsoleRegistry.addPage(EventBusConsolePage.create(metricsService));

vertx-console-http-clients

This page provides an overview of the HTTP clients that are used in your application. It requires the following dependency (on top of the ones necessary for metrics):

    <dependency>
        <groupId>com.github.yunyu.vertx-console</groupId>
        <artifactId>vertx-console-http-clients</artifactId>
        <version>${vertx.console.version}</version>
    </dependency>

Once these have been added, pass your MetricsService instance to the console page. For example:

    // Set up web console registry
    MetricsService metricsService = MetricsService.create(vertx);
    webConsoleRegistry.addPage(HttpClientsConsolePage.create(metricsService));

API

Javadocs for the latest version are available on JitPack.

If you are developing a console page, please see the example project template.

More Repositories

1

parse-prometheus-text-format

JavaScript parser for the Prometheus metrics text format
JavaScript
37
star
2

OSXRealtekWifiIcons

Consistent status bar icons for Realtek-based (TP-Link, Edimax) wifi dongles on macOS
Shell
35
star
3

SpeechDrop

Fast and efficient document sharing for debate
Java
22
star
4

vu-registration-node

Gain a massive timing advantage when registering for courses in Vanderbilt's YES
JavaScript
11
star
5

tiger-vscode

Tiger language support for Visual Studio Code
6
star
6

tiger-sublime

ST3 syntax file for the Tiger programming language
3
star
7

vu-yes-selenium

Automate clicking things when registering for courses
Python
3
star
8

vertx-twitter-wall

GSoC 2017 prerequisite project for Vert.x
Java
3
star
9

advent-of-code-2018

ReasonML solutions for Advent of Code 2018 (through day 14)
OCaml
3
star
10

react-direct-include-boilerplate

Directly include React and Babel with just script tags - no NPM, Node, or build tools needed (for learning purposes only)
HTML
2
star
11

vertx-console-example

Example page for Vert.x Console
JavaScript
2
star
12

personal-site

My personal website
OCaml
1
star
13

caldera-examples

[Dependencies not published] Example apps for Caldera renderer
TypeScript
1
star
14

vu-campus-dining-fix

Xposed module to patch the Vanderbilt campus dining app
Java
1
star
15

vertx-console-shell

Shell page for Vert.x console
JavaScript
1
star
16

vertx-console-base

JavaScript
1
star
17

prometheus-jvm-extras

Metrics that should be in Prometheus' Hotspot/Vert.x/Dropwizard exports but aren't
Java
1
star
18

onecolor-oneplus-widget

Modded version of the OnePlus Widget with red "1" accent removed
Shell
1
star