Skip to content

Commit 39c8ad5

Browse files
committed
added more charts for bind
1 parent 23225be commit 39c8ad5

2 files changed

Lines changed: 71 additions & 3 deletions

File tree

node.d/named.node.js

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// collect statistics from bind (named) v9.10+
44
//
55
// bind statistics documentation at:
6+
// http://jpmens.net/2013/03/18/json-in-bind-9-s-statistics-server/
67
// https://ftp.isc.org/isc/bind/9.10.3/doc/arm/Bv9ARM.ch06.html#statistics
78

89
// example configuration in /etc/netdata/named.conf
@@ -305,6 +306,9 @@ var named = {
305306
if(typeof r.qtypes !== 'undefined')
306307
service.module.chartFromMembers(service, r.qtypes, 'in_qtypes', 'Bind, Global Incoming Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 2000, netdata.chartAlgorithms.incremental, 1, 1);
307308

309+
if(typeof r.sockstats !== 'undefined')
310+
service.module.chartFromMembers(service, r.sockstats, 'in_sockstats', 'Bind, Global Socket Statistics', 'operations/s', 'named', 'named', netdata.chartTypes.line, 2500, netdata.chartAlgorithms.incremental, 1, 1);
311+
308312
if(typeof r.views !== 'undefined') {
309313
for( var x in r.views ) {
310314
var resolver = r.views[x].resolver;
@@ -399,10 +403,71 @@ var named = {
399403
service.end();
400404
}
401405
}
402-
403-
if(typeof resolver.qtypes !== 'undefined')
404-
service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 6000, netdata.chartAlgorithms.incremental, 1, 1);
405406
}
407+
408+
if(typeof resolver.qtypes !== 'undefined')
409+
service.module.chartFromMembers(service, resolver.qtypes, 'view_resolver_qtypes_' + x, 'Bind, ' + x + ' View, Requests by Query Type', 'requests/s', 'named', 'named', netdata.chartTypes.stacked, 6000, netdata.chartAlgorithms.incremental, 1, 1);
410+
411+
//if(typeof resolver.cache !== 'undefined')
412+
// service.module.chartFromMembers(service, resolver.cache, 'view_resolver_cache_' + x, 'Bind, ' + x + ' View, Cache Entries', 'entries', 'named', 'named', netdata.chartTypes.stacked, 7000, netdata.chartAlgorithms.absolute, 1, 1);
413+
414+
if(typeof resolver.cachestats['CacheHits'] !== 'undefined' && resolver.cachestats['CacheHits'] > 0) {
415+
var id = 'named_' + service.name + '.view_resolver_cachehits_' + x;
416+
var chart = named.charts[id];
417+
418+
if(typeof chart === 'undefined') {
419+
chart = {
420+
id: id, // the unique id of the chart
421+
name: '', // the unique name of the chart
422+
title: service.name + ' Bind, ' + x + ' View, Resolver Cache Hits', // the title of the chart
423+
units: 'operations/s', // the units of the chart dimensions
424+
family: 'named', // the family of the chart
425+
category: 'named', // the category of the chart
426+
type: netdata.chartTypes.area, // the type of the chart
427+
priority: 8000, // the priority relative to others in the same family and category
428+
update_every: Math.round(service.update_every / 1000), // the expected update frequency of the chart
429+
dimensions: {
430+
'CacheHits': {
431+
id: 'CacheHits', // the unique id of the dimension
432+
name: 'hits', // the name of the dimension
433+
algorithm: netdata.chartAlgorithms.incremental,// the id of the netdata algorithm
434+
multiplier: 1, // the multiplier
435+
divisor: 1, // the divisor
436+
hidden: false // is hidden (boolean)
437+
},
438+
'CacheMisses': {
439+
id: 'CacheMisses', // the unique id of the dimension
440+
name: 'misses', // the name of the dimension
441+
algorithm: netdata.chartAlgorithms.incremental,// the id of the netdata algorithm
442+
multiplier: -1, // the multiplier
443+
divisor: 1, // the divisor
444+
hidden: false // is hidden (boolean)
445+
}
446+
}
447+
};
448+
449+
chart = service.chart(id, chart);
450+
named.charts[id] = chart;
451+
}
452+
453+
service.begin(chart);
454+
service.set('CacheHits', resolver.cachestats['CacheHits']);
455+
service.set('CacheMisses', resolver.cachestats['CacheMisses']);
456+
service.end();
457+
}
458+
459+
// this is wrong, it contains many types of info:
460+
// 1. CacheHits, CacheMisses - incremental (added above)
461+
// 2. QueryHits, QueryMisses - incremental
462+
// 3. DeleteLRU, DeleteTTL - incremental
463+
// 4. CacheNodes, CacheBuckets - absolute
464+
// 5. TreeMemTotal, TreeMemInUse - absolute
465+
// 6. HeapMemMax, HeapMemTotal, HeapMemInUse - absolute
466+
//if(typeof resolver.cachestats !== 'undefined')
467+
// service.module.chartFromMembers(service, resolver.cachestats, 'view_resolver_cachestats_' + x, 'Bind, ' + x + ' View, Cache Statistics', 'requests/s', 'named', 'named', netdata.chartTypes.line, 8000, netdata.chartAlgorithms.incremental, 1, 1);
468+
469+
//if(typeof resolver.adb !== 'undefined')
470+
// service.module.chartFromMembers(service, resolver.adb, 'view_resolver_adb_' + x, 'Bind, ' + x + ' View, ADB Statistics', 'entries', 'named', 'named', netdata.chartTypes.line, 8500, netdata.chartAlgorithms.absolute, 1, 1);
406471
}
407472
}
408473
}

node.d/node_modules/netdata.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)