@instana/core
Version:
Core library for Instana's Node.js packages
28 lines (22 loc) • 541 B
JavaScript
/*
* (c) Copyright IBM Corp. 2026
*/
;
/**
* @typedef {Object} AttributeMapper
* @property {function(import('../../../core').InstanaBaseSpan): Array<{ key: string, value: any }>} spanAttributes
*/
/**
* @param {import('../../../core').InstanaBaseSpan} span
* @param {AttributeMapper} mapper
* @returns {Array<{ key: string, value: any }>}
*/
function extractSpanAttributes(span, mapper) {
if (!span?.data) {
return [];
}
return mapper.spanAttributes(span);
}
module.exports = {
extractSpanAttributes
};