Building Telegraf , But there is no executable

I am building telegraf with instructions on README. I see no build errors with make. However there is no executable in GOPATH/bin or current directory.

Appreciate your support.

$ sudo GOPATH=/Users/dj/Documents/telegraf_prod/ GOOS=linux GOENV=amd64 make

And the output is

dep ensure -vendor-only
go build -ldflags " -X main.commit=5473872a -X main.branch=master" ./cmd/telegraf

Even, if i run the go build cmd from above, i do not see any build errors but then again the executable is missing.

$ go build -ldflags " -X main.commit=5473872a -X main.branch=master" ./cmd/telegraf

ls /Users/dj/Documents/telegraf_prod/bin/
deadcode go-outline gochecknoinits gocyclo goimports gometalinter gorename gotype interfacer misspell safesql unconvert
dupl goaddimport gocode godef golangci-lint gomodifytags goreturns guru lll nakedret staticcheck unparam
errcheck gochecknoglobals goconst gogetdoc golint gopkgs gosec ineffassign maligned revive structcheck varcheck

Appreciate any help here.

apart from not using sudo, I build it on debian stretch following the instructions, as a non-root user and the executable is here
is down the source tree.
Note it take a time to build, about 10min on a 4G VM.
had to install git, go and dep, and set up the environment, make sure you have the environment correct,
Also look for loads of files in ~/goproj/pkg/dep/sources/
Obviously replace ~/goproj with your directory :slight_smile:

Telegraf binary doesn’t go in ./bin, it’ll be in your Telegraf checkout directory at the top level

1 Like