@vtex/diagnostics-nodejs
Version:
Diagnostics library for Node.js applications
41 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.newConfig = newConfig;
exports.WithDescription = WithDescription;
exports.WithExporter = WithExporter;
exports.WithUnit = WithUnit;
exports.WithTemporality = WithTemporality;
exports.WithBuckets = WithBuckets;
function newConfig(opts = []) {
const config = {
exporters: []
};
opts.forEach(opt => opt(config));
return config;
}
function WithDescription(description) {
return (config) => {
config.description = description;
};
}
function WithExporter(exporter) {
return (config) => {
config.exporters.push(exporter);
};
}
function WithUnit(unit) {
return (config) => {
config.unit = unit;
};
}
function WithTemporality(temporality) {
return (config) => {
config.temporality = temporality;
};
}
function WithBuckets(buckets) {
return (config) => {
config.buckets = buckets;
};
}
//# sourceMappingURL=options.js.map