autotel
Version:
Write Once, Observe Anywhere
28 lines (26 loc) • 850 B
JavaScript
import { AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP } from "./sampling.js";
//#region src/tail-sampling-processor.ts
var TailSamplingSpanProcessor = class {
wrappedProcessor;
constructor(wrappedProcessor) {
this.wrappedProcessor = wrappedProcessor;
}
onStart(span, parentContext) {
this.wrappedProcessor.onStart(span, parentContext);
}
onEnd(span) {
const tailEvaluated = span.attributes[AUTOTEL_SAMPLING_TAIL_EVALUATED];
const shouldKeep = span.attributes[AUTOTEL_SAMPLING_TAIL_KEEP];
if (tailEvaluated === true && shouldKeep === false) return;
this.wrappedProcessor.onEnd(span);
}
forceFlush() {
return this.wrappedProcessor.forceFlush();
}
shutdown() {
return this.wrappedProcessor.shutdown();
}
};
//#endregion
export { TailSamplingSpanProcessor };
//# sourceMappingURL=tail-sampling-processor.js.map