jaeger-auto

0.0.2 • Public • Published

Jaeger-auto

Small wrapper around @risingstack/opentracing-auto and jaeger-client

Why

Extreme lazyness.

Example

'use strict'
const { initTracer } = require('jaeger-auto')
initTracer('awesome-service', {
  type: 'service',
  environment: process.env.NODE_ENV,
  'awesome-service.version': "some-git-hash"
})
 
const express = require('express')
 
 
// Somewhere else in your code
const { getTracer } = require('jaeger-auto')
const tracer = getTracer()
 
function soemthingImportant() {
  // Let's add a child span to the current tracing context
  let span = tracer.startChildSpan(tracer, 'something_important')
  asyncFunction((err, result) => {
    if (err) {
      span.setTag("error",true) 
    }
    span.finish()
  })
 
}

Package Sidebar

Install

npm i jaeger-auto

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

3.37 kB

Total Files

4

Last publish

Collaborators

  • fatmatto