GithubHelp home page GithubHelp logo

isabella232 / smallrye-opentracing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smallrye/smallrye-opentracing

0.0 0.0 0.0 319 KB

An MicroProfile-OpenTracing implementation

Home Page: https://www.smallrye.io/

License: Apache License 2.0

Java 98.76% Shell 1.24%

smallrye-opentracing's Introduction

badge Quality Gate Status License smallrye opentracing?color=green

SmallRye OpenTracing

SmallRye OpenTracing is an implementation of https://github.com/eclipse/microprofile-opentracing meant to be reusable for different vendors.

How to use

The following components have to be added to deployment to pass microprofile-opentracing-tck:

Server side JAX-RS

Server side JAX-RS tracing integration is provided by JAX-RS SmallRyeTracingDynamicFeature and servlet filter SpanFinishingFilter which finishes the span started in JAX-RS filter.

The installation is JAX-RS and server implementation specific. For example in RestEasy DynamicFeature it can be enabled by specifying resteasy.providers in servlet context init parameters. The following code snippet demonstrates possible installation.

public class ServletContextTracingInstaller implements ServletContextListener {

  @Override
  public void contextInitialized(ServletContextEvent servletContextEvent) {
    ServletContext servletContext = servletContextEvent.getServletContext();
    servletContext.setInitParameter("resteasy.providers", SmallRyeTracingDynamicFeature.class.getName());

    Dynamic filterRegistration = servletContext.addFilter("tracingFilter", new SpanFinishingFilter());
    filterRegistration.setAsyncSupported(true);
    filterRegistration.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "*");
  }
}

Client side JAX-RS

Vendor has to implement ClientTracingRegistrarProvider and specify it in META-INF/services/org.eclipse.microprofile.opentracing.ClientTracingRegistrarProvider.

This project provides SmallRyeClientTracingFeature with tracing integration. The feature has to be registered to ClientBuilder in vendor specific implementation of ClientTracingRegistrarProvider. Client side tracing usually requires more components, for example OpenTracing-aware AsyncExecutor.

MicroProfile Rest Client

The Rest Client instrumentation is provided in SmallRyeRestClientListener which has to be registered in META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientListener.

CDI

The @Traced aspects of the specification is provided by the OpenTracingInterceptor, from the OpenTracing Contrib Java Interceptors project.

Tracer producer

Vendor has to provide CDI tracer producer. It is not provided by this library as the tracer resolution is not defined by MicroProfile specification.

Develop

mvn clean install

Debug

Debug of the deployment can be enabled in arquillian.xml configuration file.

Run the following to debug tests on port 8788.

mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8788 -Xnoagent -Djava.compiler=NONE" test

smallrye-opentracing's People

Contributors

dengliming avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar jmartisk avatar jpkrohling avatar kenfinnigan avatar ladicek avatar pavolloffay avatar radcortez avatar smallrye-ci avatar xstefank 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.