renovate
Version:
Automated dependency updates. Flexible so you don't need to be.
23 lines (22 loc) • 643 B
JavaScript
import { instrument } from "./index.js";
//#region lib/instrumentation/with-instrumenting.ts
/**
* Creates a wrapped version of an async function that instruments each call.
*
* @param options - Instrumentation options
* @param fn - The async function to wrap
* @returns A new function that instruments each call
*/
function withInstrumenting(options, fn) {
const { name, attributes, ignoreParentSpan, kind } = options;
return (...args) => {
return instrument(name, () => fn(...args), {
attributes,
root: ignoreParentSpan,
kind
});
};
}
//#endregion
export { withInstrumenting };
//# sourceMappingURL=with-instrumenting.js.map