How to use lightstep-tracer - 5 common examples

To help you get started, we’ve selected a few lightstep-tracer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opentracing-contrib / javascript-express / test / server.js View on Github external
it("works with latest lightstep tracer", (done) => {
    const lsTracer = new LightStep.Tracer({
      access_token   : 'foo',
      component_name : 'bar',
    });
    const app = express();
    app.use(middleware({tracer: lsTracer}));

    var reqSpanPresent = false;
    app.get("/", (req, res) => {
      if (req.span) {
        reqSpanPresent = true;
      }
      res.send("Hello World!")
    });

    const server = app.listen(3000, (err) => {
      const opts = {
github opentracing-contrib / nginx-opentracing / example / zoo / node / server.js View on Github external
if (typeof program.data_root === 'undefined') {
  winston.error('no data_root given!');
  process.exit(1);
}

if (typeof program.access_token === 'undefined') {
  winston.error('no access_token given!');
  process.exit(1);
}

const databasePath = path.join(program.data_root, common.databaseName);
const imageRoot = path.join(program.data_root, '/images/');
const accessToken = program.access_token;

const tracer = new lightstep.Tracer(
    { access_token: accessToken, component_name: 'zoo' });
opentracing.initGlobalTracer(tracer);

const db = new sqlite3.Database(databasePath);
db.run('PRAGMA journal_mode = WAL');
db.configure('busyTimeout', 15000);

function onExit() {
  db.close();
  process.exit(0);
}
process.on('SIGINT', onExit);
process.on('SIGTERM', onExit);

const app = express();
app.use(tracingMiddleware.middleware({ tracer }));
github sourcegraph / sourcegraph-typescript / src / server / server.ts View on Github external
import { install } from './yarn'

const globalLogger = new RedactingLogger(console)

process.on('uncaughtException', err => {
    globalLogger.error('Uncaught exception:', err)
    process.exit(1)
})

const CACHE_DIR = process.env.CACHE_DIR || fs.realpathSync(tmpdir())
globalLogger.log(`Using CACHE_DIR ${CACHE_DIR}`)

let tracer = new Tracer()
if (process.env.LIGHTSTEP_ACCESS_TOKEN) {
    globalLogger.log('LightStep tracing enabled')
    tracer = new LightstepTracer({
        access_token: process.env.LIGHTSTEP_ACCESS_TOKEN,
        component_name: 'lang-typescript',
    })
}

const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 8080

let httpServer: http.Server | https.Server
if (process.env.TLS_CERT && process.env.TLS_KEY) {
    globalLogger.log('TLS encryption enabled')
    httpServer = https.createServer({
        cert: process.env.TLS_CERT,
        key: process.env.TLS_KEY,
    })
} else {
    httpServer = http.createServer()
github sourcegraph / sourcegraph / lsif / src / shared / tracing.ts View on Github external
}
): Tracer | undefined {
    if (useJaeger) {
        const config = {
            serviceName,
            sampler: {
                type: 'const',
                param: 1,
            },
        }

        return initTracerFromEnv(config, {})
    }

    if (lightstepAccessToken !== '') {
        return new lightstep.Tracer({
            access_token: lightstepAccessToken,
            component_name: serviceName,
        })
    }

    return undefined
}
github auth0 / auth0-instrumentation / lib / tracer_factory.js View on Github external
agentHost: env.TRACE_AGENT_HOST,
        agentPort: env.TRACE_AGENT_PORT,
      },
      sampler: {
        type: 'const',
        param: 1,
      }
    };
    const options = { logger: agent.logger };

    const tracer = jaegerClient.initTracer(config, options);
    return tracer;
  }
  if (env.TRACE_AGENT_CLIENT === constants.TRACER_LIGHTSTEP) {
    const lightstepClient = require('lightstep-tracer');
    const tracer = new lightstepClient.Tracer({
      access_token: env.TRACE_AGENT_API_KEY,
      component_name: serviceName
    });
    return tracer;
  }
  return stubs.tracer;
};

lightstep-tracer

> ❗ **This instrumentation is no longer recommended**. Please review [documentation on setting up and configuring the OpenTelemetry Node.js Launcher](https://github.com/lightstep/otel-launcher-node) or [OpenTelemetry JS (Browser)](https://github.com/open-

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis

Popular lightstep-tracer functions

Similar packages