Lightstep supports OpenTelemetry to get telemetry data (traces, logs, and metrics) from your app as requests travel through its many services and other infrastructure.

OpenTelemetry provides a single set of APIs, libraries, and instrumentation resources to capture distributed traces and metrics from your applications. Lightstep provides Launchers that install OpenTelemetry and capture telemetry from popular libraries and frameworks already installed in your system, with only one line of code needed. Our Launchers automate your instrumentation efforts to give you the power of Lightstep in under five minutes.

When you add (or have) a call from your service to Rollbar, the plugin automatically generates a span that captures the request.

If you’ve never instrumented for observability, read Understand Distributed Tracing for some background knowledge.

Configure OpenTelemetry

To report data to Lightstep, you’ll need:

To configure OpenTelemetry, set environment variables with the name of the service that you’d like to report tracing data from and the Lightstep access token.

This Learning Path uses the Public Microsatellites. You can also use a Developer Satellite or if your organization already has them, your On-Premise Microsatellites.

Start tabs

Public Microsatellites

1
2
export LS_SERVICE_NAME=<YOUR_SERVICE_NAME>
export LS_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>

End code tabs

Install OpenTelemetry Instrumentation

Install the Lightstep OpenTelemetry launcher for Node.js. Lightstep’s launcher packages all of the necessary OpenTelemetry dependencies with a configuration layer to ease setup.

  1. In a shell, run: $ npm install lightstep-opentelemetry-launcher-node --save

  2. In your service’s code, add the following.

Start tabs

Node.js

1
2
3
4
5
6
7
const { lightstep, opentelemetry } = require("lightstep-opentelemetry-launcher-node");
      
lightstep.configureOpenTelemetry().start().then(() => {
  // All of your application code and any imports that should
  // leverage OpenTelemetry instrumentation must go here; e.g.,
  // const express = require('express');
});

End code tabs

Add a Call to Rollbar

If you don’t already have one, add a call from your Node.js service to Rollbar.

Here’s an example that queries Rollbar using the Rollbar Javascript SDK.

1
2
rollbar.error('Undercooked Donut Error');


What Did We Learn?

  • Lightstep has Launchers for OpenTelemetry that let you instrument your service with a single line of code.