Writing Telegraf Input Plugin - Is Contribution Guide Up to Date?

481 Views Asked by At

I've recently attempted at creating my own Telegraf input plugin to collect metrics from a Tibit OLT (https://tibitcom.com/). I apologise that I haven't any previous experience with Golang, and no one to ask who does have experience with it, so I'm hoping the StackOverflow community could come to my rescue!

I configured my go env as recommended and have all resources required (in my 'src' directory) from the initial:

go get -d github.com/influxdata/telegraf

One of the resources on influxdata.com suggests that you should next do a git checkout...

git checkout -b <my-branch>

Does this assume that you have signed the Individual Contributor License Agreement (CLA) and are able to make a feature branch? Or, is an association made to the git repository after go get ... (assumed not if it isn't a git pull). Anyways, I skipped the above step and tried to...

cd $GOPATH/src/github.com/influxdata/[email protected]
make 

But when I try to make, I get:

fatal: not a git repository (or any of the parent directories): .git
make: go: Command not found
make: *** [all] Error 2

From some other posts I have read that go make is no longer used and you now use:

go mod init github.com/influxdata/telegraf

This doesn't throw any errors and is meant to make a binary executable in the bin folder, but it doesn't seem to create one?

I have followed the video tutorials to generate a demo plugin, but when I run...

./telegraf -sample-config -input-filter <plugin-name> -output-filter influxdb

I get nothing output for input plugins.

I'm sorry there might be a few answers to different bits of this, but I'm a bit lost and has become a bit of a blocker.

Thank you in advance!

0

There are 0 best solutions below