UNPKG

@dynatrace/opentelemetry-core

Version:

Dynatrace OpenTelemetry core package

56 lines (53 loc) 2.19 kB
"use strict"; /* Copyright 2022 Dynatrace LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getFw4Tag = exports.setFw4Tag = exports.setPropagatedResourceAttributes = exports.getPropagatedResourceAttributes = exports.setMetaData = exports.getMetaData = void 0; // ============================================================================ const cDtMetaDataKey = Symbol("DtMetaDataKey"); const cDtPropagatedResourceAttributesKey = Symbol("DtPropagatedResourceAttributes"); function getMetaData(span) { return span[cDtMetaDataKey]; } exports.getMetaData = getMetaData; function setMetaData(span, metaData) { span[cDtMetaDataKey] = metaData; } exports.setMetaData = setMetaData; function getPropagatedResourceAttributes(span) { if (span == null) { return undefined; } return span[cDtPropagatedResourceAttributesKey]; } exports.getPropagatedResourceAttributes = getPropagatedResourceAttributes; function setPropagatedResourceAttributes(span, attributes) { if (span.isRecording() && attributes != null) { span[cDtPropagatedResourceAttributesKey] = attributes; } } exports.setPropagatedResourceAttributes = setPropagatedResourceAttributes; // ---------------------------------------------------------------------------- const cDtTagKey = Symbol("DtTagKey"); function setFw4Tag(traceState, tag) { traceState[cDtTagKey] = tag; } exports.setFw4Tag = setFw4Tag; function getFw4Tag(traceState) { if (traceState != null) { return traceState[cDtTagKey]; } return undefined; } exports.getFw4Tag = getFw4Tag; //# sourceMappingURL=SpanEmbedder.js.map