zipkin-instrumentation-mysql2
v1.0.1
Published
Interceptor for mysql2 clients
Downloads
516
Readme
zipkin-instrumentation-mysql2
This library is a wrapper for mysql2 for zipkin.
Usage
const { Tracer } = require('zipkin')
const mysql2 = require('mysql2')
const zipkinClient = require('zipkin-instrumentation-mysql2')
const tracer = new Tracer({ctxImpl, recorder}) // configure tracer here
const wrappedMysqlClient = zipkinClient(mysql2, tracer)
const connOptions = {
user: 'myuser',
password: 'pass',
host: 'localhost',
database: 'dbname',
}
const client = wrappedMysqlClient.createConnection(connOptions)
// Add your code here
client.query('SELECT 1+1 as two, NOW() as `now`', (err, result, fields) => {
console.log(err, result, fields)
})
Thanks
Thanks to juspay for juspay/zipkin-instrumentation-mysql