UNPKG

traceapm

Version:

SDK for OpenTelemetry auto-instrumentation and OTLP export for Node.js apps.

8 lines (7 loc) 545 B
function validateConfig(config) { if (!config || typeof config !== 'object') throw new Error('traceapm: config object is required'); if (config.serviceName && typeof config.serviceName !== 'string') throw new Error('traceapm: serviceName must be a string'); if (config.endpoint && typeof config.endpoint !== 'string') throw new Error('traceapm: endpoint must be a string'); if (config.attributes && typeof config.attributes !== 'object') throw new Error('traceapm: attributes must be an object'); } module.exports = { validateConfig };