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

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

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. This type of instrumentation provides observability into a request as it travels from service to service. Change Intelligence uses that telemetry to understand when performance changes correlate with metric deviations. Attributes on the traces help you pinpoint where the change ocurred.

Using a different language? You can still get started quickly.

Configure

Configure OpenTelemetry with the name of the service that you’d like to report tracing data from, an access token, and optionally the Microsatellite endpoint.

Start tabs

Public Microsatellites

1
2
export LS_SERVICE_NAME=your_service_name
export LS_ACCESS_TOKEN=your_access_token

On-Premise Microsatellites

1
2
3
4
5
6
7
8
export LS_SERVICE_NAME=your_service_name
# The access token can be omitted for Microsatellites running in single-project mode.
export LS_ACCESS_TOKEN=your_access_token
# For Java, Python, and Go use: https://ingest.lightstep.com:443
# For Node.js use: https://ingest.lightstep.com:443/traces/otlp/v0.6
export OTEL_EXPORTER_OTLP_SPAN_ENDPOINT=your_satellite_endpoint
# If your Microsatellites don't have TLS enabled, uncomment the following line.
# export OTEL_EXPORTER_OTLP_SPAN_INSECURE=true

Developer Mode

1
2
3
4
5
export LS_SERVICE_NAME=your_service_name
# for Java, Python, and Go use: https://localhost:8360
# for Node.js, also include the path: https://localhost:8360/traces/otlp/v0.6
export OTEL_EXPORTER_OTLP_SPAN_ENDPOINT=https://localhost:8360
export OTEL_EXPORTER_OTLP_SPAN_INSECURE=true

End code tabs

Install Instrumentation

Start by installing the Lightstep OpenTelemetry launcher for your language. Lightstep’s launchers package all of the necessary OpenTelemetry dependencies with a configuration layer to ease setup.

Then begin collecting traces! In Java, Javascript, and Python, OpenTelemetry has built-in instrumentation for popular libraries, so that you can get tracing data without needing to add any tracing code.

Start tabs

Java

1
2
3
4
# Install the OpenTelemetry Java Agent
curl -L "https://github.com/lightstep/otel-launcher-java/releases/latest/download/lightstep-opentelemetry-javaagent.jar" > lightstep-opentelemetry-javaagent.jar
# Run your application with the agent
java -javaagent:path/to/lightstep-opentelemetry-javaagent.jar -jar myapp.jar

Node.js

1
2
3
4
5
6
7
8
9
10
11
// In a shell, run:
// $ npm install lightstep-opentelemetry-launcher-node --save

// In your application code:
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');
});

Python

1
2
3
4
5
6
7
8
9
# This install requires gcc and gcc-c++, which you may need to install if you're
# running a slim version of Linux (e.g., CentOS):
# yum -y install python3-devel
# yum -y install gcc-c++
pip install opentelemetry-launcher
# Detect installed libraries and install relevant instrumentation.
opentelemetry-bootstrap -a install
# Run your application
opentelemetry-instrument python your_app.py

Go

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// In a shell, run:
// $ go get 'github.com/lightstep/otel-launcher-go/launcher'

package main
// In your application code:
import (
   "context"
   "github.com/lightstep/otel-launcher-go/launcher"
   "go.opentelemetry.io/otel"
)

func main() {
    otelLauncher := launcher.ConfigureOpentelemetry()
    defer otelLauncher.Shutdown()

    tracer := otel.Tracer("example")
    _, span := tracer.Start(context.Background(), "main")
    defer span.End()
}

End code tabs


What Did We Learn?

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