Code Monkey home page Code Monkey logo

java-jdbi's Introduction

java-jdbi's People

Contributors

bensigelman avatar bhs avatar jlleitschuh avatar malafeev avatar sjoerdtalsma avatar usulkies avatar ygaller avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

java-jdbi's Issues

Make this a JDBI3 Plugin

Having a JDBI3 plugin makes the usage much simpler:

Be sure to call Jdbi.installPlugins() upon initialization and all requests will be traced.

The plugin can have a customizeJdbi method that adds the JDBI3 timing collector to the configuration.

JDBI3: Replace TimingCollector by SqlLogger if available

JDBI3 deprecated the use of its TimingCollector.

I created a OpenTracingSqlLogger on the same principle as the current timing collector and have the following code in my JDBI3 plugin:

public class OpentracingJdbi3Plugin implements JdbiPlugin {
    private static final Logger LOGGER = Logger.getLogger(OpentracingJdbi3Plugin.class.getName());

    @Override
    public void customizeJdbi(Jdbi jdbi) {
        try {
            OpentracingSqlLogger.configure(jdbi);
        } catch (LinkageError sqlLoggerApiUnavailable) {
            LOGGER.log(Level.WARNING, sqlLoggerApiUnavailable,
                    () -> "Could not configure Opentracing SqlLogger implementation. " +
                            "Are you using JDBI version 3.2 or greater?");
            OpentracingTimingCollector.configure(jdbi);
        }
    }

As you can see it uses the new SqlLogger JDBI3 api if available but falls back on the (deprecated) TimingCollector variant without using reflection.

Created span is not in scope

Hi all,

I was looging at the code and noticed that in OpenTracingCollector.java#L101, the span is started but not put in scope.

I have a use case where we are developping a jdbc driver with native opentracing support. Therefore, when a span is created and started in the driver, it does not register as a child of the jdbi span.

Does it make sense to you to have the jdbi span in scope ?

Thanks and great work !

Separate java-jdbi3 module?

Should we make this contrib repo a multi-module repository to release separate

  • jdbi-opentracing and
  • jdbi3-opentracing

maven artifacts?

The split package structure kind of feels 'wrong' and I think having JDBI as provided dependency also feels wrong. JDBI is a transient dependency for this module and ought to be declared as such.

I'm willing to create a PR for this if there is demand for it.

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.