Now that you have an account and projects, it’s time to get data from your app into Lightstep. Lightstep supports OpenTracing, a way 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.

There are two basic types of instrumentation: using an auto-installer to instrument your framework and using the APIs to instrument operations inside your services. Instrumenting your framework generally means that an agent or wrapper instruments RPC frameworks, clients and other common libraries, either by modifying code at runtime or by integrating like a plug-in as a dependency to your existing frameworks and libraries. This type of instrumentation basically provides observability into a request as it travels from service to service. Instrumenting your inside your services provides observability into the operations within the service. You’ll likely need to do both to get the granular observability needed to take full advantage of the root cause analysis and performance monitoring in Lightstep.

Best Practice: Start with instrumenting at the framework level. This often requires no code changes at the service level (depending on the language) and is a quick way to start. Once that’s in place, you’ll be able to see where the blind spots are in your system and you can start adding service-level instrumentation as needed.

Want to use OpenTelemetry instead? Read these docs to get started!

Instrument with OpenTracing

Read the Quick Start guide for the language you’re interested in to create a simple span in your service. Many of these Quick Starts instrument at the framework level.

If you’re using the Hipster Shop, you can see how OpenTracing was implemented in most services.

The Hipster Shop supports a number of different tracing specifications and implementations, along with OpenTracing.

  • C++: Service-level instrumentation
  • C#/.NET: Auto-installer for the .NET framework
  • Golang: Service-level instrumentation
  • Java: Java SpecialAgent installer for many framework libraries
  • JavaScript/Node: Auto-installer for the Node framework
  • Objective-C/Swift: Service-level instrumentation
  • PHP: Service-level instrumentation
  • Python: Auto-installer for many frameworks, data stores, and libraries
  • Ruby: Auto-installer for many libraries

Now that you’ve instrumented a service (or if using the Hipster Shop, seen how services can be instrumented), it’s time to view the telemetry data in Lightstep.

What Did We Learn?

  • There are two basic ways to add instrumentation - using an auto-installer to instrument at the framework level, and using the API at the service level.
  • Best practice is to start with instrumenting the framework (where available) and then add service-level instrumentation where needed.