Skip to content

Generate instrumentation for Go Interfaces

License

Notifications You must be signed in to change notification settings

ConorNevin/traceable

Repository files navigation

traceable

CircleCI Coverage Status Go Report Card GoDoc

A Tool that generates an instrumented implementation of an interface that wraps functions calls with an OpenTracing span.

Installation

traceable requires a working Go installation (Go 1.14+)

go install github.com/ConorNevin/traceable@latest

Usage

Using Go Generate

  1. Add a go:generate directive to a file in the same package as the target interface: go:generate traceable -types IFACE -output traced/iface.go
  2. Run go generate on the directory

Download binary from GitHub release

    curl -fsSL "https://github.com/ConorNevin/traceable/releases/download/$(VERSION)/traceable_$(uname -s)_$(uname -m)" -o traceable