<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<span>I think it makes sense to support Go plugins. While I can't speak about Go directly, maintaining a Rust crate [0] for creating collectd plugins over the years has taught me that there are some benefits to out-of-band plugins compiled to shared objects:<br>
</span>
<div><br>
</div>
<div>- More rapid plugin releases (especially new plugins) that don't need to be tied to the main release<br>
</div>
<div>- Being able to have a plugin target collectd versions prior to its existent. For instance, the rust crate allows one to compile to a shared object that is compatible with either 5.4, 5.5, or 5.7+'s collectd plugin API. So in effect, new plugins can be
 backported to older collectd installations.<br>
</div>
<div><br>
</div>
<div>I don't know if those are in accordance with your thoughts, but I feel like allowing Go plugins could also lower the barrier to entry for contributors.
<br>
</div>
<div><br>
</div>
<div>Thanks<br>
</div>
<div>-Nick.</div>
<div><br>
</div>
<div><span>[0] <a href="https://crates.io/crates/collectd-plugin">https://crates.io/crates/collectd-plugin</a></span><br>
<span></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> collectd <collectd-bounces@verplant.org> on behalf of Florian Forster <octo@collectd.org><br>
<b>Sent:</b> Thursday, April 23, 2020 1:29 AM<br>
<b>To:</b> collectd@verplant.org <collectd@verplant.org><br>
<b>Subject:</b> [collectd] RFC: Should we maintain plugins written in Go?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi everybody,<br>
<br>
TL,DR: Should we create a new Git repository and maintain plugins <br>
written in the "Go" programming language?<br>
<br>
the last days, I spent some time improving the "collectd.org/plugin" <br>
package [0]. In a nutshell, it allows to implement a plugin in Go, <br>
compile it to a shared object and then load it like other "native" <br>
(implemented in C) plugins. The primary benefit over approaches such as <br>
the "collectd.org/exec" [1] and "collectd.org/rpc" [2] packages is, that <br>
it supports implementing "write" and "log" callbacks. "config" <br>
callbacks, allowing one to configure the plugin via the collectd config <br>
file, are work in progress.<br>
<br>
My question is: Should we attempt to maintain plugins written in Go? And <br>
if so, how?<br>
<br>
For Go-based plugins, i.e. plugins based on "collectd.org/plugin", I <br>
propose we create a separate repository, e.g. <br>
github.com/collectd/go-plugins, and maintain those there. This would <br>
make plugins easier to discover for users, allow easier changes to the <br>
API, and strive for consistency across the ecosystem.<br>
<br>
In the past, we have imported plugins in non-C languages into the main <br>
repository, in particular bindings/perl/ and bindings/java/. This model <br>
is not a good fit for Go, which makes much more assumptions about the <br>
directory structure of a repository. Also, for Perl and Java the "glue <br>
code" (code translating between Perl and Java, and C) is contained in <br>
the "main" reposiroty; that's not the case for Go.<br>
<br>
I'm also contemplating if we should try to support plugins using the <br>
"exec plugin" more, e.g. by creating a repository for them. There are a <br>
number of "collectd Docker" plugins and I feel like this duplication <br>
could have been avoided by better discoverability.<br>
<br>
Best regards,<br>
—octo<br>
<br>
[0] <a href="https://godoc.org/collectd.org/plugin">https://godoc.org/collectd.org/plugin</a><br>
[1] <a href="https://godoc.org/collectd.org/exec">https://godoc.org/collectd.org/exec</a><br>
[2] <a href="https://godoc.org/collectd.org/rpc">https://godoc.org/collectd.org/rpc</a><br>
-- <br>
collectd – The system statistics collection daemon<br>
Website: <a href="http://collectd.org">http://collectd.org</a><br>
GitHub:  <a href="https://github.com/collectd">https://github.com/collectd</a><br>
Twitter: <a href="http://twitter.com/collectd">http://twitter.com/collectd</a><br>
<br>
_______________________________________________<br>
collectd mailing list<br>
collectd@verplant.org<br>
<a href="https://mailman.verplant.org/listinfo/collectd">https://mailman.verplant.org/listinfo/collectd</a></div>
</span></font></div>
</body>
</html>