Announcing Lua OpenTracing
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
- The OpenTracing C++ API
- The lua-bridge-tracer (Works with Lua 5.1/5.2/5.3 and LuaJIT)
- The Jaeger C++ Plugin (For Linux-x86_64, this can be quickly installed from a prebuilt binary)
We can then construct a Lua tracer by running
Creating spans
To create spans, use the start_span
method
Propagation
Context can be injected and extracted from tables using the *_inject
and *_extract
methods.
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.