Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
matrixFunctions.labels = epsagon.lambdaWrapper((event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'It Worked!',
input: event,
}),
};
epsagon.label('label-key', 'label-value');
epsagon.label(null, null);
epsagon.label('label-key', 12);
epsagon.label(12, 12);
epsagon.label(12, null);
epsagon.label('12', null);
callback(null, response);
});
label(descriptor, silent = false) {
if (
typeof process.env.EPSAGON_TOKEN === 'string'
&& process.env.EPSAGON_TOKEN !== 'undefined'
&& typeof process.env.EPSAGON_SERVICE_NAME === 'string'
&& process.env.EPSAGON_SERVICE_NAME !== 'undefined'
) {
Epsagon.label(descriptor);
}
if (silent === false) {
logger.log('info', `label - ${descriptor}`);
}
}
metric(descriptor, stat, silent = false) {
if (
typeof process.env.EPSAGON_TOKEN === 'string'
&& process.env.EPSAGON_TOKEN !== 'undefined'
&& typeof process.env.EPSAGON_SERVICE_NAME === 'string'
&& process.env.EPSAGON_SERVICE_NAME !== 'undefined'
) {
Epsagon.label(descriptor, stat);
}
if (silent === false) {
logger.log('info', `metric - ${descriptor} - ${stat}`);
}
}
}