Server modules are Node.js [modules][nodemods] that receive metrics for StatsD. Server interfaces can be distributed and installed via systems such as NPM.
Each server module should export the following initialization function:
-
start(config, callback): This method is invoked from StatsD to initialize and start the server module listening for metrics. It accepts two parameters:configis the parsed config file hash andcallbackis a function to call with metrics data, when it's available.The callback function accepts two parameters:
packetcontains one or more metrics separated by the \n character, andrinfocontains remote address information.The server module should return
truefrom start() to indicate success. A return offalseindicates a failure to load the module (missing configuration?) and will cause StatsD to exit.
- http-interface Accepts data over HTTP.