Giter Club home page Giter Club logo

opentracing-p6spy's Introduction

Build Status

opentracing-p6spy

OpenTracing instrumentation for p6spy

Installation

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-p6spy</artifactId>
    <version>0.0.1</version>
</dependency>

build.gradle

compile 'io.opentracing.contrib:opentracing-p6spy:0.0.1'

Usage

If you don't already have one, create a spy.properties file on your resource folder (ie src/main/resources)

Add the tracing module in your list

modulelist=io.opentracing.contrib.p6spy.TracingP6SpyFactory
tracingPeerService=token_database

tracingPeerService is used to set the peer.service value as defined here.

spy.properties is set globally to all instrumented connections. This can be limitating especially in environment accessing many databases. To overcome this, you can optionally set the tracingPeerService in the jdbc url :

jdbc:p6spy:mysql://localhost/tk_db?tracingPeerService=token_database

This will override spy.properties.

In case you only want to trace calls when there is an active span, use traceWithActiveSpanOnly:

jdbc:p6spy:mysql://localhost/tk_db?traceWithActiveSpanOnly=true

Beware that some JDBC drivers do not support adding unknown properties.

Tips when using it in JavaEE application servers. If you happen to deploy many applications within the same application server, add the jmxPrefix to avoid jmx name conflict :

modulelist=io.opentracing.contrib.p6spy.TracingP6SpyFactory
tracingPeerService=token_database
jmxPrefix=authentication_service

You can find more info on p6spy here

Tracing tags

The following tags are added to traces :

Span tag name Notes
span.kind client
component java-p6spy
peer.service if exists, the peer service name set in spy.properties or within the jdbc url using tracingPeerService
error true is any error occurred. false otherwise
db.type the authoritative part of the jdbc url (ex : mysql in jdbc:mysql://localhost)
db.statement the SQL query
db.instance the connection's catalog (can be a database name or a schema)
db.user if exists, the user name

opentracing-p6spy's People

Watchers

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