UNPKG

@ogcio/o11y-sdk-node

Version:

Opentelemetry standard instrumentation SDK for NodeJS based project

23 lines (22 loc) 577 B
export class EnrichSpanProcessor { _spanAttributes; constructor(spanAttributes) { this._spanAttributes = spanAttributes; } forceFlush() { return Promise.resolve(); } onStart(span, _context) { if (this._spanAttributes != undefined) { for (const [key, value] of Object.entries(this._spanAttributes)) { span.setAttribute(key, typeof value === "function" ? value() : value); } } } onEnd(_span) { return; } shutdown() { return Promise.resolve(); } }