Announcing Lua OpenTracing

Ryan Burn
OpenTracing
Published in
1 min readAug 7, 2018

OpenTracing now provides an API to trace code written in Lua.

Given Lua’s easy interoperability with C and C++, OpenTracing also provides a bridge tracer that implements the API on top of the OpenTracing C++ API, allowing you to immediately use existing tracers from Jaeger, LightStep, DataDog, Zipkin, or any other vendor providing an OpenTracing C++ implementation.

The following demonstrates some basic usage of the bridge tracer with Jaeger. See also here for a full example that can be run with docker-compose.

Setting up a tracer

In order to set up Jaeger for Lua tracing, we need to first install

We can then construct a Lua tracer by running

Figure 1: Initialize a Lua tracer for Jaeger

Creating spans

To create spans, use the start_span method

Figure 2: Create spans

Propagation

Context can be injected and extracted from tables using the *_inject and *_extract methods.

Figure 3: Propagate spans to/from a table

Feedback

This is the first release of an OpenTracing Lua API. To provide feedback, please visit OpenTracing’s gitter channel or file an issue here.

--

--