Figure 1: Cluster performance metrics |
Figure 2: Components of sFlow-RT |
// author: Peter // version: 1.0 // date: 11/23/2013 // description: Log metrics to Graphite include('extras/json2.js'); var graphiteServer = "10.0.0.151"; var graphitePort = null; var errors = 0; var sent = 0; var lastError; setIntervalHandler(function() { var names = ['sum:load_one']; var prefix = 'linux.'; var vals = metric('ALL',names,{os_name:['linux']}); var metrics = {}; for(var i = 0; i < names.length; i++) { metrics[prefix + names[i]] = vals[i].metricValue; } try { graphite(graphiteServer,graphitePort,metrics); sent++; } catch(e) { errors++; lastError = e.message; } } , 15); setHttpHandler(function() { var message = { 'errors':errors,'sent':sent }; if(lastError) message.lastError = lastError; return JSON.stringify(message); });The interval handler function runs every 15 seconds and retrieves the set of metrics in the names array (in this case just one metrics, but multiple metrics could be retrieved). The names are then converted into a Graphite friendly form (prefixing each metric with the token linux. so that they can be easily grouped) and then sent to the Graphite collector running on 10.0.0.151 using the default TCP port 2003. The script also keeps track of any errors and makes them available through the URL /script/graphite.js/json
The following command line argument loads the script on startup:
-Dscript.file=graphite.jsThe following Graphite screen capture below shows a trend of the metric:
There are a virtually infinite number of core and derived metrics that can be collected by sFlow-RT using standard sFlow instrumentation embedded in switches, servers and applications throughout the data center. For example Packet loss describes the importance of collecting network packet loss metrics and including them in performance dashboards.
Figure 2: Visibility and the software defined data center |
Finally, metrics export is only one of many applications for sFlow data, some of which have been described on this blog. The data center wide visibility provided by sFlow-RT supports orchestration tools and allows them to automatically optimize the allocation of compute, storage and application resources and the placement of loads on these resources.
No comments:
Post a Comment