项目作者: pavel-paulau

项目描述 :
Go meets sysdig tracers
高级语言: Go
项目地址: git://github.com/pavel-paulau/gotracers.git
创建时间: 2016-10-13T23:21:15Z
项目社区:https://github.com/pavel-paulau/gotracers

开源协议:Apache License 2.0

下载


gotracers

codebeat badge
Go Report Card
Build Status
Coverage Status
GoDoc

gotracer provides emitters for Sysdig tracers.

Usage

Auto-generated span identifiers:

  1. func myFunc() {
  2. spanID, err := tracers.Start("mytag")
  3. handleErr(err)
  4. defer tracers.End("mytag", spanID)
  5. ...
  6. }

Custom span identifiers:

  1. func myFunc(uniqueId uint64) {
  2. err := tracers.StartInt("mytag", uniqueId)
  3. handleErr(err)
  4. defer tracers.End("mytag", uniqueId)
  5. ...
  6. }
  1. func myFunc(uniqueId string) {
  2. spanID, err := tracers.StartStr("mytag", uniqueId)
  3. handleErr(err)
  4. defer tracers.End("mytag", spanID)
  5. ...
  6. }

Benchmarks

  1. BenchmarkStart-8 3000000 386 ns/op 32 B/op 1 allocs/op
  2. BenchmarkStartInt-8 5000000 329 ns/op 16 B/op 1 allocs/op
  3. BenchmarkStartStr-8 3000000 523 ns/op 88 B/op 3 allocs/op
  4. BenchmarkEnd-8 5000000 363 ns/op 16 B/op 1 allocs/op