Git Product home page Git Product logo

prometheus_auto_timing's Introduction

prometheus_auto_timing

Prometheus is nice open-source monitoring tools which covers applications and infrastructures. Prometheus has many client libraries that matches the language in which your application is written.(See here).

Prometheus client libraries include Java client library which supports spring framework, spring boot. The instrument by Spring AOP is nice solution, however, it is a lot of cost to implement for collecing duration metrics of all methods in all RestController or Controller classes.

This repository is a spring boot library for this solution to make it easy and simple. You only add dependency and one annotation, then, you can collect the duration metrics of all methods in all RestController or Controller classes.

How to use

Now, this library is not uploaded in maven repository.(You make issue if you want. I'll upload soon.)

As a temporary measure, you must install library as follows.

$ git clone https://github.com/aha-oretama/prometheus_auto_timing.git
$ cd prometheus_auto_timing.git
$ mvn install

You only add dependency.

		<dependency>
			<groupId>jp.aha-oretama</groupId>
			<artifactId>prometheus_auto_timing</artifactId>
			<version>0.1.0-RELEASE</version>
		</dependency>

And you only add one annotaion @EnablePrometheusAutoTiming.

@SpringBootApplication
@EnablePrometheusEndpoint
@EnableSpringBootMetricsCollector
@EnablePrometheusAutoTiming
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}

Notification: You do not need to implement for collecting duration metrics of all methods in all RestController or Controller classes, but you need to implement for exposing prometheus API by spring boot. It is realised by simpleclient_spring_boot.

prometheus_auto_timing's People

Contributors

aha-oretama avatar

Watchers

 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.