influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.63k stars 5.58k forks source link

How do you test a new or mofied input plugin? #14567

Closed AeonJJohnson closed 9 months ago

AeonJJohnson commented 9 months ago

Please direct all support questsions to slack or the forums. Thank you.

I am testing modifications to a input.plugin (lustre2) that I will sub a PR for if it works as intended. I am not sure how to go about testing my mods. I have the modified .go files (lustre2.go and lustre2_test.go) and a functional golang env with GOPATH env variable set.

I cd to telegraf/plugins/input/lustre2 and run go test -v . and I get OK status for all functions but no resulting data output string. I want to verify I designated the proper fields and the data is output properly. I cannot figure out how to get the golang test process to actually output the data strings of tags and metrics resulting from the test. lustre2_test.go creates a test file tree with dummy value files for lustre2 to parse and process but I can't see any output that verifies that.

Hints? A helpul pointer on how to properly employ go test to test this thoroughly?

Many thanks!

telegraf-tiger[bot] commented 9 months ago

Hello! I recommend posting this question in our Community Slack or Community Forums, we have a lot of talented community members there who could help answer your question more quickly. You can also learn more about Telegraf by enrolling at InfluxDB University for free!

Heads up, this issue will be automatically closed after 7 days of inactivity. Thank you!

powersj commented 9 months ago

Responded over on the forums! Thanks and looking forward to some updates to lustre2!

https://community.influxdata.com/t/how-do-you-test-a-modified-input-plugin-lustre2-in-go/32783