I’m looking for a plugin for Datadog, If not exists, I can develop it. But before, I would like to know if a plugin can read these data from the “core” :
Nice, Knowing the number of active connections is important, it can detect leak on API client or detect an DDOS attack where attacker just open connection but not send any http query.
Ok I will looking how to develop plugin for Caddy.
Do you have any links / refs to start plugin development for Caddy ?
This is important because other directives may set up more primitive configuration that you rely on, so the order that the directives are executed cannot be arbitrary.
You can’t just run your code in an arbitrary order and expect it to work.
Is it possible to declare a plugin as global ? Usually, if I enable datadog monitoring, it’s for Caddy server not juste for one virtual host. The issue is that the directive “datadog” have to be duplicated on each virtual host just to activate http server handling for this virtualhost.
No, a user has to explicitly turn that feature on for every site they want it on for.
Some people use import to share configuration between sites.
If you truly need a “global” plugin, you don’t have to use a directive, but you’ll have to load the configuration some other way. The Caddyfile has no global scope.
Have you considered trying to leverage the work done for the prometheus plugin? I hate to see a new stats plugin for every new source. What if something central became the authority for collecting stats, and other plugins take care of packaging and exporting to various tsdb backends?
This would allow you to setup datadog export in only a single host, while still instrumenting them all.
Alternately, we could add a central stats interface to caddy itself, so any handler or middleware can add or record stats, and individual plugins take track of “listening” to stat events and storing and relaying them as appropriate.
I’m mostly concerned with the propigation of different plugins to collect the same data in slightly different ways.
Hi @captncraig, I have read the source codes of Prometheus, but is not working correctly. When a proxy is used, it will always report a 500 Error and send 1 UDP or TCP packet / query (lot of overhead). And it break the plugin chain by modifying the returned status code.
The datadog plugin is build on top of statsd, it working very well with and without proxy usage and avoid network overhead. In our company, we are using Datadog but I think it can work with all reporting tools backed by statsd. I can, if needed, rename plugin to “statsd” rather thant “datadog”.