Code Monkey home page Code Monkey logo

go-tracing's Introduction

GO-TRACING

Build Status Coverage Status Go Report Card

Go-tracing provides an easy way to use zipkin tracing with only four lines of code.

Quick start

// import the library
import "github.com/ricardo-ch/go-tracing"

// set your tracer
tracing.SetGlobalTracer(appName, "{zipkin_url}")
defer tracing.FlushCollector()

// define a trace
span, ctx := tracing.CreateSpan(ctx, "{span_name}", nil)
defer span.Finish()

Examples

make run-jaeger
go run examples/basic/main.go
go run examples/httpServer/main.go
go run examples/httpServer-middleware/main.go
go run examples/httpGoKit-middleware/main.go

To watch traces you just have to hit http://localhost:16686/search

Examples declare the envar they need in the code (e.g.: os.Setenv("JAEGER_AGENT_HOST", "localhost")), but technically, if using jaeger you are supposed to properly declare envar outside of the code. See list there

Features

  • Create span from nothing
  • Create span from context
  • Extract/Inject span from/to httpRequest
  • Extract/Inject span from/to a map[string]string (textMapCarrier)
  • Declare an error span

License

go-tracing is licensed under the MIT license. (http://opensource.org/licenses/MIT)

Contributing

Pull requests are the way to help us here. We will be really grateful.

go-tracing's People

Contributors

andriylesch avatar fpoinsottest avatar francoispoinsot avatar fsilberstein avatar laurenthayez avatar peppelan avatar tkanos avatar

Watchers

 avatar  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.