No description, website, or topics provided.
Java Groovy Kotlin
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.editorconfig see vert-x3/issues#122 Oct 13, 2016
.gitignore Ignore IDE files Nov 13, 2015
LICENSE.txt Create LICENSE.txt Jun 21, 2016
README.adoc update doc May 7, 2016
log-test.properties Add sender logging for tests Dec 11, 2015
pom.xml

README.adoc

vertx-hawkular-metrics

icon?job=vert

About

The Vert.x Metrics SPI allows implementers to capture events from Vert.x in order to gather metrics.

This project is an Hawkular implementation of the Vert.x Metrics SPI: metrics built from Vert.x events will be sent to an Hawkular Metrics service.

Quickstart

Note
You can use a standalone Hawkular Metrics server as well.

Then clone this project and build it:

git clone https://github.com/vert-x3/vertx-hawkular-metrics.git
cd vertx-hawkular-metrics
mvn clean install

Once the project is built, add the dependency to your Vert.x 3 project. For Maven based projects:

<parent>
 <groupId>org.hawkular</groupId>
 <artifactId>vertx-hawkular-metrics</artifactId>
 <version>3.2.0-SNAPSHOT</version>
</parent>

Then, you must enable Vert.x Metrics:

VertxHawkularOptions vertxHawkularOptions = new VertxHawkularOptions();
vertxHawkularOptions.setEnabled(true); // By default Vert.x Metrics is disabled

VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setMetricsOptions(vertxHawkularOptions);

Vertx vertx = Vertx.vertx(vertxOptions);

Full samples can be found in the org.hawkular.vertx.monitor.examples package.

Configuration

Here’s how to configure Vert.x Hawkular Metrics

VertxHawkularOptions vertxHawkularOptions = new VertxHawkularOptions() (1)
        .setHost("localhost") (2)
        .setPort(8080) (3)
        .setTenant("default") (4)
        .setPrefix("instance1") (5)
        .setSchedule(3); (6)
vertxHawkularOptions.setEnabled(true); (7)

vertxHawkularOptions.addDisabledMetricsType(MetricsType.NET_SERVER); (8)

VertxOptions vertxOptions = new VertxOptions()
        .setMetricsOptions(vertxHawkularOptions); (9)

Vertx vertx = Vertx.vertx(vertxOptions); (10)
  1. VertxHawkularOptions extends io.vertx.core.metrics.MetricsOptions

  2. Host of the Hawkular Metrics server, defaults to localhost

  3. Port of the Hawkular Metrics server, defaults to 8080

  4. The Hawkular tenant, defaults to default

  5. Metrics prefix used to build series name (for example marseille02.rack13.web043), empty by default

  6. How often (in seconds) metrics will be collected and sent to the Hawkular server, defaults to 1 second

  7. The Vert.x Metrics SPI is disabled by default, so make sure to enable it

  8. Disable unwanted metrics by adding the type of the metrics into a set, defaults to an empty set. Available Types : NET_SERVER, NET_CLIENT, HTTP_SERVER, HTTP_CLIENT, DATAGRAM_SOCKET, EVENT_BUS.

  9. Add your VertxHawkularOptions to the io.vertx.core.VertxOptions

  10. Create the Vert.x instance

Limitations

It’s not possible yet to disable individual metrics.

The collection interval is a global setting. In the future, it should be possible to assign a schedule for all metrics of a resource (net server, http server, event bus), or for a single metric.

Contributing

Want to contribute? Great! Join us in #vertx or #hawkular rooms on Freenode.

License

Source available under the terms of the Eclipse Public License v1.0 and Apache License v2.0.

The Eclipse Public License is available at: http://www.eclipse.org/legal/epl-v10.html

The Apache License v2.0 is available at: http://www.opensource.org/licenses/apache2.0.php

You may elect to redistribute this code under either of these licenses.