Giter Club home page Giter Club logo

vibe's Introduction

Vibe is a simplistic approach to Java application monitoring.

Licensed under Apache 2.0.

Current version

There is currently no release available. See Other Notes for how you can use snaphots.

Using Maven:

<dependency>
	<groupId>se.l4.vibe</groupId>
	<artifactId>vibe-api</artifactId>
	<version>version</version>
</dependency>

Creating a new instance

First create a Vibe instance:

Vibe vibe = DefaultVibe.builder()
	.setSampleInterval(10, TimeUnit.SECONDS)
	.build();

Exporting probes

Export a few things:

vibe.timeSeries(JvmProbes.cpuUsage())
	.at("jvm/cpu")
	.export();

Handle events

Events<UnauthorizedAccess> events = vibe.events(UnauthorizedAccess.class)
	.severity(EventSeverity.WARN)
	.create();

events.register(new UnauthorizedAccess(someImportantInfo));

Automatically trigger events

Time series can have triggers:

vibe.timeSeries(JvmProbes.cpuUsage())
	.at("jvm/cpu")
	.when(averageOver(5, TimeUnit.MINUTES), above(0.9))
		.sendEvent(EventSeverity.CRITICAL)
	.export();

This will trigger a critical event (at the same path as the series) if the average CPU usage over five minutes exceeds 90%.

It is possible to use a trigger on an automatically calculated value:

vibe.timeSeries(JvmProbes.totalUsedMemory())
	.at("jvm/mem/total")
	.when(changeAsFraction(), on(averageOver(5, TimeUnit.MINUTES)), above(0.1))
		.sendEvent(EventSeverity.WARN)
	.export();

This will create a trigger that will be activated if the average value over 5 minutes changes more than 10%.

Timing calls

Vibe supports timing of actions, such as monitoring the time it takes for your application to handle a request.

To create a timer:

Timer timer = vibe.timer()
	.at("web/requests")
	.withBuckets(0, 50, 100, 200, 500, 1000) // for calculating percentiles
	.export();

To use a timer:

Stopwatch stopwatch = timer.start();
try {
	// Code to measure here
} finally {
	stopwatch.stop();
}

System probes

Vibe can monitor the system it runs on via the use of Sigar.

<dependency>
	<groupId>se.l4.vibe</groupId>
	<artifactId>vibe-sigar</artifactId>
	<version>current version</version>
</dependency>

Create probes for the system via SigarProbes

Send e-mail on events

When you have configured a set of time series and triggers for those you can configure an e-mail backend so that you will receive notifications when things go wrong.

First include the backend:

<dependency>
	<groupId>se.l4.vibe</groupId>
	<artifactId>vibe-backend-mail</artifactId>
	<version>current version</version>
</dependency>

Build a backend with the builder:

MailBackend backend = MailBackend.builder()
	.setSender("[email protected]")
	.setSmtpServer("smtp.example.org")
	.setSubject("{severity} event for {path}")
	.setMinimumSeverity(EventSeverity.WARN)
	.addRecipient("[email protected]")
	.build();

Other notes

The current development version can also be accessed via a Maven snapshot repository. Include the following in your POM:

If you want to you can include this repository to use snapshot releases:

<repository>
	<releases>
		<enabled>false</enabled>
	</releases>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
	<id>sonatype-nexus-snapshots</id>
	<name>Sonatype Nexus Snapshots</name>
	<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

vibe's People

Contributors

aholstenson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.