bug fixes

auto_join_3.3
christian2 2020-05-04 09:47:10 +02:00
parent 85c9062f86
commit 9adcc807dd
1 changed files with 4 additions and 5 deletions

View File

@ -35,7 +35,7 @@ common_labels = function(both, fn) {
}
}
}
throw new Error('cannot find generic labels');
throw new Error('cannot find common labels');
}
set_value = function(key, m, labels, v) {
@ -48,21 +48,20 @@ set_value = function(key, m, labels, v) {
m.set(labels, v);
break;
default:
throw new Error(`unexpected metric: ${metric}`);
throw new Error(`unexpected metric: ${m}`);
}
}
addr = async function(ip, port) {
if ('PROM_DEIDENTIFY' in process.env) {
let a = ip.split('.')
for (let i = 0; i < a.length - 2; i++) {
a[i] = 'xx';
}
return a.join('.');
return `${a.join('.')}:${port}`;
}
else if ('PROM_NUMERIC' in process.env) {
return ip;
return `${ip}:${port}`;
}
else {
try {