Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.66 KB

README.md

File metadata and controls

54 lines (41 loc) · 1.66 KB

gotracers

codebeat badge Go Report Card Build Status Coverage Status GoDoc

gotracer provides emitters for Sysdig tracers.

Usage

Auto-generated span identifiers:

func myFunc() {
	spanID, err := tracers.Start("mytag")
	handleErr(err)
	defer tracers.End("mytag", spanID)

	...
}

Custom span identifiers:

func myFunc(uniqueId uint64) {
	err := tracers.StartInt("mytag", uniqueId)
	handleErr(err)
	defer tracers.End("mytag", uniqueId)

	...
}
func myFunc(uniqueId string) {
	spanID, err := tracers.StartStr("mytag", uniqueId)
	handleErr(err)
	defer tracers.End("mytag", spanID)

	...
}

Benchmarks

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