GithubHelp home page GithubHelp logo

isabella232 / opentracing-lua Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opentracing/opentracing-lua

0.0 0.0 0.0 10 KB

OpenTracing API for Lua

Home Page: http://opentracing.io

License: Apache License 2.0

Lua 81.49% Dockerfile 1.22% Shell 17.29%

opentracing-lua's Introduction

OpenTracing API for Lua

Lua implementation of the OpenTracing API http://opentracing.io

Required Reading

In order to understand the Lua platform API, one must first be familiar with the OpenTracing project and terminology more generally.

API overview for those adding instrumentation

Everyday consumers of this opentracing package really only need to worry about a couple of key abstractions: the start_span function, the Span interface, and binding a Tracer at initialization-time. Here are code snippets demonstrating some important use cases.

Starting an empty trace by creating a "root span"

It's always possible to create a "root" Span with no parent or other causal reference.

    function xyz()
        ...
        tracer = --[[ Some Tracer ]]
        span = tracer:start_span("operation_name")
        -- Do some work
        span:finish()
        ...
    end

Creating a (child) Span given an existing (parent) Span

    function qrz(parent_span)
        ...
        tracer = --[[ Some Tracer ]]
        span = tracer:start_span(
          "operation_name",
          {["references"] = {{"child_of", parent_span:context()}}})
        -- Do some work
        span:finish()
        ...
    end

Inject Span context into a table

    tracer = --[[ Some Tracer ]]
    carrier = {}
    span = tracer:start_span('abc')
    tracer:http_headers_inject(span:context(), carrier)

Extract Span context from a table

    tracer = --[[ Some Tracer ]]
    carrier = --[[ Some carrier ]]
    span_context = tracer:http_headers_extract(carrier)

API compatibility

For the time being, "mild" backwards-incompatible changes may be made without changing the major version number. As OpenTracing and opentracing-cpp mature, backwards compatibility will become more of a priority.

License

By contributing to opentracing.lua, you agree that your contributions will be licensed under its Apache 2.0 License.

opentracing-lua's People

Contributors

james-callahan avatar rnburn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.