@embrace-io/web-sdk
Version:
1 lines • 3.12 kB
Source Map (JSON)
{"version":3,"file":"NonRecordingExtendedSpan.cjs","names":["INVALID_SPAN_CONTEXT"],"sources":["../../../../src/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.ts"],"sourcesContent":["import type {\n Attributes,\n Exception,\n Link,\n SpanContext,\n SpanStatus,\n TimeInput,\n} from '@opentelemetry/api';\nimport { INVALID_SPAN_CONTEXT } from '@opentelemetry/api';\nimport type {\n ExtendedSpan,\n ExtendedSpanFailedOptions,\n} from '../../api/index.ts';\n\n// File copied mostly from\n// https://github.com/open-telemetry/opentelemetry-js/blob/7e30af4c15017f48cbdffa054889c62b2006e4ed/api/src/trace/NonRecordingSpan.ts#L31\n// Added ExtendedSpan interface methods\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class NonRecordingExtendedSpan implements ExtendedSpan {\n private readonly _spanContext: SpanContext;\n\n public constructor(_spanContext: SpanContext = INVALID_SPAN_CONTEXT) {\n this._spanContext = _spanContext;\n }\n\n public attributes: Attributes = {};\n\n public fail(_options?: ExtendedSpanFailedOptions) {}\n\n public spanContext(): SpanContext {\n return this._spanContext;\n }\n\n public setAttribute(_key: string, _value: unknown): this {\n return this;\n }\n\n public setAttributes(_attributes: Attributes): this {\n return this;\n }\n\n public removeAttribute(_key: string): this {\n return this;\n }\n\n public addEvent(\n _name: string,\n _attributesOrStartTime?: Attributes | TimeInput,\n _startTime?: TimeInput,\n ): this {\n return this;\n }\n\n public addLink(_link: Link): this {\n return this;\n }\n\n public addLinks(_links: Link[]): this {\n return this;\n }\n\n public setStatus(_status: SpanStatus): this {\n return this;\n }\n\n public updateName(_name: string): this {\n return this;\n }\n\n public end(_endTime?: TimeInput): void {}\n\n public isRecording(): boolean {\n return false;\n }\n\n public recordException(_exception: Exception, _time?: TimeInput): void {}\n}\n"],"mappings":";;;AAiCA,IAAa,2BAAb,MAA8D;CAC5D;CAEA,YAAmB,eAA4BA,mBAAAA,sBAAsB;EACnE,KAAK,eAAe;CACtB;CAEA,aAAgC,CAAC;CAEjC,KAAY,UAAsC,CAAC;CAEnD,cAAkC;EAChC,OAAO,KAAK;CACd;CAEA,aAAoB,MAAc,QAAuB;EACvD,OAAO;CACT;CAEA,cAAqB,aAA+B;EAClD,OAAO;CACT;CAEA,gBAAuB,MAAoB;EACzC,OAAO;CACT;CAEA,SACE,OACA,wBACA,YACM;EACN,OAAO;CACT;CAEA,QAAe,OAAmB;EAChC,OAAO;CACT;CAEA,SAAgB,QAAsB;EACpC,OAAO;CACT;CAEA,UAAiB,SAA2B;EAC1C,OAAO;CACT;CAEA,WAAkB,OAAqB;EACrC,OAAO;CACT;CAEA,IAAW,UAA4B,CAAC;CAExC,cAA8B;EAC5B,OAAO;CACT;CAEA,gBAAuB,YAAuB,OAAyB,CAAC;AAC1E"}