UNPKG

@netlify/zip-it-and-ship-it

Version:
17 lines (16 loc) 796 B
/* Span attributes describing a function and how it is bundled */ export const getFunctionBundleSpanAttributes = ({ featureFlags, name, generator, runtimeName, runtimeAPIVersion, bundlerName, bundlerReason, }) => ({ feature_flags: JSON.stringify(featureFlags), 'function.name': name, 'function.generator': generator, 'function.runtime': runtimeName, 'function.runtime_api_version': runtimeAPIVersion, 'bundler.name': bundlerName, 'bundler.reason': bundlerReason, }); /* Span attributes known only once bundling has finished */ export const getBundleResultSpanAttributes = (result, sizeBytes) => ({ 'bundler.warnings_count': result.bundlerWarnings?.length ?? 0, 'bundler.errors_count': result.bundlerErrors?.length ?? 0, 'bundle.size_bytes': sizeBytes, });