Giter VIP home page Giter VIP logo

java-jfr-tracer's Introduction

Build Status

JFR Tracer

This is a delegating tracer to be used with OpenTracing. It records span and scope information into the JDK Flight Recorder, enabling very deep tracing capabilities.

Using the JFR Tracer

First add a dependency to it. For example, in Maven (note that this version has not been released yet, we're waiting for opentracing v0.32.0 to come on line):

	<dependency>
		<groupId>io.opentracing.contrib</groupId>
		<artifactId>opentracing-jfr-tracer</artifactId>
		<version>0.0.4</version>
	</dependency>

Next, in whatever code you use to set up the OpenTracing tracer, wrap your tracer in the JFR tracer:

GlobalTracer.register(
	JfrTracerFactory.create(yourFavouriteTracer));

Supported Tracers

The JFR tracer supports all tracers that support OpenTracing 0.32.0 or later.

Supported Java Versions

The JFR tracer supports running on Oracle JDK 8+ (except Oracle JDK 9 and 10) and OpenJDK 11+.

Example

An example app with OpenTracing enabled, and which is using the JFR tracer, can be found here: https://github.com/thegreystone/problematic-microservices

Building

To build the JFR Tracer, and install it into the local maven repo, first ensure that you have installed an Oracle JDK 8, and an Open JDK 11. These will be required to build the tracer. Once built, the tracer can be used with Oracle JDK 8+ (except Oracle JDK 9 and 10), and OpenJDK 11+.

Ensure that the following two environment variables are set to the JAVA_HOME of the JDKs:

JAVA_8
JAVA_11

Once that is done, simply run:

./gradlew publishToMavenLocal

Note that you will need to have an Oracle JDK 8 and an OpenJDK (or Oracle JDK) JDK 11 available. Parts of the code will be compiled using JDK 8 and parts using JDK 11. Note that the resulting MRJAR will run on Oracle JDK 8 and later, and OpenJDK (or Oracle JDK) 11 and later.

About

This tracer was built for Code One 2018 as an example of using JFR and OpenTracing together to provide cross process, and when needed very deep, tracing capabilities, using open source technologies.

If you find this project useful, please consider contributing.

java-jfr-tracer's People

Contributors

thegreystone avatar sfriberg avatar mirage22 avatar gunlee01 avatar stefvic avatar

Watchers

Vinod Vydier 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.