Git Product home page Git Product logo

java-grizzly-http-server's Introduction

OpenTracing Grizzly HTTP Server Instrumentation

OpenTracing instrumentation for Grizzly HTTP Server.

OpenTracing Agents

When using a runtime agent like java-agent or java-specialagent TCPNIOTransports will be automatically instrumented as long as their FilterChain contains an HttpServerFilter. This is the case with the plain HttpServer through its constructor or HttpServer.createSimpleServer static factory methods:

HttpServer httpServer = new HttpServer();
NetworkListener listener = new NetworkListener("grizzly", "localhost", "8080");
httpServer.addListener(listener);
httpServer.start();

or

HttpServer httpServer = HttpServer.createSimpleServer();
httpServer.start();

Alternatively, chains created directly will also be instrumented automatically under the same condition:

FilterChainBuilder filterChainBuilder = FilterChainBuilder.stateless();

filterChainBuilder.add(new TransportFilter());
filterChainBuilder.add(new HttpServerFilter());
filterChainBuilder.add(new SomeWorkerFilter());

TCPNIOTransport transport = TCPNIOTransportBuilder.newInstance().build();
transport.setProcessor(filterChainBuilder.build());
transport.bind("localhost", "8080");
transport.start();

Refer to the agents' documentation for how to include this library as an instrumentation plugin.

Non-Agent Configuration

When not using any of the OpenTracing Agents the traced filter chain instance must be instantiated directly. Use of the plain HttpServer without a runtime Agent is not currently supported.

FilterChainBuilder filterChainBuilder = new TracedFilterChainBuilder();

filterChainBuilder.add(new TransportFilter());
filterChainBuilder.add(new HttpServerFilter());
filterChainBuilder.add(new SomeWorkFilter());
...

java-grizzly-http-server's People

Contributors

jam01 avatar safris 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.