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tC5lC,EAAS,GAEX0iC,EAAS98B,OAAO88B,KACP/hC,EAAQX,GAAQ,CACvB,IAAIsG,EAAS6hC,EAAQxnC,GACjB2F,GACF4hC,GAASxF,EAAQp8B,EAAQ3F,EAAOilC,GAGpC,OAAOlD,MA+wBX,SAASgF,GAAS7+B,GAChB,OAAOA,EAoBTu3B,EAAOH,QAAU5O","sources":["webpack://grafana/./public/app/core/utils/tracing.ts","webpack://grafana/./public/app/plugins/datasource/tempo/graphTransform.ts","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/baggage/utils.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/diag/types.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/context/context.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/status.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/version.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/internal/semver.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/api/diag.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/api/context.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/api/trace.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/api/propagation.js","webpack://grafana/./node_modules/@opentelemetry/api/build/esm/index.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/baggage/constants.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/baggage/utils.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/baggage/propagation/HttpBaggagePropagator.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/utils/sampling.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/utils/environment.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/platform/browser/environment.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/platform/browser/hex-to-base64.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/platform/browser/RandomIdGenerator.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js","webpack://grafana/./node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js","webpack://grafana/./node_modules/@opentelemetry/semantic-conventions/build/esm/resource/ResourceAttributes.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/platform/browser/sdk-info.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/version.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/common/time.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/ExportResult.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/propagation/composite.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/internal/validators.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/TraceState.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/HttpTraceContextPropagator.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/rpc-metadata.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/sampler/AlwaysOffSampler.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/sampler/AlwaysOnSampler.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/CollectorExporterBase.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/sampler/ParentBasedSampler.js","webpack://grafana/./node_modules/@opentelemetry/core/build/esm/trace/sampler/TraceIdRatioBasedSampler.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/types.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/platform/browser/CollectorExporterBrowserBase.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/util.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/platform/browser/util.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/transform.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/platform/browser/CollectorTraceExporter.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/types/Metric.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/NoopMeter.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/NoopMeterProvider.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/platform/browser/globalThis.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/api/global-utils.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/api/metrics.js","webpack://grafana/./node_modules/@opentelemetry/api-metrics/build/esm/index.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/types.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/BoundInstrument.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/Utils.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/Metric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/CounterMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/ValueRecorderMetric.js","webpack://grafana/./node_modules/@opentelemetry/resources/build/esm/platform/browser/detect-resources.js","webpack://grafana/./node_modules/@opentelemetry/resources/build/esm/Resource.js","webpack://grafana/./node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/BatchObserverResult.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/BatchObserver.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/Controller.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/NoopExporter.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/aggregators/Histogram.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/aggregators/LastValue.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/aggregators/Sum.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/Processor.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/ObserverResult.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/BaseObserverMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/SumObserverMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/types.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/UpDownCounterMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/UpDownSumObserverMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/ValueObserverMetric.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/Meter.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/MeterProvider.js","webpack://grafana/./node_modules/@opentelemetry/metrics/build/esm/export/ConsoleMetricExporter.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/transformMetrics.js","webpack://grafana/./node_modules/@opentelemetry/exporter-collector/build/esm/platform/browser/CollectorMetricExporter.js","webpack://grafana/./public/app/plugins/datasource/tempo/resultTransformer.ts","webpack://grafana/./node_modules/lodash.merge/index.js"],"sourcesContent":["/**\n * Get non overlapping duration of the ranges as they can overlap or have gaps.\n */\nimport { FieldType, MutableDataFrame, NodeGraphDataFrameFieldNames as Fields } from '@grafana/data';\n\nexport function getNonOverlappingDuration(ranges: Array<[number, number]>): number {\n ranges.sort((a, b) => a[0] - b[0]);\n const mergedRanges = ranges.reduce((acc, range) => {\n if (!acc.length) {\n return [range];\n }\n const tail = acc.slice(-1)[0];\n const [prevStart, prevEnd] = tail;\n const [start, end] = range;\n if (end < prevEnd) {\n // In this case the range is completely inside the prev range so we can just ignore it.\n return acc;\n }\n\n if (start > prevEnd) {\n // There is no overlap so we can just add it to stack\n return [...acc, range];\n }\n\n // We know there is overlap and current range ends later than previous so we can just extend the range\n return [...acc.slice(0, -1), [prevStart, end]] as Array<[number, number]>;\n }, [] as Array<[number, number]>);\n\n return mergedRanges.reduce((acc, range) => {\n return acc + (range[1] - range[0]);\n }, 0);\n}\n\n/**\n * Returns a map of the spans with children array for easier processing. It will also contain empty spans in case\n * span is missing but other spans are it's children. This is more generic because it needs to allow iterating over\n * both arrays and dataframe views.\n */\nexport function makeSpanMap<T>(\n getSpan: (index: number) => { span: T; id: string; parentIds: string[] } | undefined\n): { [id: string]: { span: T; children: string[] } } {\n const spanMap: { [id: string]: { span?: T; children: string[] } } = {};\n\n let span;\n for (let index = 0; (span = getSpan(index)), !!span; index++) {\n if (!spanMap[span.id]) {\n spanMap[span.id] = {\n span: span.span,\n children: [],\n };\n } else {\n spanMap[span.id].span = span.span;\n }\n\n for (const parentId of span.parentIds) {\n if (parentId) {\n if (!spanMap[parentId]) {\n spanMap[parentId] = {\n span: undefined,\n children: [span.id],\n };\n } else {\n spanMap[parentId].children.push(span.id);\n }\n }\n }\n }\n return spanMap as { [id: string]: { span: T; children: string[] } };\n}\n\nexport function getStats(duration: number, traceDuration: number, selfDuration: number) {\n return {\n main: `${toFixedNoTrailingZeros(duration)}ms (${toFixedNoTrailingZeros((duration / traceDuration) * 100)}%)`,\n secondary: `${toFixedNoTrailingZeros(selfDuration)}ms (${toFixedNoTrailingZeros(\n (selfDuration / duration) * 100\n )}%)`,\n };\n}\n\nfunction toFixedNoTrailingZeros(n: number) {\n return parseFloat(n.toFixed(2));\n}\n\n/**\n * Create default frames used when returning data for node graph.\n */\nexport function makeFrames() {\n const nodesFrame = new MutableDataFrame({\n fields: [\n { name: Fields.id, type: FieldType.string },\n { name: Fields.title, type: FieldType.string },\n { name: Fields.subTitle, type: FieldType.string },\n { name: Fields.mainStat, type: FieldType.string, config: { displayName: 'Total time (% of trace)' } },\n { name: Fields.secondaryStat, type: FieldType.string, config: { displayName: 'Self time (% of total)' } },\n {\n name: Fields.color,\n type: FieldType.number,\n config: { color: { mode: 'continuous-GrYlRd' }, displayName: 'Self time / Trace duration' },\n },\n ],\n meta: {\n preferredVisualisationType: 'nodeGraph',\n },\n });\n\n const edgesFrame = new MutableDataFrame({\n fields: [\n { name: Fields.id, type: FieldType.string },\n { name: Fields.target, type: FieldType.string },\n { name: Fields.source, type: FieldType.string },\n ],\n meta: {\n preferredVisualisationType: 'nodeGraph',\n },\n });\n\n return [nodesFrame, edgesFrame];\n}\n","import { groupBy } from 'lodash';\nimport {\n DataFrame,\n DataFrameView,\n DataQueryResponse,\n FieldDTO,\n MutableDataFrame,\n NodeGraphDataFrameFieldNames as Fields,\n TimeRange,\n} from '@grafana/data';\nimport { getNonOverlappingDuration, getStats, makeFrames, makeSpanMap } from '../../../core/utils/tracing';\n\ninterface Row {\n traceID: string;\n spanID: string;\n parentSpanID: string;\n operationName: string;\n serviceName: string;\n serviceTags: string;\n startTime: number;\n duration: number;\n logs: string;\n tags: string;\n}\n\ninterface Node {\n [Fields.id]: string;\n [Fields.title]: string;\n [Fields.subTitle]: string;\n [Fields.mainStat]: string;\n [Fields.secondaryStat]: string;\n [Fields.color]: number;\n}\n\ninterface Edge {\n [Fields.id]: string;\n [Fields.target]: string;\n [Fields.source]: string;\n}\n\nexport function createGraphFrames(data: DataFrame): DataFrame[] {\n const { nodes, edges } = convertTraceToGraph(data);\n const [nodesFrame, edgesFrame] = makeFrames();\n\n for (const node of nodes) {\n nodesFrame.add(node);\n }\n for (const edge of edges) {\n edgesFrame.add(edge);\n }\n\n return [nodesFrame, edgesFrame];\n}\n\nfunction convertTraceToGraph(data: DataFrame): { nodes: Node[]; edges: Edge[] } {\n const nodes: Node[] = [];\n const edges: Edge[] = [];\n\n const view = new DataFrameView<Row>(data);\n\n const traceDuration = findTraceDuration(view);\n const spanMap = makeSpanMap((index) => {\n if (index >= data.length) {\n return undefined;\n }\n const span = view.get(index);\n return {\n span: { ...span },\n id: span.spanID,\n parentIds: span.parentSpanID ? [span.parentSpanID] : [],\n };\n });\n\n for (let i = 0; i < view.length; i++) {\n const row = view.get(i);\n\n const ranges: Array<[number, number]> = spanMap[row.spanID].children.map((c) => {\n const span = spanMap[c].span;\n return [span.startTime, span.startTime + span.duration];\n });\n const childrenDuration = getNonOverlappingDuration(ranges);\n const selfDuration = row.duration - childrenDuration;\n const stats = getStats(row.duration, traceDuration, selfDuration);\n\n nodes.push({\n [Fields.id]: row.spanID,\n [Fields.title]: row.serviceName ?? '',\n [Fields.subTitle]: row.operationName,\n [Fields.mainStat]: stats.main,\n [Fields.secondaryStat]: stats.secondary,\n [Fields.color]: selfDuration / traceDuration,\n });\n\n // Sometimes some span can be missing. Don't add edges for those.\n if (row.parentSpanID && spanMap[row.parentSpanID].span) {\n edges.push({\n [Fields.id]: row.parentSpanID + '--' + row.spanID,\n [Fields.target]: row.spanID,\n [Fields.source]: row.parentSpanID,\n });\n }\n }\n\n return { nodes, edges };\n}\n\n/**\n * Get the duration of the whole trace as it isn't a part of the response data.\n * Note: Seems like this should be the same as just longest span, but this is probably safer.\n */\nfunction findTraceDuration(view: DataFrameView<Row>): number {\n let traceEndTime = 0;\n let traceStartTime = Infinity;\n\n for (let i = 0; i < view.length; i++) {\n const row = view.get(i);\n\n if (row.startTime < traceStartTime) {\n traceStartTime = row.startTime;\n }\n\n if (row.startTime + row.duration > traceEndTime) {\n traceEndTime = row.startTime + row.duration;\n }\n }\n\n return traceEndTime - traceStartTime;\n}\n\nconst secondsMetric = 'tempo_service_graph_request_server_seconds_sum';\nconst totalsMetric = 'tempo_service_graph_request_total';\n\nexport const serviceMapMetrics = [\n secondsMetric,\n totalsMetric,\n // We don't show histogram in node graph at the moment but we could later add that into a node context menu.\n // 'tempo_service_graph_request_seconds_bucket',\n // 'tempo_service_graph_request_seconds_count',\n // These are used for debugging the tempo collection so probably not useful for service map right now.\n // 'tempo_service_graph_unpaired_spans_total',\n // 'tempo_service_graph_untagged_spans_total',\n];\n\n/**\n * Map response from multiple prometheus metrics into a node graph data frames with nodes and edges.\n * @param responses\n * @param range\n */\nexport function mapPromMetricsToServiceMap(responses: DataQueryResponse[], range: TimeRange): [DataFrame, DataFrame] {\n const [totalsDFView, secondsDFView] = getMetricFrames(responses);\n\n // First just collect data from the metrics into a map with nodes and edges as keys\n const nodesMap: Record<string, any> = {};\n const edgesMap: Record<string, any> = {};\n // At this moment we don't have any error/success or other counts so we just use these 2\n collectMetricData(totalsDFView, 'total', totalsMetric, nodesMap, edgesMap);\n collectMetricData(secondsDFView, 'seconds', secondsMetric, nodesMap, edgesMap);\n\n return convertToDataFrames(nodesMap, edgesMap, range);\n}\n\nfunction createServiceMapDataFrames() {\n function createDF(name: string, fields: FieldDTO[]) {\n return new MutableDataFrame({ name, fields, meta: { preferredVisualisationType: 'nodeGraph' } });\n }\n\n const nodes = createDF('Nodes', [\n { name: Fields.id },\n { name: Fields.title },\n { name: Fields.mainStat, config: { unit: 'ms/t', displayName: 'Average response time' } },\n {\n name: Fields.secondaryStat,\n config: { unit: 't/min', displayName: 'Transactions per minute' },\n },\n ]);\n const edges = createDF('Edges', [\n { name: Fields.id },\n { name: Fields.source },\n { name: Fields.target },\n { name: Fields.mainStat, config: { unit: 't', displayName: 'Transactions' } },\n { name: Fields.secondaryStat, config: { unit: 'ms/t', displayName: 'Average response time' } },\n ]);\n\n return [nodes, edges];\n}\n\nfunction getMetricFrames(responses: DataQueryResponse[]) {\n const responsesMap = groupBy(responses, (r) => r.data[0].refId);\n const totalsDFView = new DataFrameView(responsesMap[totalsMetric][0].data[0]);\n const secondsDFView = new DataFrameView(responsesMap[secondsMetric][0].data[0]);\n return [totalsDFView, secondsDFView];\n}\n\n/**\n * Collect data from a metric into a map of nodes and edges. The metric data is modeled as counts of metric per edge\n * which is a pair of client-server nodes. This means we convert each row of the metric 1-1 to edges and than we assign\n * the metric also to server. We count the stats for server only as we show requests/transactions that particular node\n * processed not those which it generated and other stats like average transaction time then stem from that.\n * @param frame\n * @param stat\n * @param metric\n * @param nodesMap\n * @param edgesMap\n */\nfunction collectMetricData(\n frame: DataFrameView,\n stat: 'total' | 'seconds',\n metric: string,\n nodesMap: Record<string, any>,\n edgesMap: Record<string, any>\n) {\n // The name of the value column is in this format\n // TODO figure out if it can be changed\n const valueName = `Value #${metric}`;\n\n for (let i = 0; i < frame.length; i++) {\n const row = frame.get(i);\n const edgeId = `${row.client}_${row.server}`;\n\n if (!edgesMap[edgeId]) {\n edgesMap[edgeId] = {\n target: row.server,\n source: row.client,\n [stat]: row[valueName],\n };\n } else {\n edgesMap[edgeId][stat] = (edgesMap[edgeId][stat] || 0) + row[valueName];\n }\n\n if (!nodesMap[row.server]) {\n nodesMap[row.server] = {\n [stat]: row[valueName],\n };\n } else {\n nodesMap[row.server][stat] = (nodesMap[row.server][stat] || 0) + row[valueName];\n }\n\n if (!nodesMap[row.client]) {\n nodesMap[row.client] = {\n [stat]: 0,\n };\n }\n }\n}\n\nfunction convertToDataFrames(\n nodesMap: Record<string, any>,\n edgesMap: Record<string, any>,\n range: TimeRange\n): [DataFrame, DataFrame] {\n const rangeMs = range.to.valueOf() - range.from.valueOf();\n const [nodes, edges] = createServiceMapDataFrames();\n for (const nodeId of Object.keys(nodesMap)) {\n const node = nodesMap[nodeId];\n nodes.add({\n id: nodeId,\n title: nodeId,\n // NaN will not be shown in the node graph. This happens for a root client node which did not process\n // any requests itself.\n mainStat: node.total ? (node.seconds / node.total) * 1000 : Number.NaN,\n secondaryStat: node.total ? node.total / (rangeMs / (1000 * 60)) : Number.NaN,\n });\n }\n for (const edgeId of Object.keys(edgesMap)) {\n const edge = edgesMap[edgeId];\n edges.add({\n id: edgeId,\n source: edge.source,\n target: edge.target,\n mainStat: edge.total,\n secondaryStat: edge.total ? (edge.seconds / edge.total) * 1000 : Number.NaN,\n });\n }\n\n return [nodes, edges];\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 */\nvar BaggageImpl = /** @class */ (function () {\n function BaggageImpl(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n BaggageImpl.prototype.getEntry = function (key) {\n var entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n };\n BaggageImpl.prototype.getAllEntries = function () {\n return Array.from(this._entries.entries()).map(function (_a) {\n var k = _a[0], v = _a[1];\n return [k, v];\n });\n };\n BaggageImpl.prototype.setEntry = function (key, entry) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntry = function (key) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntries = function () {\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n var newBaggage = new BaggageImpl(this._entries);\n for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {\n var key = keys_1[_a];\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n };\n BaggageImpl.prototype.clear = function () {\n return new BaggageImpl();\n };\n return BaggageImpl;\n}());\nexport { BaggageImpl };\n//# sourceMappingURL=baggage-impl.js.map","/*\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 */\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport var baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","/*\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 */\nimport { diag } from '..';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries) {\n if (entries === void 0) { entries = {}; }\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(\"Cannot create baggage metadata from unknown type: \" + typeof str);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString: function () {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\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 */\nvar consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nvar DiagConsoleLogger = /** @class */ (function () {\n function DiagConsoleLogger() {\n function _consoleFunc(funcName) {\n return function () {\n var orgArguments = arguments;\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n var theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, orgArguments);\n }\n }\n };\n }\n for (var i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n return DiagConsoleLogger;\n}());\nexport { DiagConsoleLogger };\n//# sourceMappingURL=consoleLogger.js.map","/*\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 */\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\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 var defaultTextMapGetter = {\n get: function (carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys: function (carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexport var defaultTextMapSetter = {\n set: function (carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\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 */\n/** Get a key to uniquely identify a context value */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nvar BaseContext = /** @class */ (function () {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n function BaseContext(parentContext) {\n // for minification\n var self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = function (key) { return self._currentContext.get(key); };\n self.setValue = function (key, value) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = function (key) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n return BaseContext;\n}());\n/** The root context is used as the default parent context when there is no active context */\nexport var ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\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 var TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags || (TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","/*\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 */\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { TraceFlags } from './trace_flags';\nvar VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nvar VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\nexport var INVALID_SPANID = '0000000000000000';\nexport var INVALID_TRACEID = '00000000000000000000000000000000';\nexport var INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\nexport function isValidTraceId(traceId) {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;\n}\nexport function isValidSpanId(spanId) {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;\n}\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nexport function isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext) {\n return new NonRecordingSpan(spanContext);\n}\n//# sourceMappingURL=spancontext-utils.js.map","/*\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 */\nimport { INVALID_SPAN_CONTEXT } from './spancontext-utils';\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nvar NonRecordingSpan = /** @class */ (function () {\n function NonRecordingSpan(_spanContext) {\n if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n NonRecordingSpan.prototype.spanContext = function () {\n return this._spanContext;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttribute = function (_key, _value) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttributes = function (_attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setStatus = function (_status) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.updateName = function (_name) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.end = function (_endTime) { };\n // isRecording always returns false for NonRecordingSpan.\n NonRecordingSpan.prototype.isRecording = function () {\n return false;\n };\n // By default does nothing\n NonRecordingSpan.prototype.recordException = function (_exception, _time) { };\n return NonRecordingSpan;\n}());\nexport { NonRecordingSpan };\n//# sourceMappingURL=NonRecordingSpan.js.map","/*\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 */\nimport { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\n/**\n * span key\n */\nvar SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map","/*\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 */\nimport { context } from '../';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\n/**\n * No-op implementations of {@link Tracer}.\n */\nvar NoopTracer = /** @class */ (function () {\n function NoopTracer() {\n }\n // startSpan starts a noop span.\n NoopTracer.prototype.startSpan = function (name, options, context) {\n var root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n var parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n };\n NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {\n var opts;\n var ctx;\n var fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n var parentContext = ctx !== null && ctx !== void 0 ? ctx : context.active();\n var span = this.startSpan(name, opts, parentContext);\n var contextWithSpanSet = setSpan(parentContext, span);\n return context.with(contextWithSpanSet, fn, undefined, span);\n };\n return NoopTracer;\n}());\nexport { NoopTracer };\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","/*\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 */\nimport { NoopTracer } from './NoopTracer';\nvar NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nvar ProxyTracer = /** @class */ (function () {\n function ProxyTracer(_provider, name, version) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n }\n ProxyTracer.prototype.startSpan = function (name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n };\n ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {\n var tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n };\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n ProxyTracer.prototype._getTracer = function () {\n if (this._delegate) {\n return this._delegate;\n }\n var tracer = this._provider.getDelegateTracer(this.name, this.version);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n };\n return ProxyTracer;\n}());\nexport { ProxyTracer };\n//# sourceMappingURL=ProxyTracer.js.map","/*\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 */\n/**\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","/*\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 var SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind || (SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","/**\n * An enumeration of status codes.\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\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 */\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nvar NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nvar ProxyTracerProvider = /** @class */ (function () {\n function ProxyTracerProvider() {\n }\n /**\n * Get a {@link ProxyTracer}\n */\n ProxyTracerProvider.prototype.getTracer = function (name, version) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version));\n };\n ProxyTracerProvider.prototype.getDelegate = function () {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n };\n /**\n * Set the delegate tracer provider\n */\n ProxyTracerProvider.prototype.setDelegate = function (delegate) {\n this._delegate = delegate;\n };\n ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);\n };\n return ProxyTracerProvider;\n}());\nexport { ProxyTracerProvider };\n//# sourceMappingURL=ProxyTracerProvider.js.map","/*\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 */\nimport { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nvar NoopTracerProvider = /** @class */ (function () {\n function NoopTracerProvider() {\n }\n NoopTracerProvider.prototype.getTracer = function (_name, _version) {\n return new NoopTracer();\n };\n return NoopTracerProvider;\n}());\nexport { NoopTracerProvider };\n//# sourceMappingURL=NoopTracerProvider.js.map","/*\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 */\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { ROOT_CONTEXT } from './context';\nvar NoopContextManager = /** @class */ (function () {\n function NoopContextManager() {\n }\n NoopContextManager.prototype.active = function () {\n return ROOT_CONTEXT;\n };\n NoopContextManager.prototype.with = function (_context, fn, thisArg) {\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return fn.call.apply(fn, __spreadArray([thisArg], args));\n };\n NoopContextManager.prototype.bind = function (_context, target) {\n return target;\n };\n NoopContextManager.prototype.enable = function () {\n return this;\n };\n NoopContextManager.prototype.disable = function () {\n return this;\n };\n return NoopContextManager;\n}());\nexport { NoopContextManager };\n//# sourceMappingURL=NoopContextManager.js.map","/*\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 */\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef\nexport var _globalThis = typeof globalThis === 'object' ? globalThis : window;\n//# sourceMappingURL=globalThis.js.map","/*\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 */\n// this is autogenerated file, see scripts/version-update.js\nexport var VERSION = '1.0.2';\n//# sourceMappingURL=version.js.map","/*\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 */\nimport { VERSION } from '../version';\nvar re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n var acceptedVersions = new Set([ownVersion]);\n var rejectedVersions = new Set();\n var myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return function () { return false; };\n }\n var ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n var globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n var globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport var isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\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 */\nimport { _globalThis } from '../platform';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nvar major = VERSION.split('.')[0];\nvar GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\"opentelemetry.js.api.\" + major);\nvar _global = _globalThis;\nexport function registerGlobal(type, instance, diag, allowOverride) {\n var _a;\n if (allowOverride === void 0) { allowOverride = false; }\n var api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n var err = new Error(\"@opentelemetry/api: Attempted duplicate registration of API: \" + type);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n var err = new Error('@opentelemetry/api: All API registration versions must match');\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(\"@opentelemetry/api: Registered a global for \" + type + \" v\" + VERSION + \".\");\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(\"@opentelemetry/api: Unregistering a global for \" + type + \" v\" + VERSION + \".\");\n var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\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 */\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nvar DiagComponentLogger = /** @class */ (function () {\n function DiagComponentLogger(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n DiagComponentLogger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('debug', this._namespace, args);\n };\n DiagComponentLogger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('error', this._namespace, args);\n };\n DiagComponentLogger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('info', this._namespace, args);\n };\n DiagComponentLogger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('warn', this._namespace, args);\n };\n DiagComponentLogger.prototype.verbose = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('verbose', this._namespace, args);\n };\n return DiagComponentLogger;\n}());\nexport { DiagComponentLogger };\nfunction logProxy(funcName, namespace, args) {\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName].apply(logger, args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\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 */\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel, } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nvar API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nvar DiagAPI = /** @class */ (function () {\n /**\n * Private internal constructor\n * @private\n */\n function DiagAPI() {\n function _logProxy(funcName) {\n return function () {\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, \n // work around Function.prototype.apply types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n arguments);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n var self = this;\n // DiagAPI specific functions\n self.setLogger = function (logger, logLevel) {\n var _a, _b;\n if (logLevel === void 0) { logLevel = DiagLogLevel.INFO; }\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n var oldLogger = getGlobal('diag');\n var newLogger = createLogLevelDiagLogger(logLevel, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger) {\n var stack = (_b = new Error().stack) !== null && _b !== void 0 ? _b : '<failed to generate stacktrace>';\n oldLogger.warn(\"Current logger will be overwritten from \" + stack);\n newLogger.warn(\"Current logger will overwrite one already registered from \" + stack);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.disable = function () {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = function (options) {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n DiagAPI.instance = function () {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n };\n return DiagAPI;\n}());\nexport { DiagAPI };\n//# sourceMappingURL=diag.js.map","/*\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 */\nimport { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n var theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\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 */\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'context';\nvar NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nvar ContextAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function ContextAPI() {\n }\n /** Get the singleton instance of the Context API */\n ContextAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n };\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n ContextAPI.prototype.setGlobalContextManager = function (contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n };\n /**\n * Get the currently active context\n */\n ContextAPI.prototype.active = function () {\n return this._getContextManager().active();\n };\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n ContextAPI.prototype.with = function (context, fn, thisArg) {\n var _a;\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], args));\n };\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n ContextAPI.prototype.bind = function (context, target) {\n return this._getContextManager().bind(context, target);\n };\n ContextAPI.prototype._getContextManager = function () {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n };\n /** Disable and remove the global context manager */\n ContextAPI.prototype.disable = function () {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return ContextAPI;\n}());\nexport { ContextAPI };\n//# sourceMappingURL=context.js.map","/*\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 */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';\nimport { deleteSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nvar TraceAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function TraceAPI() {\n this._proxyTracerProvider = new ProxyTracerProvider();\n this.wrapSpanContext = wrapSpanContext;\n this.isSpanContextValid = isSpanContextValid;\n this.deleteSpan = deleteSpan;\n this.getSpan = getSpan;\n this.getSpanContext = getSpanContext;\n this.setSpan = setSpan;\n this.setSpanContext = setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n TraceAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n TraceAPI.prototype.setGlobalTracerProvider = function (provider) {\n var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n };\n /**\n * Returns the global tracer provider.\n */\n TraceAPI.prototype.getTracerProvider = function () {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n };\n /**\n * Returns a tracer from the global tracer provider.\n */\n TraceAPI.prototype.getTracer = function (name, version) {\n return this.getTracerProvider().getTracer(name, version);\n };\n /** Remove the global tracer provider */\n TraceAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n };\n return TraceAPI;\n}());\nexport { TraceAPI };\n//# sourceMappingURL=trace.js.map","/*\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 */\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nvar NoopTextMapPropagator = /** @class */ (function () {\n function NoopTextMapPropagator() {\n }\n /** Noop inject function does nothing */\n NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };\n /** Noop extract function does nothing and returns the input context */\n NoopTextMapPropagator.prototype.extract = function (context, _carrier) {\n return context;\n };\n NoopTextMapPropagator.prototype.fields = function () {\n return [];\n };\n return NoopTextMapPropagator;\n}());\nexport { NoopTextMapPropagator };\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\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 */\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nvar BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\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 */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'propagation';\nvar NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nvar PropagationAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function PropagationAPI() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n PropagationAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n };\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n PropagationAPI.prototype.setGlobalPropagator = function (propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n };\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n PropagationAPI.prototype.inject = function (context, carrier, setter) {\n if (setter === void 0) { setter = defaultTextMapSetter; }\n return this._getGlobalPropagator().inject(context, carrier, setter);\n };\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n PropagationAPI.prototype.extract = function (context, carrier, getter) {\n if (getter === void 0) { getter = defaultTextMapGetter; }\n return this._getGlobalPropagator().extract(context, carrier, getter);\n };\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n PropagationAPI.prototype.fields = function () {\n return this._getGlobalPropagator().fields();\n };\n /** Remove the global propagator */\n PropagationAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n PropagationAPI.prototype._getGlobalPropagator = function () {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n };\n return PropagationAPI;\n}());\nexport { PropagationAPI };\n//# sourceMappingURL=propagation.js.map","/*\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 * from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport * from './common/Exception';\nexport * from './common/Time';\nexport * from './diag';\nexport * from './propagation/TextMapPropagator';\nexport * from './trace/attributes';\nexport * from './trace/link';\nexport * from './trace/ProxyTracer';\nexport * from './trace/ProxyTracerProvider';\nexport * from './trace/Sampler';\nexport * from './trace/SamplingResult';\nexport * from './trace/span_context';\nexport * from './trace/span_kind';\nexport * from './trace/span';\nexport * from './trace/SpanOptions';\nexport * from './trace/status';\nexport * from './trace/trace_flags';\nexport * from './trace/trace_state';\nexport * from './trace/tracer_provider';\nexport * from './trace/tracer';\nexport { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';\nexport * from './context/context';\nexport * from './context/types';\nimport { ContextAPI } from './api/context';\n/** Entrypoint for context API */\nexport var context = ContextAPI.getInstance();\nimport { TraceAPI } from './api/trace';\n/** Entrypoint for trace API */\nexport var trace = TraceAPI.getInstance();\nimport { PropagationAPI } from './api/propagation';\n/** Entrypoint for propagation API */\nexport var propagation = PropagationAPI.getInstance();\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexport var diag = DiagAPI.instance();\nexport default {\n trace: trace,\n context: context,\n propagation: propagation,\n diag: diag,\n};\n//# sourceMappingURL=index.js.map","/*\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 */\nimport { createContextKey } from '@opentelemetry/api';\nvar SUPPRESS_TRACING_KEY = createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nexport function suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexport function unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexport function isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\n//# sourceMappingURL=suppress-tracing.js.map","/*\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 var BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexport var BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexport var BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexport var BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexport var BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexport var BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexport var BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","/*\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 */\nimport { baggageEntryMetadataFromString } from '@opentelemetry/api';\nimport { BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_PROPERTIES_SEPARATOR, BAGGAGE_KEY_PAIR_SEPARATOR, BAGGAGE_MAX_TOTAL_LENGTH, } from './constants';\nexport var serializeKeyPairs = function (keyPairs) {\n return keyPairs.reduce(function (hValue, current) {\n var value = \"\" + hValue + (hValue !== '' ? BAGGAGE_ITEMS_SEPARATOR : '') + current;\n return value.length > BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n};\nexport var getKeyPairs = function (baggage) {\n return baggage\n .getAllEntries()\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(value.value);\n });\n};\nexport var parsePairKeyValue = function (entry) {\n var valueProps = entry.split(BAGGAGE_PROPERTIES_SEPARATOR);\n if (valueProps.length <= 0)\n return;\n var keyPairPart = valueProps.shift();\n if (!keyPairPart)\n return;\n var keyPair = keyPairPart.split(BAGGAGE_KEY_PAIR_SEPARATOR);\n if (keyPair.length !== 2)\n return;\n var key = decodeURIComponent(keyPair[0].trim());\n var value = decodeURIComponent(keyPair[1].trim());\n var metadata;\n if (valueProps.length > 0) {\n metadata = baggageEntryMetadataFromString(valueProps.join(BAGGAGE_PROPERTIES_SEPARATOR));\n }\n return { key: key, value: value, metadata: metadata };\n};\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nexport var parseKeyPairsIntoRecord = function (value) {\n if (typeof value !== 'string' || value.length === 0)\n return {};\n return value\n .split(BAGGAGE_ITEMS_SEPARATOR)\n .map(function (entry) {\n return parsePairKeyValue(entry);\n })\n .filter(function (keyPair) { return keyPair !== undefined && keyPair.value.length > 0; })\n .reduce(function (headers, keyPair) {\n headers[keyPair.key] = keyPair.value;\n return headers;\n }, {});\n};\n//# sourceMappingURL=utils.js.map","/*\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 */\nimport { propagation, } from '@opentelemetry/api';\nimport { isTracingSuppressed } from '../../trace/suppress-tracing';\nimport { BAGGAGE_HEADER, BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_MAX_NAME_VALUE_PAIRS, BAGGAGE_MAX_PER_NAME_VALUE_PAIRS } from '../constants';\nimport { getKeyPairs, parsePairKeyValue, serializeKeyPairs } from '../utils';\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nvar HttpBaggagePropagator = /** @class */ (function () {\n function HttpBaggagePropagator() {\n }\n HttpBaggagePropagator.prototype.inject = function (context, carrier, setter) {\n var baggage = propagation.getBaggage(context);\n if (!baggage || isTracingSuppressed(context))\n return;\n var keyPairs = getKeyPairs(baggage)\n .filter(function (pair) {\n return pair.length <= BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, BAGGAGE_MAX_NAME_VALUE_PAIRS);\n var headerValue = serializeKeyPairs(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, BAGGAGE_HEADER, headerValue);\n }\n };\n HttpBaggagePropagator.prototype.extract = function (context, carrier, getter) {\n var headerValue = getter.get(carrier, BAGGAGE_HEADER);\n if (!headerValue)\n return context;\n var baggage = {};\n if (headerValue.length === 0) {\n return context;\n }\n var pairs = headerValue.split(BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(function (entry) {\n var keyPair = parsePairKeyValue(entry);\n if (keyPair) {\n var baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return propagation.setBaggage(context, propagation.createBaggage(baggage));\n };\n HttpBaggagePropagator.prototype.fields = function () {\n return [BAGGAGE_HEADER];\n };\n return HttpBaggagePropagator;\n}());\nexport { HttpBaggagePropagator };\n//# sourceMappingURL=HttpBaggagePropagator.js.map","/*\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 */\nimport { loggingErrorHandler } from './logging-error-handler';\n/** The global error handler delegate */\nvar delegateHandler = loggingErrorHandler();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nexport function setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nexport var globalErrorHandler = function (ex) {\n try {\n delegateHandler(ex);\n }\n catch (_a) { } // eslint-disable-line no-empty\n};\n//# sourceMappingURL=global-error-handler.js.map","/*\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 */\nimport { diag } from '@opentelemetry/api';\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nexport function loggingErrorHandler() {\n return function (ex) {\n diag.error(stringifyException(ex));\n };\n}\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n var result = {};\n var current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(function (propertyName) {\n if (result[propertyName])\n return;\n var value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","/*\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 var TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues || (TracesSamplerValues = {}));\n//# sourceMappingURL=sampling.js.map","/*\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 */\nimport { DiagLogLevel } from '@opentelemetry/api';\nimport { TracesSamplerValues } from './sampling';\nvar DEFAULT_LIST_SEPARATOR = ',';\n/**\n * Environment interface to define all names\n */\nvar ENVIRONMENT_NUMBERS_KEYS = [\n 'OTEL_BSP_EXPORT_TIMEOUT',\n 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',\n 'OTEL_BSP_MAX_QUEUE_SIZE',\n 'OTEL_BSP_SCHEDULE_DELAY',\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_EVENT_COUNT_LIMIT',\n 'OTEL_SPAN_LINK_COUNT_LIMIT',\n];\nfunction isEnvVarANumber(key) {\n return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1);\n}\nvar ENVIRONMENT_LISTS_KEYS = [\n 'OTEL_NO_PATCH_MODULES',\n 'OTEL_PROPAGATORS',\n];\nfunction isEnvVarAList(key) {\n return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1;\n}\n/**\n * Default environment variables\n */\nexport var DEFAULT_ENVIRONMENT = {\n CONTAINER_NAME: '',\n ECS_CONTAINER_METADATA_URI_V4: '',\n ECS_CONTAINER_METADATA_URI: '',\n HOSTNAME: '',\n KUBERNETES_SERVICE_HOST: '',\n NAMESPACE: '',\n OTEL_BSP_EXPORT_TIMEOUT: 30000,\n OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512,\n OTEL_BSP_MAX_QUEUE_SIZE: 2048,\n OTEL_BSP_SCHEDULE_DELAY: 5000,\n OTEL_EXPORTER_JAEGER_AGENT_HOST: '',\n OTEL_EXPORTER_JAEGER_ENDPOINT: '',\n OTEL_EXPORTER_JAEGER_PASSWORD: '',\n OTEL_EXPORTER_JAEGER_USER: '',\n OTEL_EXPORTER_OTLP_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_HEADERS: '',\n OTEL_EXPORTER_OTLP_TRACES_HEADERS: '',\n OTEL_EXPORTER_OTLP_METRICS_HEADERS: '',\n OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans',\n OTEL_LOG_LEVEL: DiagLogLevel.INFO,\n OTEL_NO_PATCH_MODULES: [],\n OTEL_PROPAGATORS: ['tracecontext', 'baggage'],\n OTEL_RESOURCE_ATTRIBUTES: '',\n OTEL_SERVICE_NAME: '',\n OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: 128,\n OTEL_SPAN_EVENT_COUNT_LIMIT: 128,\n OTEL_SPAN_LINK_COUNT_LIMIT: 128,\n OTEL_TRACES_EXPORTER: 'none',\n OTEL_TRACES_SAMPLER: TracesSamplerValues.ParentBasedAlwaysOn,\n OTEL_TRACES_SAMPLER_ARG: '',\n};\n/**\n * Parses a variable as number with number validation\n * @param name\n * @param environment\n * @param values\n * @param min\n * @param max\n */\nfunction parseNumber(name, environment, values, min, max) {\n if (min === void 0) { min = -Infinity; }\n if (max === void 0) { max = Infinity; }\n if (typeof values[name] !== 'undefined') {\n var value = Number(values[name]);\n if (!isNaN(value)) {\n if (value < min) {\n environment[name] = min;\n }\n else if (value > max) {\n environment[name] = max;\n }\n else {\n environment[name] = value;\n }\n }\n }\n}\n/**\n * Parses list-like strings from input into output.\n * @param name\n * @param environment\n * @param values\n * @param separator\n */\nfunction parseStringList(name, output, input, separator) {\n if (separator === void 0) { separator = DEFAULT_LIST_SEPARATOR; }\n var givenValue = input[name];\n if (typeof givenValue === 'string') {\n output[name] = givenValue.split(separator).map(function (v) { return v.trim(); });\n }\n}\n// The support string -> DiagLogLevel mappings\nvar logLevelMap = {\n ALL: DiagLogLevel.ALL,\n VERBOSE: DiagLogLevel.VERBOSE,\n DEBUG: DiagLogLevel.DEBUG,\n INFO: DiagLogLevel.INFO,\n WARN: DiagLogLevel.WARN,\n ERROR: DiagLogLevel.ERROR,\n NONE: DiagLogLevel.NONE,\n};\n/**\n * Environmentally sets log level if valid log level string is provided\n * @param key\n * @param environment\n * @param values\n */\nfunction setLogLevelFromEnv(key, environment, values) {\n var value = values[key];\n if (typeof value === 'string') {\n var theLevel = logLevelMap[value.toUpperCase()];\n if (theLevel != null) {\n environment[key] = theLevel;\n }\n }\n}\n/**\n * Parses environment values\n * @param values\n */\nexport function parseEnvironment(values) {\n var environment = {};\n for (var env in DEFAULT_ENVIRONMENT) {\n var key = env;\n switch (key) {\n case 'OTEL_LOG_LEVEL':\n setLogLevelFromEnv(key, environment, values);\n break;\n default:\n if (isEnvVarANumber(key)) {\n parseNumber(key, environment, values);\n }\n else if (isEnvVarAList(key)) {\n parseStringList(key, environment, values);\n }\n else {\n var value = values[key];\n if (typeof value !== 'undefined' && value !== null) {\n environment[key] = String(value);\n }\n }\n }\n }\n return environment;\n}\n//# sourceMappingURL=environment.js.map","/*\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 */\nimport { DEFAULT_ENVIRONMENT, parseEnvironment, } from '../../utils/environment';\n/**\n * Gets the environment variables\n */\nexport function getEnv() {\n var _window = window;\n var globalEnv = parseEnvironment(_window);\n return Object.assign({}, DEFAULT_ENVIRONMENT, globalEnv);\n}\n//# sourceMappingURL=environment.js.map","/*\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 function hexToBase64(hexStr) {\n var hexStrLen = hexStr.length;\n var hexAsciiCharsStr = '';\n for (var i = 0; i < hexStrLen; i += 2) {\n var hexPair = hexStr.substring(i, i + 2);\n var hexVal = parseInt(hexPair, 16);\n hexAsciiCharsStr += String.fromCharCode(hexVal);\n }\n return btoa(hexAsciiCharsStr);\n}\n//# sourceMappingURL=hex-to-base64.js.map","var SPAN_ID_BYTES = 8;\nvar TRACE_ID_BYTES = 16;\nvar RandomIdGenerator = /** @class */ (function () {\n function RandomIdGenerator() {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n this.generateTraceId = getIdGenerator(TRACE_ID_BYTES);\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n this.generateSpanId = getIdGenerator(SPAN_ID_BYTES);\n }\n return RandomIdGenerator;\n}());\nexport { RandomIdGenerator };\nvar SHARED_CHAR_CODES_ARRAY = Array(32);\nfunction getIdGenerator(bytes) {\n return function generateId() {\n for (var i = 0; i < bytes * 2; i++) {\n SHARED_CHAR_CODES_ARRAY[i] = Math.floor(Math.random() * 16) + 48;\n // valid hex characters in the range 48-57 and 97-102\n if (SHARED_CHAR_CODES_ARRAY[i] >= 58) {\n SHARED_CHAR_CODES_ARRAY[i] += 39;\n }\n }\n return String.fromCharCode.apply(null, SHARED_CHAR_CODES_ARRAY.slice(0, bytes * 2));\n };\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","/*\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 var otperformance = performance;\n//# sourceMappingURL=performance.js.map","/*\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 */\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexport var SemanticAttributes = {\n /**\n * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.\n */\n DB_SYSTEM: 'db.system',\n /**\n * The connection string used to connect to the database. It is recommended to remove embedded credentials.\n */\n DB_CONNECTION_STRING: 'db.connection_string',\n /**\n * Username for accessing the database.\n */\n DB_USER: 'db.user',\n /**\n * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n */\n DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname',\n /**\n * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n *\n * Note: In some SQL databases, the database name to be used is called "schema name".\n */\n DB_NAME: 'db.name',\n /**\n * The database statement being executed.\n *\n * Note: The value may be sanitized to exclude sensitive information.\n */\n DB_STATEMENT: 'db.statement',\n /**\n * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n *\n * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n */\n DB_OPERATION: 'db.operation',\n /**\n * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n *\n * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard).\n */\n DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name',\n /**\n * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace',\n /**\n * The fetch size used for paging, i.e. how many rows will be returned at once.\n */\n DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size',\n /**\n * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n */\n DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_CASSANDRA_TABLE: 'db.cassandra.table',\n /**\n * Whether or not the query is idempotent.\n */\n DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence',\n /**\n * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n */\n DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count',\n /**\n * The ID of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id',\n /**\n * The data center of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc',\n /**\n * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_HBASE_NAMESPACE: 'db.hbase.namespace',\n /**\n * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n */\n DB_REDIS_DATABASE_INDEX: 'db.redis.database_index',\n /**\n * The collection being accessed within the database stated in `db.name`.\n */\n DB_MONGODB_COLLECTION: 'db.mongodb.collection',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_SQL_TABLE: 'db.sql.table',\n /**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n */\n EXCEPTION_TYPE: 'exception.type',\n /**\n * The exception message.\n */\n EXCEPTION_MESSAGE: 'exception.message',\n /**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n */\n EXCEPTION_STACKTRACE: 'exception.stacktrace',\n /**\n * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.\n *\n * Note: An exception is considered to have escaped (or left) the scope of a span,\n if that span is ended while the exception is still logically "in flight".\n This may be actually "in flight" in some languages (e.g. if the exception\n is passed to a Context manager's `__exit__` method in Python) but will\n usually be caught at the point of recording the exception in most languages.\n \n It is usually not possible to determine at the point where an exception is thrown\n whether it will escape the scope of a span.\n However, it is trivial to know that an exception\n will escape, if one checks for an active exception just before ending the span,\n as done in the [example above](#exception-end-example).\n \n It follows that an exception may still escape the scope of the span\n even if the `exception.escaped` attribute was not set or set to false,\n since the event might have been recorded at a time where it was not\n clear whether the exception will escape.\n */\n EXCEPTION_ESCAPED: 'exception.escaped',\n /**\n * Type of the trigger on which the function is executed.\n */\n FAAS_TRIGGER: 'faas.trigger',\n /**\n * The execution ID of the current function execution.\n */\n FAAS_EXECUTION: 'faas.execution',\n /**\n * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.\n */\n FAAS_DOCUMENT_COLLECTION: 'faas.document.collection',\n /**\n * Describes the type of the operation that was performed on the data.\n */\n FAAS_DOCUMENT_OPERATION: 'faas.document.operation',\n /**\n * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_DOCUMENT_TIME: 'faas.document.time',\n /**\n * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.\n */\n FAAS_DOCUMENT_NAME: 'faas.document.name',\n /**\n * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_TIME: 'faas.time',\n /**\n * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).\n */\n FAAS_CRON: 'faas.cron',\n /**\n * A boolean that is true if the serverless function is executed for the first time (aka cold-start).\n */\n FAAS_COLDSTART: 'faas.coldstart',\n /**\n * The name of the invoked function.\n *\n * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function.\n */\n FAAS_INVOKED_NAME: 'faas.invoked_name',\n /**\n * The cloud provider of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.\n */\n FAAS_INVOKED_PROVIDER: 'faas.invoked_provider',\n /**\n * The cloud region of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function.\n */\n FAAS_INVOKED_REGION: 'faas.invoked_region',\n /**\n * Transport protocol used. See note below.\n */\n NET_TRANSPORT: 'net.transport',\n /**\n * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6).\n */\n NET_PEER_IP: 'net.peer.ip',\n /**\n * Remote port number.\n */\n NET_PEER_PORT: 'net.peer.port',\n /**\n * Remote hostname or similar, see note below.\n */\n NET_PEER_NAME: 'net.peer.name',\n /**\n * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.\n */\n NET_HOST_IP: 'net.host.ip',\n /**\n * Like `net.peer.port` but for the host port.\n */\n NET_HOST_PORT: 'net.host.port',\n /**\n * Local hostname or similar, see note below.\n */\n NET_HOST_NAME: 'net.host.name',\n /**\n * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.\n */\n PEER_SERVICE: 'peer.service',\n /**\n * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.\n */\n ENDUSER_ID: 'enduser.id',\n /**\n * Actual/assumed role the client is making the request under extracted from token or application security context.\n */\n ENDUSER_ROLE: 'enduser.role',\n /**\n * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).\n */\n ENDUSER_SCOPE: 'enduser.scope',\n /**\n * Current "managed" thread ID (as opposed to OS thread ID).\n */\n THREAD_ID: 'thread.id',\n /**\n * Current thread name.\n */\n THREAD_NAME: 'thread.name',\n /**\n * The method or function name, or equivalent (usually rightmost part of the code unit's name).\n */\n CODE_FUNCTION: 'code.function',\n /**\n * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.\n */\n CODE_NAMESPACE: 'code.namespace',\n /**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).\n */\n CODE_FILEPATH: 'code.filepath',\n /**\n * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.\n */\n CODE_LINENO: 'code.lineno',\n /**\n * HTTP request method.\n */\n HTTP_METHOD: 'http.method',\n /**\n * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.\n *\n * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.\n */\n HTTP_URL: 'http.url',\n /**\n * The full request target as passed in a HTTP request line or equivalent.\n */\n HTTP_TARGET: 'http.target',\n /**\n * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same.\n */\n HTTP_HOST: 'http.host',\n /**\n * The URI scheme identifying the used protocol.\n */\n HTTP_SCHEME: 'http.scheme',\n /**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n */\n HTTP_STATUS_CODE: 'http.status_code',\n /**\n * Kind of HTTP protocol used.\n *\n * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.\n */\n HTTP_FLAVOR: 'http.flavor',\n /**\n * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.\n */\n HTTP_USER_AGENT: 'http.user_agent',\n /**\n * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length',\n /**\n * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed',\n /**\n * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length',\n /**\n * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed',\n /**\n * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead).\n *\n * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available.\n */\n HTTP_SERVER_NAME: 'http.server_name',\n /**\n * The matched route (path template).\n */\n HTTP_ROUTE: 'http.route',\n /**\n * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).\n *\n * Note: This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy.\n */\n HTTP_CLIENT_IP: 'http.client_ip',\n /**\n * The keys in the `RequestItems` object field.\n */\n AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names',\n /**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n */\n AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity',\n /**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n */\n AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics',\n /**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity',\n /**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity',\n /**\n * The value of the `ConsistentRead` request parameter.\n */\n AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read',\n /**\n * The value of the `ProjectionExpression` request parameter.\n */\n AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection',\n /**\n * The value of the `Limit` request parameter.\n */\n AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit',\n /**\n * The value of the `AttributesToGet` request parameter.\n */\n AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get',\n /**\n * The value of the `IndexName` request parameter.\n */\n AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name',\n /**\n * The value of the `Select` request parameter.\n */\n AWS_DYNAMODB_SELECT: 'aws.dynamodb.select',\n /**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes',\n /**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes',\n /**\n * The value of the `ExclusiveStartTableName` request parameter.\n */\n AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table',\n /**\n * The the number of items in the `TableNames` response parameter.\n */\n AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count',\n /**\n * The value of the `ScanIndexForward` request parameter.\n */\n AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward',\n /**\n * The value of the `Segment` request parameter.\n */\n AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment',\n /**\n * The value of the `TotalSegments` request parameter.\n */\n AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments',\n /**\n * The value of the `Count` response parameter.\n */\n AWS_DYNAMODB_COUNT: 'aws.dynamodb.count',\n /**\n * The value of the `ScannedCount` response parameter.\n */\n AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count',\n /**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n */\n AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions',\n /**\n * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates',\n /**\n * A string identifying the messaging system.\n */\n MESSAGING_SYSTEM: 'messaging.system',\n /**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n */\n MESSAGING_DESTINATION: 'messaging.destination',\n /**\n * The kind of message destination.\n */\n MESSAGING_DESTINATION_KIND: 'messaging.destination_kind',\n /**\n * A boolean that is true if the message destination is temporary.\n */\n MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination',\n /**\n * The name of the transport protocol.\n */\n MESSAGING_PROTOCOL: 'messaging.protocol',\n /**\n * The version of the transport protocol.\n */\n MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version',\n /**\n * Connection string.\n */\n MESSAGING_URL: 'messaging.url',\n /**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n */\n MESSAGING_MESSAGE_ID: 'messaging.message_id',\n /**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".\n */\n MESSAGING_CONVERSATION_ID: 'messaging.conversation_id',\n /**\n * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported.\n */\n MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes',\n /**\n * The compressed size of the message payload in bytes.\n */\n MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes',\n /**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n */\n MESSAGING_OPERATION: 'messaging.operation',\n /**\n * RabbitMQ message routing key.\n */\n MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key',\n /**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.\n *\n * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n */\n MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key',\n /**\n * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers.\n */\n MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group',\n /**\n * Client Id for the Consumer or Producer that is handling the message.\n */\n MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id',\n /**\n * Partition the message is sent to.\n */\n MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition',\n /**\n * A boolean that is true if the message is a tombstone.\n */\n MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone',\n /**\n * A string identifying the remoting system.\n */\n RPC_SYSTEM: 'rpc.system',\n /**\n * The full name of the service being called, including its package name, if applicable.\n */\n RPC_SERVICE: 'rpc.service',\n /**\n * The name of the method being called, must be equal to the $method part in the span name.\n */\n RPC_METHOD: 'rpc.method',\n /**\n * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.\n */\n RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code',\n /**\n * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted.\n */\n RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version',\n /**\n * `method` property from request. Unlike `rpc.method`, this may not relate to the actual method being called. Useful for client-side traces since client does not know what will be called on the server.\n */\n RPC_JSONRPC_METHOD: 'rpc.jsonrpc.method',\n /**\n * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification.\n */\n RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id',\n /**\n * `error.code` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code',\n /**\n * `error.message` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message',\n};\n// Enum definitions\nexport var DbSystemValues;\n(function (DbSystemValues) {\n /** Some other SQL database. Fallback only. See notes. */\n DbSystemValues[\"OTHER_SQL\"] = \"other_sql\";\n /** Microsoft SQL Server. */\n DbSystemValues[\"MSSQL\"] = \"mssql\";\n /** MySQL. */\n DbSystemValues[\"MYSQL\"] = \"mysql\";\n /** Oracle Database. */\n DbSystemValues[\"ORACLE\"] = \"oracle\";\n /** IBM Db2. */\n DbSystemValues[\"DB2\"] = \"db2\";\n /** PostgreSQL. */\n DbSystemValues[\"POSTGRESQL\"] = \"postgresql\";\n /** Amazon Redshift. */\n DbSystemValues[\"REDSHIFT\"] = \"redshift\";\n /** Apache Hive. */\n DbSystemValues[\"HIVE\"] = \"hive\";\n /** Cloudscape. */\n DbSystemValues[\"CLOUDSCAPE\"] = \"cloudscape\";\n /** HyperSQL DataBase. */\n DbSystemValues[\"HSQLDB\"] = \"hsqldb\";\n /** Progress Database. */\n DbSystemValues[\"PROGRESS\"] = \"progress\";\n /** SAP MaxDB. */\n DbSystemValues[\"MAXDB\"] = \"maxdb\";\n /** SAP HANA. */\n DbSystemValues[\"HANADB\"] = \"hanadb\";\n /** Ingres. */\n DbSystemValues[\"INGRES\"] = \"ingres\";\n /** FirstSQL. */\n DbSystemValues[\"FIRSTSQL\"] = \"firstsql\";\n /** EnterpriseDB. */\n DbSystemValues[\"EDB\"] = \"edb\";\n /** InterSystems Caché. */\n DbSystemValues[\"CACHE\"] = \"cache\";\n /** Adabas (Adaptable Database System). */\n DbSystemValues[\"ADABAS\"] = \"adabas\";\n /** Firebird. */\n DbSystemValues[\"FIREBIRD\"] = \"firebird\";\n /** Apache Derby. */\n DbSystemValues[\"DERBY\"] = \"derby\";\n /** FileMaker. */\n DbSystemValues[\"FILEMAKER\"] = \"filemaker\";\n /** Informix. */\n DbSystemValues[\"INFORMIX\"] = \"informix\";\n /** InstantDB. */\n DbSystemValues[\"INSTANTDB\"] = \"instantdb\";\n /** InterBase. */\n DbSystemValues[\"INTERBASE\"] = \"interbase\";\n /** MariaDB. */\n DbSystemValues[\"MARIADB\"] = \"mariadb\";\n /** Netezza. */\n DbSystemValues[\"NETEZZA\"] = \"netezza\";\n /** Pervasive PSQL. */\n DbSystemValues[\"PERVASIVE\"] = \"pervasive\";\n /** PointBase. */\n DbSystemValues[\"POINTBASE\"] = \"pointbase\";\n /** SQLite. */\n DbSystemValues[\"SQLITE\"] = \"sqlite\";\n /** Sybase. */\n DbSystemValues[\"SYBASE\"] = \"sybase\";\n /** Teradata. */\n DbSystemValues[\"TERADATA\"] = \"teradata\";\n /** Vertica. */\n DbSystemValues[\"VERTICA\"] = \"vertica\";\n /** H2. */\n DbSystemValues[\"H2\"] = \"h2\";\n /** ColdFusion IMQ. */\n DbSystemValues[\"COLDFUSION\"] = \"coldfusion\";\n /** Apache Cassandra. */\n DbSystemValues[\"CASSANDRA\"] = \"cassandra\";\n /** Apache HBase. */\n DbSystemValues[\"HBASE\"] = \"hbase\";\n /** MongoDB. */\n DbSystemValues[\"MONGODB\"] = \"mongodb\";\n /** Redis. */\n DbSystemValues[\"REDIS\"] = \"redis\";\n /** Couchbase. */\n DbSystemValues[\"COUCHBASE\"] = \"couchbase\";\n /** CouchDB. */\n DbSystemValues[\"COUCHDB\"] = \"couchdb\";\n /** Microsoft Azure Cosmos DB. */\n DbSystemValues[\"COSMOSDB\"] = \"cosmosdb\";\n /** Amazon DynamoDB. */\n DbSystemValues[\"DYNAMODB\"] = \"dynamodb\";\n /** Neo4j. */\n DbSystemValues[\"NEO4J\"] = \"neo4j\";\n /** Apache Geode. */\n DbSystemValues[\"GEODE\"] = \"geode\";\n /** Elasticsearch. */\n DbSystemValues[\"ELASTICSEARCH\"] = \"elasticsearch\";\n /** Memcached. */\n DbSystemValues[\"MEMCACHED\"] = \"memcached\";\n /** CockroachDB. */\n DbSystemValues[\"COCKROACHDB\"] = \"cockroachdb\";\n})(DbSystemValues || (DbSystemValues = {}));\nexport var DbCassandraConsistencyLevelValues;\n(function (DbCassandraConsistencyLevelValues) {\n /** all. */\n DbCassandraConsistencyLevelValues[\"ALL\"] = \"all\";\n /** each_quorum. */\n DbCassandraConsistencyLevelValues[\"EACH_QUORUM\"] = \"each_quorum\";\n /** quorum. */\n DbCassandraConsistencyLevelValues[\"QUORUM\"] = \"quorum\";\n /** local_quorum. */\n DbCassandraConsistencyLevelValues[\"LOCAL_QUORUM\"] = \"local_quorum\";\n /** one. */\n DbCassandraConsistencyLevelValues[\"ONE\"] = \"one\";\n /** two. */\n DbCassandraConsistencyLevelValues[\"TWO\"] = \"two\";\n /** three. */\n DbCassandraConsistencyLevelValues[\"THREE\"] = \"three\";\n /** local_one. */\n DbCassandraConsistencyLevelValues[\"LOCAL_ONE\"] = \"local_one\";\n /** any. */\n DbCassandraConsistencyLevelValues[\"ANY\"] = \"any\";\n /** serial. */\n DbCassandraConsistencyLevelValues[\"SERIAL\"] = \"serial\";\n /** local_serial. */\n DbCassandraConsistencyLevelValues[\"LOCAL_SERIAL\"] = \"local_serial\";\n})(DbCassandraConsistencyLevelValues || (DbCassandraConsistencyLevelValues = {}));\nexport var FaasTriggerValues;\n(function (FaasTriggerValues) {\n /** A response to some data source operation such as a database or filesystem read/write. */\n FaasTriggerValues[\"DATASOURCE\"] = \"datasource\";\n /** To provide an answer to an inbound HTTP request. */\n FaasTriggerValues[\"HTTP\"] = \"http\";\n /** A function is set to be executed when messages are sent to a messaging system. */\n FaasTriggerValues[\"PUBSUB\"] = \"pubsub\";\n /** A function is scheduled to be executed regularly. */\n FaasTriggerValues[\"TIMER\"] = \"timer\";\n /** If none of the others apply. */\n FaasTriggerValues[\"OTHER\"] = \"other\";\n})(FaasTriggerValues || (FaasTriggerValues = {}));\nexport var FaasDocumentOperationValues;\n(function (FaasDocumentOperationValues) {\n /** When a new object is created. */\n FaasDocumentOperationValues[\"INSERT\"] = \"insert\";\n /** When an object is modified. */\n FaasDocumentOperationValues[\"EDIT\"] = \"edit\";\n /** When an object is deleted. */\n FaasDocumentOperationValues[\"DELETE\"] = \"delete\";\n})(FaasDocumentOperationValues || (FaasDocumentOperationValues = {}));\nexport var FaasInvokedProviderValues;\n(function (FaasInvokedProviderValues) {\n /** Amazon Web Services. */\n FaasInvokedProviderValues[\"AWS\"] = \"aws\";\n /** Microsoft Azure. */\n FaasInvokedProviderValues[\"AZURE\"] = \"azure\";\n /** Google Cloud Platform. */\n FaasInvokedProviderValues[\"GCP\"] = \"gcp\";\n})(FaasInvokedProviderValues || (FaasInvokedProviderValues = {}));\nexport var NetTransportValues;\n(function (NetTransportValues) {\n /** ip_tcp. */\n NetTransportValues[\"IP_TCP\"] = \"ip_tcp\";\n /** ip_udp. */\n NetTransportValues[\"IP_UDP\"] = \"ip_udp\";\n /** Another IP-based protocol. */\n NetTransportValues[\"IP\"] = \"ip\";\n /** Unix Domain socket. See below. */\n NetTransportValues[\"UNIX\"] = \"unix\";\n /** Named or anonymous pipe. See note below. */\n NetTransportValues[\"PIPE\"] = \"pipe\";\n /** In-process communication. */\n NetTransportValues[\"INPROC\"] = \"inproc\";\n /** Something else (non IP-based). */\n NetTransportValues[\"OTHER\"] = \"other\";\n})(NetTransportValues || (NetTransportValues = {}));\nexport var HttpFlavorValues;\n(function (HttpFlavorValues) {\n /** HTTP 1.0. */\n HttpFlavorValues[\"HTTP_1_0\"] = \"1.0\";\n /** HTTP 1.1. */\n HttpFlavorValues[\"HTTP_1_1\"] = \"1.1\";\n /** HTTP 2. */\n HttpFlavorValues[\"HTTP_2_0\"] = \"2.0\";\n /** SPDY protocol. */\n HttpFlavorValues[\"SPDY\"] = \"SPDY\";\n /** QUIC protocol. */\n HttpFlavorValues[\"QUIC\"] = \"QUIC\";\n})(HttpFlavorValues || (HttpFlavorValues = {}));\nexport var MessagingDestinationKindValues;\n(function (MessagingDestinationKindValues) {\n /** A message sent to a queue. */\n MessagingDestinationKindValues[\"QUEUE\"] = \"queue\";\n /** A message sent to a topic. */\n MessagingDestinationKindValues[\"TOPIC\"] = \"topic\";\n})(MessagingDestinationKindValues || (MessagingDestinationKindValues = {}));\nexport var MessagingOperationValues;\n(function (MessagingOperationValues) {\n /** receive. */\n MessagingOperationValues[\"RECEIVE\"] = \"receive\";\n /** process. */\n MessagingOperationValues[\"PROCESS\"] = \"process\";\n})(MessagingOperationValues || (MessagingOperationValues = {}));\nexport var RpcGrpcStatusCodeValues;\n(function (RpcGrpcStatusCodeValues) {\n /** OK. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"OK\"] = 0] = \"OK\";\n /** CANCELLED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"CANCELLED\"] = 1] = \"CANCELLED\";\n /** UNKNOWN. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\n /** INVALID_ARGUMENT. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\n /** DEADLINE_EXCEEDED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\n /** NOT_FOUND. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\n /** ALREADY_EXISTS. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\n /** PERMISSION_DENIED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\n /** RESOURCE_EXHAUSTED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\n /** FAILED_PRECONDITION. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\n /** ABORTED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"ABORTED\"] = 10] = \"ABORTED\";\n /** OUT_OF_RANGE. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\n /** UNIMPLEMENTED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\n /** INTERNAL. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"INTERNAL\"] = 13] = \"INTERNAL\";\n /** UNAVAILABLE. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\n /** DATA_LOSS. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\n /** UNAUTHENTICATED. */\n RpcGrpcStatusCodeValues[RpcGrpcStatusCodeValues[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\n})(RpcGrpcStatusCodeValues || (RpcGrpcStatusCodeValues = {}));\n//# sourceMappingURL=SemanticAttributes.js.map","/*\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 */\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexport var ResourceAttributes = {\n /**\n * Name of the cloud provider.\n */\n CLOUD_PROVIDER: 'cloud.provider',\n /**\n * The cloud account ID the resource is assigned to.\n */\n CLOUD_ACCOUNT_ID: 'cloud.account.id',\n /**\n * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations).\n */\n CLOUD_REGION: 'cloud.region',\n /**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * Note: Availability zones are called "zones" on Google Cloud.\n */\n CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone',\n /**\n * The cloud platform in use.\n *\n * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`.\n */\n CLOUD_PLATFORM: 'cloud.platform',\n /**\n * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).\n */\n AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn',\n /**\n * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).\n */\n AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn',\n /**\n * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.\n */\n AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype',\n /**\n * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).\n */\n AWS_ECS_TASK_ARN: 'aws.ecs.task.arn',\n /**\n * The task definition family this task definition is a member of.\n */\n AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family',\n /**\n * The revision for this task definition.\n */\n AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision',\n /**\n * The ARN of an EKS cluster.\n */\n AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn',\n /**\n * The name(s) of the AWS log group(s) an application is writing to.\n *\n * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.\n */\n AWS_LOG_GROUP_NAMES: 'aws.log.group.names',\n /**\n * The Amazon Resource Name(s) (ARN) of the AWS log group(s).\n *\n * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).\n */\n AWS_LOG_GROUP_ARNS: 'aws.log.group.arns',\n /**\n * The name(s) of the AWS log stream(s) an application is writing to.\n */\n AWS_LOG_STREAM_NAMES: 'aws.log.stream.names',\n /**\n * The ARN(s) of the AWS log stream(s).\n *\n * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.\n */\n AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns',\n /**\n * Container name.\n */\n CONTAINER_NAME: 'container.name',\n /**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.\n */\n CONTAINER_ID: 'container.id',\n /**\n * The container runtime managing this container.\n */\n CONTAINER_RUNTIME: 'container.runtime',\n /**\n * Name of the image the container was built on.\n */\n CONTAINER_IMAGE_NAME: 'container.image.name',\n /**\n * Container image tag.\n */\n CONTAINER_IMAGE_TAG: 'container.image.tag',\n /**\n * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier).\n */\n DEPLOYMENT_ENVIRONMENT: 'deployment.environment',\n /**\n * A unique identifier representing the device.\n *\n * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.\n */\n DEVICE_ID: 'device.id',\n /**\n * The model identifier for the device.\n *\n * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.\n */\n DEVICE_MODEL_IDENTIFIER: 'device.model.identifier',\n /**\n * The marketing name for the device model.\n *\n * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.\n */\n DEVICE_MODEL_NAME: 'device.model.name',\n /**\n * The name of the function being executed.\n */\n FAAS_NAME: 'faas.name',\n /**\n * The unique ID of the function being executed.\n *\n * Note: For example, in AWS Lambda this field corresponds to the [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) value, in GCP to the URI of the resource, and in Azure to the [FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function) field.\n */\n FAAS_ID: 'faas.id',\n /**\n * The version string of the function being executed as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).\n */\n FAAS_VERSION: 'faas.version',\n /**\n * The execution environment ID as a string.\n */\n FAAS_INSTANCE: 'faas.instance',\n /**\n * The amount of memory available to the serverless function in MiB.\n *\n * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.\n */\n FAAS_MAX_MEMORY: 'faas.max_memory',\n /**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.\n */\n HOST_ID: 'host.id',\n /**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n */\n HOST_NAME: 'host.name',\n /**\n * Type of host. For Cloud, this must be the machine type.\n */\n HOST_TYPE: 'host.type',\n /**\n * The CPU architecture the host system is running on.\n */\n HOST_ARCH: 'host.arch',\n /**\n * Name of the VM image or OS install the host was instantiated from.\n */\n HOST_IMAGE_NAME: 'host.image.name',\n /**\n * VM image ID. For Cloud, this value is from the provider.\n */\n HOST_IMAGE_ID: 'host.image.id',\n /**\n * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes).\n */\n HOST_IMAGE_VERSION: 'host.image.version',\n /**\n * The name of the cluster.\n */\n K8S_CLUSTER_NAME: 'k8s.cluster.name',\n /**\n * The name of the Node.\n */\n K8S_NODE_NAME: 'k8s.node.name',\n /**\n * The UID of the Node.\n */\n K8S_NODE_UID: 'k8s.node.uid',\n /**\n * The name of the namespace that the pod is running in.\n */\n K8S_NAMESPACE_NAME: 'k8s.namespace.name',\n /**\n * The UID of the Pod.\n */\n K8S_POD_UID: 'k8s.pod.uid',\n /**\n * The name of the Pod.\n */\n K8S_POD_NAME: 'k8s.pod.name',\n /**\n * The name of the Container in a Pod template.\n */\n K8S_CONTAINER_NAME: 'k8s.container.name',\n /**\n * The UID of the ReplicaSet.\n */\n K8S_REPLICASET_UID: 'k8s.replicaset.uid',\n /**\n * The name of the ReplicaSet.\n */\n K8S_REPLICASET_NAME: 'k8s.replicaset.name',\n /**\n * The UID of the Deployment.\n */\n K8S_DEPLOYMENT_UID: 'k8s.deployment.uid',\n /**\n * The name of the Deployment.\n */\n K8S_DEPLOYMENT_NAME: 'k8s.deployment.name',\n /**\n * The UID of the StatefulSet.\n */\n K8S_STATEFULSET_UID: 'k8s.statefulset.uid',\n /**\n * The name of the StatefulSet.\n */\n K8S_STATEFULSET_NAME: 'k8s.statefulset.name',\n /**\n * The UID of the DaemonSet.\n */\n K8S_DAEMONSET_UID: 'k8s.daemonset.uid',\n /**\n * The name of the DaemonSet.\n */\n K8S_DAEMONSET_NAME: 'k8s.daemonset.name',\n /**\n * The UID of the Job.\n */\n K8S_JOB_UID: 'k8s.job.uid',\n /**\n * The name of the Job.\n */\n K8S_JOB_NAME: 'k8s.job.name',\n /**\n * The UID of the CronJob.\n */\n K8S_CRONJOB_UID: 'k8s.cronjob.uid',\n /**\n * The name of the CronJob.\n */\n K8S_CRONJOB_NAME: 'k8s.cronjob.name',\n /**\n * The operating system type.\n */\n OS_TYPE: 'os.type',\n /**\n * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands.\n */\n OS_DESCRIPTION: 'os.description',\n /**\n * Human readable operating system name.\n */\n OS_NAME: 'os.name',\n /**\n * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).\n */\n OS_VERSION: 'os.version',\n /**\n * Process identifier (PID).\n */\n PROCESS_PID: 'process.pid',\n /**\n * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_NAME: 'process.executable.name',\n /**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_PATH: 'process.executable.path',\n /**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n */\n PROCESS_COMMAND: 'process.command',\n /**\n * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead.\n */\n PROCESS_COMMAND_LINE: 'process.command_line',\n /**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n */\n PROCESS_COMMAND_ARGS: 'process.command_args',\n /**\n * The username of the user that owns the process.\n */\n PROCESS_OWNER: 'process.owner',\n /**\n * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.\n */\n PROCESS_RUNTIME_NAME: 'process.runtime.name',\n /**\n * The version of the runtime of this process, as returned by the runtime without modification.\n */\n PROCESS_RUNTIME_VERSION: 'process.runtime.version',\n /**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n */\n PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description',\n /**\n * Logical name of the service.\n *\n * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.\n */\n SERVICE_NAME: 'service.name',\n /**\n * A namespace for `service.name`.\n *\n * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\n SERVICE_NAMESPACE: 'service.namespace',\n /**\n * The string ID of the service instance.\n *\n * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).\n */\n SERVICE_INSTANCE_ID: 'service.instance.id',\n /**\n * The version string of the service API or implementation.\n */\n SERVICE_VERSION: 'service.version',\n /**\n * The name of the telemetry SDK as defined above.\n */\n TELEMETRY_SDK_NAME: 'telemetry.sdk.name',\n /**\n * The language of the telemetry SDK.\n */\n TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language',\n /**\n * The version string of the telemetry SDK.\n */\n TELEMETRY_SDK_VERSION: 'telemetry.sdk.version',\n /**\n * The version string of the auto instrumentation agent, if used.\n */\n TELEMETRY_AUTO_VERSION: 'telemetry.auto.version',\n /**\n * The name of the web engine.\n */\n WEBENGINE_NAME: 'webengine.name',\n /**\n * The version of the web engine.\n */\n WEBENGINE_VERSION: 'webengine.version',\n /**\n * Additional description of the web engine (e.g. detailed version and edition information).\n */\n WEBENGINE_DESCRIPTION: 'webengine.description',\n};\n// Enum definitions\nexport var CloudProviderValues;\n(function (CloudProviderValues) {\n /** Amazon Web Services. */\n CloudProviderValues[\"AWS\"] = \"aws\";\n /** Microsoft Azure. */\n CloudProviderValues[\"AZURE\"] = \"azure\";\n /** Google Cloud Platform. */\n CloudProviderValues[\"GCP\"] = \"gcp\";\n})(CloudProviderValues || (CloudProviderValues = {}));\nexport var CloudPlatformValues;\n(function (CloudPlatformValues) {\n /** AWS Elastic Compute Cloud. */\n CloudPlatformValues[\"AWS_EC2\"] = \"aws_ec2\";\n /** AWS Elastic Container Service. */\n CloudPlatformValues[\"AWS_ECS\"] = \"aws_ecs\";\n /** AWS Elastic Kubernetes Service. */\n CloudPlatformValues[\"AWS_EKS\"] = \"aws_eks\";\n /** AWS Lambda. */\n CloudPlatformValues[\"AWS_LAMBDA\"] = \"aws_lambda\";\n /** AWS Elastic Beanstalk. */\n CloudPlatformValues[\"AWS_ELASTIC_BEANSTALK\"] = \"aws_elastic_beanstalk\";\n /** Azure Virtual Machines. */\n CloudPlatformValues[\"AZURE_VM\"] = \"azure_vm\";\n /** Azure Container Instances. */\n CloudPlatformValues[\"AZURE_CONTAINER_INSTANCES\"] = \"azure_container_instances\";\n /** Azure Kubernetes Service. */\n CloudPlatformValues[\"AZURE_AKS\"] = \"azure_aks\";\n /** Azure Functions. */\n CloudPlatformValues[\"AZURE_FUNCTIONS\"] = \"azure_functions\";\n /** Azure App Service. */\n CloudPlatformValues[\"AZURE_APP_SERVICE\"] = \"azure_app_service\";\n /** Google Cloud Compute Engine (GCE). */\n CloudPlatformValues[\"GCP_COMPUTE_ENGINE\"] = \"gcp_compute_engine\";\n /** Google Cloud Run. */\n CloudPlatformValues[\"GCP_CLOUD_RUN\"] = \"gcp_cloud_run\";\n /** Google Cloud Kubernetes Engine (GKE). */\n CloudPlatformValues[\"GCP_KUBERNETES_ENGINE\"] = \"gcp_kubernetes_engine\";\n /** Google Cloud Functions (GCF). */\n CloudPlatformValues[\"GCP_CLOUD_FUNCTIONS\"] = \"gcp_cloud_functions\";\n /** Google Cloud App Engine (GAE). */\n CloudPlatformValues[\"GCP_APP_ENGINE\"] = \"gcp_app_engine\";\n})(CloudPlatformValues || (CloudPlatformValues = {}));\nexport var AwsEcsLaunchtypeValues;\n(function (AwsEcsLaunchtypeValues) {\n /** ec2. */\n AwsEcsLaunchtypeValues[\"EC2\"] = \"ec2\";\n /** fargate. */\n AwsEcsLaunchtypeValues[\"FARGATE\"] = \"fargate\";\n})(AwsEcsLaunchtypeValues || (AwsEcsLaunchtypeValues = {}));\nexport var HostArchValues;\n(function (HostArchValues) {\n /** AMD64. */\n HostArchValues[\"AMD64\"] = \"amd64\";\n /** ARM32. */\n HostArchValues[\"ARM32\"] = \"arm32\";\n /** ARM64. */\n HostArchValues[\"ARM64\"] = \"arm64\";\n /** Itanium. */\n HostArchValues[\"IA64\"] = \"ia64\";\n /** 32-bit PowerPC. */\n HostArchValues[\"PPC32\"] = \"ppc32\";\n /** 64-bit PowerPC. */\n HostArchValues[\"PPC64\"] = \"ppc64\";\n /** 32-bit x86. */\n HostArchValues[\"X86\"] = \"x86\";\n})(HostArchValues || (HostArchValues = {}));\nexport var OsTypeValues;\n(function (OsTypeValues) {\n /** Microsoft Windows. */\n OsTypeValues[\"WINDOWS\"] = \"windows\";\n /** Linux. */\n OsTypeValues[\"LINUX\"] = \"linux\";\n /** Apple Darwin. */\n OsTypeValues[\"DARWIN\"] = \"darwin\";\n /** FreeBSD. */\n OsTypeValues[\"FREEBSD\"] = \"freebsd\";\n /** NetBSD. */\n OsTypeValues[\"NETBSD\"] = \"netbsd\";\n /** OpenBSD. */\n OsTypeValues[\"OPENBSD\"] = \"openbsd\";\n /** DragonFly BSD. */\n OsTypeValues[\"DRAGONFLYBSD\"] = \"dragonflybsd\";\n /** HP-UX (Hewlett Packard Unix). */\n OsTypeValues[\"HPUX\"] = \"hpux\";\n /** AIX (Advanced Interactive eXecutive). */\n OsTypeValues[\"AIX\"] = \"aix\";\n /** Oracle Solaris. */\n OsTypeValues[\"SOLARIS\"] = \"solaris\";\n /** IBM z/OS. */\n OsTypeValues[\"Z_OS\"] = \"z_os\";\n})(OsTypeValues || (OsTypeValues = {}));\nexport var TelemetrySdkLanguageValues;\n(function (TelemetrySdkLanguageValues) {\n /** cpp. */\n TelemetrySdkLanguageValues[\"CPP\"] = \"cpp\";\n /** dotnet. */\n TelemetrySdkLanguageValues[\"DOTNET\"] = \"dotnet\";\n /** erlang. */\n TelemetrySdkLanguageValues[\"ERLANG\"] = \"erlang\";\n /** go. */\n TelemetrySdkLanguageValues[\"GO\"] = \"go\";\n /** java. */\n TelemetrySdkLanguageValues[\"JAVA\"] = \"java\";\n /** nodejs. */\n TelemetrySdkLanguageValues[\"NODEJS\"] = \"nodejs\";\n /** php. */\n TelemetrySdkLanguageValues[\"PHP\"] = \"php\";\n /** python. */\n TelemetrySdkLanguageValues[\"PYTHON\"] = \"python\";\n /** ruby. */\n TelemetrySdkLanguageValues[\"RUBY\"] = \"ruby\";\n /** webjs. */\n TelemetrySdkLanguageValues[\"WEBJS\"] = \"webjs\";\n})(TelemetrySdkLanguageValues || (TelemetrySdkLanguageValues = {}));\n//# sourceMappingURL=ResourceAttributes.js.map","/*\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 */\nvar _a;\nimport { VERSION } from '../../version';\nimport { TelemetrySdkLanguageValues, ResourceAttributes, } from '@opentelemetry/semantic-conventions';\n/** Constants describing the SDK in use */\nexport var SDK_INFO = (_a = {},\n _a[ResourceAttributes.TELEMETRY_SDK_NAME] = 'opentelemetry',\n _a[ResourceAttributes.PROCESS_RUNTIME_NAME] = 'browser',\n _a[ResourceAttributes.TELEMETRY_SDK_LANGUAGE] = TelemetrySdkLanguageValues.WEBJS,\n _a[ResourceAttributes.TELEMETRY_SDK_VERSION] = VERSION,\n _a);\n//# sourceMappingURL=sdk-info.js.map","/*\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 */\n// this is autogenerated file, see scripts/version-update.js\nexport var VERSION = '0.23.0';\n//# sourceMappingURL=version.js.map","/*\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 */\nimport { otperformance as performance } from '../platform';\nvar NANOSECOND_DIGITS = 9;\nvar SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number to HrTime\n * @param epochMillis\n */\nfunction numberToHrtime(epochMillis) {\n var epochSeconds = epochMillis / 1000;\n // Decimals only.\n var seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n var nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) *\n SECOND_TO_NANOSECONDS;\n return [seconds, nanos];\n}\nfunction getTimeOrigin() {\n var timeOrigin = performance.timeOrigin;\n if (typeof timeOrigin !== 'number') {\n var perf = performance;\n timeOrigin = perf.timing && perf.timing.fetchStart;\n }\n return timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nexport function hrTime(performanceNow) {\n var timeOrigin = numberToHrtime(getTimeOrigin());\n var now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : performance.now());\n var seconds = timeOrigin[0] + now[0];\n var nanos = timeOrigin[1] + now[1];\n // Nanoseconds\n if (nanos > SECOND_TO_NANOSECONDS) {\n nanos -= SECOND_TO_NANOSECONDS;\n seconds += 1;\n }\n return [seconds, nanos];\n}\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nexport function timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < getTimeOrigin()) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return numberToHrtime(time);\n }\n }\n else if (time instanceof Date) {\n return numberToHrtime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nexport function hrTimeDuration(startTime, endTime) {\n var seconds = endTime[0] - startTime[0];\n var nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param hrTime\n */\nexport function hrTimeToTimeStamp(hrTime) {\n var precision = NANOSECOND_DIGITS;\n var tmp = \"\" + '0'.repeat(precision) + hrTime[1] + \"Z\";\n var nanoString = tmp.substr(tmp.length - precision - 1);\n var date = new Date(hrTime[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\n/**\n * Convert hrTime to nanoseconds.\n * @param hrTime\n */\nexport function hrTimeToNanoseconds(hrTime) {\n return hrTime[0] * SECOND_TO_NANOSECONDS + hrTime[1];\n}\n/**\n * Convert hrTime to milliseconds.\n * @param hrTime\n */\nexport function hrTimeToMilliseconds(hrTime) {\n return Math.round(hrTime[0] * 1e3 + hrTime[1] / 1e6);\n}\n/**\n * Convert hrTime to microseconds.\n * @param hrTime\n */\nexport function hrTimeToMicroseconds(hrTime) {\n return Math.round(hrTime[0] * 1e6 + hrTime[1] / 1e3);\n}\n/**\n * check if time is HrTime\n * @param value\n */\nexport function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nexport function isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\n//# sourceMappingURL=time.js.map","/*\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 var ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode || (ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","/*\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 */\nimport { diag, } from '@opentelemetry/api';\n/** Combines multiple propagators into a single propagator. */\nvar CompositePropagator = /** @class */ (function () {\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n function CompositePropagator(config) {\n if (config === void 0) { config = {}; }\n var _a;\n this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : [];\n this._fields = Array.from(new Set(this._propagators\n // older propagators may not have fields function, null check to be sure\n .map(function (p) { return (typeof p.fields === 'function' ? p.fields() : []); })\n .reduce(function (x, y) { return x.concat(y); }, [])));\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n CompositePropagator.prototype.inject = function (context, carrier, setter) {\n for (var _i = 0, _a = this._propagators; _i < _a.length; _i++) {\n var propagator = _a[_i];\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n diag.warn(\"Failed to inject with \" + propagator.constructor.name + \". Err: \" + err.message);\n }\n }\n };\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n CompositePropagator.prototype.extract = function (context, carrier, getter) {\n return this._propagators.reduce(function (ctx, propagator) {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n diag.warn(\"Failed to inject with \" + propagator.constructor.name + \". Err: \" + err.message);\n }\n return ctx;\n }, context);\n };\n CompositePropagator.prototype.fields = function () {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n };\n return CompositePropagator;\n}());\nexport { CompositePropagator };\n//# sourceMappingURL=composite.js.map","/*\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 */\nvar VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nvar VALID_KEY = \"[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,255}\";\nvar VALID_VENDOR_KEY = \"[a-z0-9]\" + VALID_KEY_CHAR_RANGE + \"{0,240}@[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,13}\";\nvar VALID_KEY_REGEX = new RegExp(\"^(?:\" + VALID_KEY + \"|\" + VALID_VENDOR_KEY + \")$\");\nvar VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nvar INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nexport function validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nexport function validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\n//# sourceMappingURL=validators.js.map","/*\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 */\nimport { validateKey, validateValue } from '../internal/validators';\nvar MAX_TRACE_STATE_ITEMS = 32;\nvar MAX_TRACE_STATE_LEN = 512;\nvar LIST_MEMBERS_SEPARATOR = ',';\nvar LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nvar TraceState = /** @class */ (function () {\n function TraceState(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n TraceState.prototype.set = function (key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n var traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n };\n TraceState.prototype.unset = function (key) {\n var traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n };\n TraceState.prototype.get = function (key) {\n return this._internalState.get(key);\n };\n TraceState.prototype.serialize = function () {\n var _this = this;\n return this._keys()\n .reduce(function (agg, key) {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n };\n TraceState.prototype._parse = function (rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce(function (agg, part) {\n var listMember = part.trim(); // Optional Whitespace (OWS) handling\n var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n var key = listMember.slice(0, i);\n var value = listMember.slice(i + 1, part.length);\n if (validateKey(key) && validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n };\n TraceState.prototype._keys = function () {\n return Array.from(this._internalState.keys()).reverse();\n };\n TraceState.prototype._clone = function () {\n var traceState = new TraceState();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n };\n return TraceState;\n}());\nexport { TraceState };\n//# sourceMappingURL=TraceState.js.map","/*\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 */\nimport { isSpanContextValid, trace, TraceFlags, } from '@opentelemetry/api';\nimport { isTracingSuppressed } from './suppress-tracing';\nimport { TraceState } from './TraceState';\nexport var TRACE_PARENT_HEADER = 'traceparent';\nexport var TRACE_STATE_HEADER = 'tracestate';\nvar VERSION = '00';\nvar VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nvar TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nvar PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nvar FLAGS_PART = '[\\\\da-f]{2}';\nvar TRACE_PARENT_REGEX = new RegExp(\"^\\\\s?(\" + VERSION_PART + \")-(\" + TRACE_ID_PART + \")-(\" + PARENT_ID_PART + \")-(\" + FLAGS_PART + \")(-.*)?\\\\s?$\");\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nexport function parseTraceParent(traceParent) {\n var match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nvar HttpTraceContextPropagator = /** @class */ (function () {\n function HttpTraceContextPropagator() {\n }\n HttpTraceContextPropagator.prototype.inject = function (context, carrier, setter) {\n var spanContext = trace.getSpanContext(context);\n if (!spanContext ||\n isTracingSuppressed(context) ||\n !isSpanContextValid(spanContext))\n return;\n var traceParent = VERSION + \"-\" + spanContext.traceId + \"-\" + spanContext.spanId + \"-0\" + Number(spanContext.traceFlags || TraceFlags.NONE).toString(16);\n setter.set(carrier, TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n };\n HttpTraceContextPropagator.prototype.extract = function (context, carrier, getter) {\n var traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n var traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n var spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n var traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n var state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState(typeof state === 'string' ? state : undefined);\n }\n return trace.setSpanContext(context, spanContext);\n };\n HttpTraceContextPropagator.prototype.fields = function () {\n return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER];\n };\n return HttpTraceContextPropagator;\n}());\nexport { HttpTraceContextPropagator };\n//# sourceMappingURL=HttpTraceContextPropagator.js.map","/*\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 */\nimport { createContextKey } from '@opentelemetry/api';\nvar RPC_METADATA_KEY = createContextKey('OpenTelemetry SDK Context Key RPC_METADATA');\nexport var RPCType;\n(function (RPCType) {\n RPCType[\"HTTP\"] = \"http\";\n})(RPCType || (RPCType = {}));\nexport function setRPCMetadata(context, meta) {\n return context.setValue(RPC_METADATA_KEY, meta);\n}\nexport function deleteRPCMetadata(context) {\n return context.deleteValue(RPC_METADATA_KEY);\n}\nexport function getRPCMetadata(context) {\n return context.getValue(RPC_METADATA_KEY);\n}\n//# sourceMappingURL=rpc-metadata.js.map","/*\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 */\nimport { SamplingDecision } from '@opentelemetry/api';\n/** Sampler that samples no traces. */\nvar AlwaysOffSampler = /** @class */ (function () {\n function AlwaysOffSampler() {\n }\n AlwaysOffSampler.prototype.shouldSample = function () {\n return {\n decision: SamplingDecision.NOT_RECORD,\n };\n };\n AlwaysOffSampler.prototype.toString = function () {\n return 'AlwaysOffSampler';\n };\n return AlwaysOffSampler;\n}());\nexport { AlwaysOffSampler };\n//# sourceMappingURL=AlwaysOffSampler.js.map","/*\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 */\nimport { SamplingDecision } from '@opentelemetry/api';\n/** Sampler that samples all traces. */\nvar AlwaysOnSampler = /** @class */ (function () {\n function AlwaysOnSampler() {\n }\n AlwaysOnSampler.prototype.shouldSample = function () {\n return {\n decision: SamplingDecision.RECORD_AND_SAMPLED,\n };\n };\n AlwaysOnSampler.prototype.toString = function () {\n return 'AlwaysOnSampler';\n };\n return AlwaysOnSampler;\n}());\nexport { AlwaysOnSampler };\n//# sourceMappingURL=AlwaysOnSampler.js.map","/*\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 */\nimport { diag } from '@opentelemetry/api';\nimport { ExportResultCode } from '@opentelemetry/core';\n/**\n * Collector Exporter abstract base class\n */\nvar CollectorExporterBase = /** @class */ (function () {\n /**\n * @param config\n */\n function CollectorExporterBase(config) {\n if (config === void 0) { config = {}; }\n this._isShutdown = false;\n this._shuttingDownPromise = Promise.resolve();\n this._sendingPromises = [];\n this.url = this.getDefaultUrl(config);\n if (typeof config.hostname === 'string') {\n this.hostname = config.hostname;\n }\n this.attributes = config.attributes;\n this.shutdown = this.shutdown.bind(this);\n this._concurrencyLimit =\n typeof config.concurrencyLimit === 'number'\n ? config.concurrencyLimit\n : Infinity;\n // platform dependent\n this.onInit(config);\n }\n /**\n * Export items.\n * @param items\n * @param resultCallback\n */\n CollectorExporterBase.prototype.export = function (items, resultCallback) {\n if (this._isShutdown) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Exporter has been shutdown'),\n });\n return;\n }\n if (this._sendingPromises.length >= this._concurrencyLimit) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n this._export(items)\n .then(function () {\n resultCallback({ code: ExportResultCode.SUCCESS });\n })\n .catch(function (error) {\n resultCallback({ code: ExportResultCode.FAILED, error: error });\n });\n };\n CollectorExporterBase.prototype._export = function (items) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n diag.debug('items to be sent', items);\n _this.send(items, resolve, reject);\n }\n catch (e) {\n reject(e);\n }\n });\n };\n /**\n * Shutdown the exporter.\n */\n CollectorExporterBase.prototype.shutdown = function () {\n var _this = this;\n if (this._isShutdown) {\n diag.debug('shutdown already started');\n return this._shuttingDownPromise;\n }\n this._isShutdown = true;\n diag.debug('shutdown started');\n this._shuttingDownPromise = new Promise(function (resolve, reject) {\n Promise.resolve()\n .then(function () {\n return _this.onShutdown();\n })\n .then(function () {\n return Promise.all(_this._sendingPromises);\n })\n .then(function () {\n resolve();\n })\n .catch(function (e) {\n reject(e);\n });\n });\n return this._shuttingDownPromise;\n };\n return CollectorExporterBase;\n}());\nexport { CollectorExporterBase };\n//# sourceMappingURL=CollectorExporterBase.js.map","/*\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 */\nimport { isSpanContextValid, TraceFlags, trace, } from '@opentelemetry/api';\nimport { globalErrorHandler } from '../../common/global-error-handler';\nimport { AlwaysOffSampler } from './AlwaysOffSampler';\nimport { AlwaysOnSampler } from './AlwaysOnSampler';\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nvar ParentBasedSampler = /** @class */ (function () {\n function ParentBasedSampler(config) {\n var _a, _b, _c, _d;\n this._root = config.root;\n if (!this._root) {\n globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler();\n }\n this._remoteParentSampled =\n (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler();\n this._remoteParentNotSampled =\n (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler();\n this._localParentSampled =\n (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler();\n this._localParentNotSampled =\n (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler();\n }\n ParentBasedSampler.prototype.shouldSample = function (context, traceId, spanName, spanKind, attributes, links) {\n var parentContext = trace.getSpanContext(context);\n if (!parentContext || !isSpanContextValid(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n };\n ParentBasedSampler.prototype.toString = function () {\n return \"ParentBased{root=\" + this._root.toString() + \", remoteParentSampled=\" + this._remoteParentSampled.toString() + \", remoteParentNotSampled=\" + this._remoteParentNotSampled.toString() + \", localParentSampled=\" + this._localParentSampled.toString() + \", localParentNotSampled=\" + this._localParentNotSampled.toString() + \"}\";\n };\n return ParentBasedSampler;\n}());\nexport { ParentBasedSampler };\n//# sourceMappingURL=ParentBasedSampler.js.map","/*\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 */\nimport { SamplingDecision, isValidTraceId, } from '@opentelemetry/api';\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nvar TraceIdRatioBasedSampler = /** @class */ (function () {\n function TraceIdRatioBasedSampler(_ratio) {\n if (_ratio === void 0) { _ratio = 0; }\n this._ratio = _ratio;\n this._ratio = this._normalize(_ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n TraceIdRatioBasedSampler.prototype.shouldSample = function (context, traceId) {\n return {\n decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? SamplingDecision.RECORD_AND_SAMPLED\n : SamplingDecision.NOT_RECORD,\n };\n };\n TraceIdRatioBasedSampler.prototype.toString = function () {\n return \"TraceIdRatioBased{\" + this._ratio + \"}\";\n };\n TraceIdRatioBasedSampler.prototype._normalize = function (ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n };\n TraceIdRatioBasedSampler.prototype._accumulate = function (traceId) {\n var accumulation = 0;\n for (var i = 0; i < traceId.length / 8; i++) {\n var pos = i * 8;\n var part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n };\n return TraceIdRatioBasedSampler;\n}());\nexport { TraceIdRatioBasedSampler };\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar _a;\nimport { SpanKind } from '@opentelemetry/api';\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport var opentelemetryProto;\n(function (opentelemetryProto) {\n var metrics;\n (function (metrics) {\n var v1;\n (function (v1) {\n var AggregationTemporality;\n (function (AggregationTemporality) {\n // UNSPECIFIED is the default AggregationTemporality, it MUST not be used.\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_UNSPECIFIED\"] = 0] = \"AGGREGATION_TEMPORALITY_UNSPECIFIED\";\n // DELTA is an AggregationTemporality for a metric aggregator which reports\n // changes since last report time. Successive metrics contain aggregation of\n // values from continuous and non-overlapping intervals.\n //\n // The values for a DELTA metric are based only on the time interval\n // associated with one measurement cycle. There is no dependency on\n // previous measurements like is the case for CUMULATIVE metrics.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // DELTA metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0+1 to\n // t_0+2 with a value of 2.\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_DELTA\"] = 1] = \"AGGREGATION_TEMPORALITY_DELTA\";\n // CUMULATIVE is an AggregationTemporality for a metric aggregator which\n // reports changes since a fixed start time. This means that current values\n // of a CUMULATIVE metric depend on all previous measurements since the\n // start time. Because of this, the sender is required to retain this state\n // in some form. If this state is lost or invalidated, the CUMULATIVE metric\n // values MUST be reset and a new fixed start time following the last\n // reported measurement time sent MUST be used.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // CUMULATIVE metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+2 with a value of 5.\n // 9. The system experiences a fault and loses state.\n // 10. The system recovers and resumes receiving at time=t_1.\n // 11. A request is received, the system measures 1 request.\n // 12. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_1 to\n // t_0+1 with a value of 1.\n //\n // Note: Even though, when reporting changes since last report time, using\n // CUMULATIVE is valid, it is not recommended. This may cause problems for\n // systems that do not use start_time to determine when the aggregation\n // value was reset (e.g. Prometheus).\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_CUMULATIVE\"] = 2] = \"AGGREGATION_TEMPORALITY_CUMULATIVE\";\n })(AggregationTemporality = v1.AggregationTemporality || (v1.AggregationTemporality = {}));\n })(v1 = metrics.v1 || (metrics.v1 = {}));\n })(metrics = opentelemetryProto.metrics || (opentelemetryProto.metrics = {}));\n var trace;\n (function (trace) {\n var v1;\n (function (v1) {\n var ConstantSampler;\n (function (ConstantSampler) {\n var ConstantDecision;\n (function (ConstantDecision) {\n ConstantDecision[ConstantDecision[\"ALWAYS_OFF\"] = 0] = \"ALWAYS_OFF\";\n ConstantDecision[ConstantDecision[\"ALWAYS_ON\"] = 1] = \"ALWAYS_ON\";\n ConstantDecision[ConstantDecision[\"ALWAYS_PARENT\"] = 2] = \"ALWAYS_PARENT\";\n })(ConstantDecision = ConstantSampler.ConstantDecision || (ConstantSampler.ConstantDecision = {}));\n })(ConstantSampler = v1.ConstantSampler || (v1.ConstantSampler = {}));\n var Span;\n (function (Span) {\n var SpanKind;\n (function (SpanKind) {\n SpanKind[SpanKind[\"SPAN_KIND_UNSPECIFIED\"] = 0] = \"SPAN_KIND_UNSPECIFIED\";\n SpanKind[SpanKind[\"SPAN_KIND_INTERNAL\"] = 1] = \"SPAN_KIND_INTERNAL\";\n SpanKind[SpanKind[\"SPAN_KIND_SERVER\"] = 2] = \"SPAN_KIND_SERVER\";\n SpanKind[SpanKind[\"SPAN_KIND_CLIENT\"] = 3] = \"SPAN_KIND_CLIENT\";\n SpanKind[SpanKind[\"SPAN_KIND_PRODUCER\"] = 4] = \"SPAN_KIND_PRODUCER\";\n SpanKind[SpanKind[\"SPAN_KIND_CONSUMER\"] = 5] = \"SPAN_KIND_CONSUMER\";\n })(SpanKind = Span.SpanKind || (Span.SpanKind = {}));\n })(Span = v1.Span || (v1.Span = {}));\n })(v1 = trace.v1 || (trace.v1 = {}));\n })(trace = opentelemetryProto.trace || (opentelemetryProto.trace = {}));\n var common;\n (function (common) {\n var v1;\n (function (v1) {\n var ValueType;\n (function (ValueType) {\n ValueType[ValueType[\"STRING\"] = 0] = \"STRING\";\n ValueType[ValueType[\"INT\"] = 1] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 2] = \"DOUBLE\";\n ValueType[ValueType[\"BOOL\"] = 3] = \"BOOL\";\n })(ValueType = v1.ValueType || (v1.ValueType = {}));\n })(v1 = common.v1 || (common.v1 = {}));\n })(common = opentelemetryProto.common || (opentelemetryProto.common = {}));\n})(opentelemetryProto || (opentelemetryProto = {}));\n/**\n * Interface for handling error\n */\nvar CollectorExporterError = /** @class */ (function (_super) {\n __extends(CollectorExporterError, _super);\n function CollectorExporterError(message, code, data) {\n var _this = _super.call(this, message) || this;\n _this.name = 'CollectorExporterError';\n _this.data = data;\n _this.code = code;\n return _this;\n }\n return CollectorExporterError;\n}(Error));\nexport { CollectorExporterError };\n/**\n * Mapping between api SpanKind and proto SpanKind\n */\nexport var COLLECTOR_SPAN_KIND_MAPPING = (_a = {},\n _a[SpanKind.INTERNAL] = opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL,\n _a[SpanKind.SERVER] = opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER,\n _a[SpanKind.CLIENT] = opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT,\n _a[SpanKind.PRODUCER] = opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER,\n _a[SpanKind.CONSUMER] = opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER,\n _a);\n//# sourceMappingURL=types.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { CollectorExporterBase } from '../../CollectorExporterBase';\nimport { parseHeaders } from '../../util';\nimport { sendWithBeacon, sendWithXhr } from './util';\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\n/**\n * Collector Metric Exporter abstract base class\n */\nvar CollectorExporterBrowserBase = /** @class */ (function (_super) {\n __extends(CollectorExporterBrowserBase, _super);\n /**\n * @param config\n */\n function CollectorExporterBrowserBase(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this, config) || this;\n _this._useXHR = false;\n _this._useXHR =\n !!config.headers || typeof navigator.sendBeacon !== 'function';\n if (_this._useXHR) {\n _this._headers = Object.assign({}, parseHeaders(config.headers), baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_HEADERS));\n }\n else {\n _this._headers = {};\n }\n return _this;\n }\n CollectorExporterBrowserBase.prototype.onInit = function () {\n window.addEventListener('unload', this.shutdown);\n };\n CollectorExporterBrowserBase.prototype.onShutdown = function () {\n window.removeEventListener('unload', this.shutdown);\n };\n CollectorExporterBrowserBase.prototype.send = function (items, onSuccess, onError) {\n var _this = this;\n if (this._isShutdown) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n var serviceRequest = this.convert(items);\n var body = JSON.stringify(serviceRequest);\n var promise = new Promise(function (resolve) {\n var _onSuccess = function () {\n onSuccess();\n _onFinish();\n };\n var _onError = function (error) {\n onError(error);\n _onFinish();\n };\n var _onFinish = function () {\n resolve();\n var index = _this._sendingPromises.indexOf(promise);\n _this._sendingPromises.splice(index, 1);\n };\n if (_this._useXHR) {\n sendWithXhr(body, _this.url, _this._headers, _onSuccess, _onError);\n }\n else {\n sendWithBeacon(body, _this.url, _onSuccess, _onError);\n }\n });\n this._sendingPromises.push(promise);\n };\n return CollectorExporterBrowserBase;\n}(CollectorExporterBase));\nexport { CollectorExporterBrowserBase };\n//# sourceMappingURL=CollectorExporterBrowserBase.js.map","/*\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 */\nimport { diag } from '@opentelemetry/api';\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function parseHeaders(partialHeaders) {\n if (partialHeaders === void 0) { partialHeaders = {}; }\n var headers = {};\n Object.entries(partialHeaders).forEach(function (_a) {\n var key = _a[0], value = _a[1];\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n }\n else {\n diag.warn(\"Header \\\"\" + key + \"\\\" has wrong value and will be ignored\");\n }\n });\n return headers;\n}\n//# sourceMappingURL=util.js.map","/*\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 */\nimport { diag } from '@opentelemetry/api';\nimport * as collectorTypes from '../../types';\n/**\n * Send metrics/spans using browser navigator.sendBeacon\n * @param body\n * @param onSuccess\n * @param onError\n */\nexport function sendWithBeacon(body, url, onSuccess, onError) {\n if (navigator.sendBeacon(url, body)) {\n diag.debug('sendBeacon - can send', body);\n onSuccess();\n }\n else {\n var error = new collectorTypes.CollectorExporterError(\"sendBeacon - cannot send \" + body);\n onError(error);\n }\n}\n/**\n * function to send metrics/spans using browser XMLHttpRequest\n * used when navigator.sendBeacon is not available\n * @param body\n * @param onSuccess\n * @param onError\n */\nexport function sendWithXhr(body, url, headers, onSuccess, onError) {\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url);\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.setRequestHeader('Content-Type', 'application/json');\n Object.entries(headers).forEach(function (_a) {\n var k = _a[0], v = _a[1];\n xhr.setRequestHeader(k, v);\n });\n xhr.send(body);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status >= 200 && xhr.status <= 299) {\n diag.debug('xhr success', body);\n onSuccess();\n }\n else {\n var error = new collectorTypes.CollectorExporterError(\"Failed to export with XHR (status: \" + xhr.status + \")\", xhr.status);\n onError(error);\n }\n }\n };\n}\n//# sourceMappingURL=util.js.map","/*\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 */\nimport * as core from '@opentelemetry/core';\nimport { COLLECTOR_SPAN_KIND_MAPPING, opentelemetryProto, } from './types';\nvar MAX_INTEGER_VALUE = 2147483647;\nvar MIN_INTEGER_VALUE = -2147483648;\n/**\n * Converts attributes to KeyValue array\n * @param attributes\n */\nexport function toCollectorAttributes(attributes) {\n return Object.keys(attributes).map(function (key) {\n return toCollectorAttributeKeyValue(key, attributes[key]);\n });\n}\n/**\n * Converts array of unknown value to ArrayValue\n * @param values\n */\nexport function toCollectorArrayValue(values) {\n return {\n values: values.map(function (value) { return toCollectorAnyValue(value); }),\n };\n}\n/**\n * Converts attributes to KeyValueList\n * @param attributes\n */\nexport function toCollectorKeyValueList(attributes) {\n return {\n values: toCollectorAttributes(attributes),\n };\n}\n/**\n * Converts key and unknown value to KeyValue\n * @param value event value\n */\nexport function toCollectorAttributeKeyValue(key, value) {\n var anyValue = toCollectorAnyValue(value);\n return {\n key: key,\n value: anyValue,\n };\n}\n/**\n * Converts unknown value to AnyValue\n * @param value\n */\nexport function toCollectorAnyValue(value) {\n var anyValue = {};\n if (typeof value === 'string') {\n anyValue.stringValue = value;\n }\n else if (typeof value === 'boolean') {\n anyValue.boolValue = value;\n }\n else if (typeof value === 'number' &&\n value <= MAX_INTEGER_VALUE &&\n value >= MIN_INTEGER_VALUE &&\n Number.isInteger(value)) {\n anyValue.intValue = value;\n }\n else if (typeof value === 'number') {\n anyValue.doubleValue = value;\n }\n else if (Array.isArray(value)) {\n anyValue.arrayValue = toCollectorArrayValue(value);\n }\n else if (value) {\n anyValue.kvlistValue = toCollectorKeyValueList(value);\n }\n return anyValue;\n}\n/**\n *\n * Converts events\n * @param events array of events\n */\nexport function toCollectorEvents(timedEvents) {\n return timedEvents.map(function (timedEvent) {\n var timeUnixNano = core.hrTimeToNanoseconds(timedEvent.time);\n var name = timedEvent.name;\n var attributes = toCollectorAttributes(timedEvent.attributes || {});\n var droppedAttributesCount = 0;\n var protoEvent = {\n timeUnixNano: timeUnixNano,\n name: name,\n attributes: attributes,\n droppedAttributesCount: droppedAttributesCount,\n };\n return protoEvent;\n });\n}\n/**\n * Converts links\n * @param span\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorLinks(span, useHex) {\n return span.links.map(function (link) {\n var protoLink = {\n traceId: useHex\n ? link.context.traceId\n : core.hexToBase64(link.context.traceId),\n spanId: useHex\n ? link.context.spanId\n : core.hexToBase64(link.context.spanId),\n attributes: toCollectorAttributes(link.attributes || {}),\n droppedAttributesCount: 0,\n };\n return protoLink;\n });\n}\n/**\n * Converts span\n * @param span\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nexport function toCollectorSpan(span, useHex) {\n return {\n traceId: useHex\n ? span.spanContext().traceId\n : core.hexToBase64(span.spanContext().traceId),\n spanId: useHex\n ? span.spanContext().spanId\n : core.hexToBase64(span.spanContext().spanId),\n parentSpanId: span.parentSpanId\n ? useHex\n ? span.parentSpanId\n : core.hexToBase64(span.parentSpanId)\n : undefined,\n traceState: toCollectorTraceState(span.spanContext().traceState),\n name: span.name,\n kind: toCollectorKind(span.kind),\n startTimeUnixNano: core.hrTimeToNanoseconds(span.startTime),\n endTimeUnixNano: core.hrTimeToNanoseconds(span.endTime),\n attributes: toCollectorAttributes(span.attributes),\n droppedAttributesCount: 0,\n events: toCollectorEvents(span.events),\n droppedEventsCount: 0,\n status: toCollectorStatus(span.status),\n links: toCollectorLinks(span, useHex),\n droppedLinksCount: 0,\n };\n}\n/**\n * Converts status\n * @param status\n */\nexport function toCollectorStatus(status) {\n var spanStatus = {\n code: status.code,\n };\n if (typeof status.message !== 'undefined') {\n spanStatus.message = status.message;\n }\n return spanStatus;\n}\n/**\n * Converts resource\n * @param resource\n * @param additionalAttributes\n */\nexport function toCollectorResource(resource, additionalAttributes) {\n if (additionalAttributes === void 0) { additionalAttributes = {}; }\n var attr = Object.assign({}, additionalAttributes, resource ? resource.attributes : {});\n var resourceProto = {\n attributes: toCollectorAttributes(attr),\n droppedAttributesCount: 0,\n };\n return resourceProto;\n}\n/**\n * Converts span kind\n * @param kind\n */\nexport function toCollectorKind(kind) {\n var collectorKind = COLLECTOR_SPAN_KIND_MAPPING[kind];\n return typeof collectorKind === 'number'\n ? collectorKind\n : opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_UNSPECIFIED;\n}\n/**\n * Converts traceState\n * @param traceState\n */\nexport function toCollectorTraceState(traceState) {\n if (!traceState)\n return undefined;\n return traceState.serialize();\n}\n/**\n * Prepares trace service request to be sent to collector\n * @param spans spans\n * @param collectorExporterBase\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nexport function toCollectorExportTraceServiceRequest(spans, collectorTraceExporterBase, useHex) {\n var groupedSpans = groupSpansByResourceAndLibrary(spans);\n var additionalAttributes = Object.assign({}, collectorTraceExporterBase.attributes);\n return {\n resourceSpans: toCollectorResourceSpans(groupedSpans, additionalAttributes, useHex),\n };\n}\n/**\n * Takes an array of spans and groups them by resource and instrumentation\n * library\n * @param spans spans\n */\nexport function groupSpansByResourceAndLibrary(spans) {\n return spans.reduce(function (spanMap, span) {\n //group by resource\n var resourceSpans = spanMap.get(span.resource);\n if (!resourceSpans) {\n resourceSpans = new Map();\n spanMap.set(span.resource, resourceSpans);\n }\n //group by instrumentation library\n var libSpans = resourceSpans.get(span.instrumentationLibrary);\n if (!libSpans) {\n libSpans = new Array();\n resourceSpans.set(span.instrumentationLibrary, libSpans);\n }\n libSpans.push(span);\n return spanMap;\n }, new Map());\n}\n/**\n * Convert to InstrumentationLibrarySpans\n * @param instrumentationLibrary\n * @param spans\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex) {\n return {\n spans: spans.map(function (span) { return toCollectorSpan(span, useHex); }),\n instrumentationLibrary: instrumentationLibrary,\n };\n}\n/**\n * Returns a list of resource spans which will be exported to the collector\n * @param groupedSpans\n * @param baseAttributes\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) {\n return Array.from(groupedSpans, function (_a) {\n var resource = _a[0], libSpans = _a[1];\n return {\n resource: toCollectorResource(resource, baseAttributes),\n instrumentationLibrarySpans: Array.from(libSpans, function (_a) {\n var instrumentationLibrary = _a[0], spans = _a[1];\n return toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex);\n }),\n };\n });\n}\n//# sourceMappingURL=transform.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { CollectorExporterBrowserBase } from './CollectorExporterBrowserBase';\nimport { toCollectorExportTraceServiceRequest } from '../../transform';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nvar DEFAULT_COLLECTOR_URL = 'http://localhost:55681/v1/traces';\n/**\n * Collector Trace Exporter for Web\n */\nvar CollectorTraceExporter = /** @class */ (function (_super) {\n __extends(CollectorTraceExporter, _super);\n function CollectorTraceExporter(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this, config) || this;\n _this._headers = Object.assign(_this._headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));\n return _this;\n }\n CollectorTraceExporter.prototype.convert = function (spans) {\n return toCollectorExportTraceServiceRequest(spans, this, true);\n };\n CollectorTraceExporter.prototype.getDefaultUrl = function (config) {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_ENDPOINT\n : DEFAULT_COLLECTOR_URL;\n };\n return CollectorTraceExporter;\n}(CollectorExporterBrowserBase));\nexport { CollectorTraceExporter };\n//# sourceMappingURL=CollectorTraceExporter.js.map","/*\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 */\n/** The Type of value. It describes how the data is reported. */\nexport var ValueType;\n(function (ValueType) {\n ValueType[ValueType[\"INT\"] = 0] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n})(ValueType || (ValueType = {}));\n/** The kind of aggregator. */\nexport var AggregationTemporality;\n(function (AggregationTemporality) {\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_UNSPECIFIED\"] = 0] = \"AGGREGATION_TEMPORALITY_UNSPECIFIED\";\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_DELTA\"] = 1] = \"AGGREGATION_TEMPORALITY_DELTA\";\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_CUMULATIVE\"] = 2] = \"AGGREGATION_TEMPORALITY_CUMULATIVE\";\n})(AggregationTemporality || (AggregationTemporality = {}));\n//# sourceMappingURL=Metric.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nvar NoopMeter = /** @class */ (function () {\n function NoopMeter() {\n }\n /**\n * Returns constant noop value recorder.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n NoopMeter.prototype.createValueRecorder = function (_name, _options) {\n return NOOP_VALUE_RECORDER_METRIC;\n };\n /**\n * Returns a constant noop counter.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n NoopMeter.prototype.createCounter = function (_name, _options) {\n return NOOP_COUNTER_METRIC;\n };\n /**\n * Returns a constant noop UpDownCounter.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n NoopMeter.prototype.createUpDownCounter = function (_name, _options) {\n return NOOP_COUNTER_METRIC;\n };\n /**\n * Returns constant noop value observer.\n * @param name the name of the metric.\n * @param [options] the metric options.\n * @param [callback] the value observer callback\n */\n NoopMeter.prototype.createValueObserver = function (_name, _options, _callback) {\n return NOOP_VALUE_OBSERVER_METRIC;\n };\n /**\n * Returns constant noop sum observer.\n * @param name the name of the metric.\n * @param [options] the metric options.\n * @param [callback] the sum observer callback\n */\n NoopMeter.prototype.createSumObserver = function (_name, _options, _callback) {\n return NOOP_SUM_OBSERVER_METRIC;\n };\n /**\n * Returns constant noop up down sum observer.\n * @param name the name of the metric.\n * @param [options] the metric options.\n * @param [callback] the up down sum observer callback\n */\n NoopMeter.prototype.createUpDownSumObserver = function (_name, _options, _callback) {\n return NOOP_UP_DOWN_SUM_OBSERVER_METRIC;\n };\n /**\n * Returns constant noop batch observer.\n * @param name the name of the metric.\n * @param callback the batch observer callback\n */\n NoopMeter.prototype.createBatchObserver = function (_callback) {\n return NOOP_BATCH_OBSERVER;\n };\n return NoopMeter;\n}());\nexport { NoopMeter };\nvar NoopMetric = /** @class */ (function () {\n function NoopMetric(instrument) {\n this._instrument = instrument;\n }\n /**\n * Returns a Bound Instrument associated with specified Labels.\n * It is recommended to keep a reference to the Bound Instrument instead of\n * always calling this method for every operations.\n * @param labels key-values pairs that are associated with a specific metric\n * that you want to record.\n */\n NoopMetric.prototype.bind = function (_labels) {\n return this._instrument;\n };\n /**\n * Removes the Binding from the metric, if it is present.\n * @param labels key-values pairs that are associated with a specific metric.\n */\n NoopMetric.prototype.unbind = function (_labels) {\n return;\n };\n /**\n * Clears all timeseries from the Metric.\n */\n NoopMetric.prototype.clear = function () {\n return;\n };\n return NoopMetric;\n}());\nexport { NoopMetric };\nvar NoopCounterMetric = /** @class */ (function (_super) {\n __extends(NoopCounterMetric, _super);\n function NoopCounterMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopCounterMetric.prototype.add = function (value, labels) {\n this.bind(labels).add(value);\n };\n return NoopCounterMetric;\n}(NoopMetric));\nexport { NoopCounterMetric };\nvar NoopValueRecorderMetric = /** @class */ (function (_super) {\n __extends(NoopValueRecorderMetric, _super);\n function NoopValueRecorderMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopValueRecorderMetric.prototype.record = function (value, labels) {\n this.bind(labels).record(value);\n };\n return NoopValueRecorderMetric;\n}(NoopMetric));\nexport { NoopValueRecorderMetric };\nvar NoopBaseObserverMetric = /** @class */ (function (_super) {\n __extends(NoopBaseObserverMetric, _super);\n function NoopBaseObserverMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopBaseObserverMetric.prototype.observation = function () {\n return {\n observer: this,\n value: 0,\n };\n };\n return NoopBaseObserverMetric;\n}(NoopMetric));\nexport { NoopBaseObserverMetric };\nvar NoopBatchObserver = /** @class */ (function () {\n function NoopBatchObserver() {\n }\n return NoopBatchObserver;\n}());\nexport { NoopBatchObserver };\nvar NoopBoundCounter = /** @class */ (function () {\n function NoopBoundCounter() {\n }\n NoopBoundCounter.prototype.add = function (_value) {\n return;\n };\n return NoopBoundCounter;\n}());\nexport { NoopBoundCounter };\nvar NoopBoundValueRecorder = /** @class */ (function () {\n function NoopBoundValueRecorder() {\n }\n NoopBoundValueRecorder.prototype.record = function (_value, _baggage, _spanContext) {\n return;\n };\n return NoopBoundValueRecorder;\n}());\nexport { NoopBoundValueRecorder };\nvar NoopBoundBaseObserver = /** @class */ (function () {\n function NoopBoundBaseObserver() {\n }\n NoopBoundBaseObserver.prototype.update = function (_value) { };\n return NoopBoundBaseObserver;\n}());\nexport { NoopBoundBaseObserver };\nexport var NOOP_METER = new NoopMeter();\nexport var NOOP_BOUND_COUNTER = new NoopBoundCounter();\nexport var NOOP_COUNTER_METRIC = new NoopCounterMetric(NOOP_BOUND_COUNTER);\nexport var NOOP_BOUND_VALUE_RECORDER = new NoopBoundValueRecorder();\nexport var NOOP_VALUE_RECORDER_METRIC = new NoopValueRecorderMetric(NOOP_BOUND_VALUE_RECORDER);\nexport var NOOP_BOUND_BASE_OBSERVER = new NoopBoundBaseObserver();\nexport var NOOP_VALUE_OBSERVER_METRIC = new NoopBaseObserverMetric(NOOP_BOUND_BASE_OBSERVER);\nexport var NOOP_UP_DOWN_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(NOOP_BOUND_BASE_OBSERVER);\nexport var NOOP_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(NOOP_BOUND_BASE_OBSERVER);\nexport var NOOP_BATCH_OBSERVER = new NoopBatchObserver();\n//# sourceMappingURL=NoopMeter.js.map","/*\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 */\nimport { NOOP_METER } from './NoopMeter';\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nvar NoopMeterProvider = /** @class */ (function () {\n function NoopMeterProvider() {\n }\n NoopMeterProvider.prototype.getMeter = function (_name, _version) {\n return NOOP_METER;\n };\n return NoopMeterProvider;\n}());\nexport { NoopMeterProvider };\nexport var NOOP_METER_PROVIDER = new NoopMeterProvider();\n//# sourceMappingURL=NoopMeterProvider.js.map","/*\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 */\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef\nexport var _globalThis = typeof globalThis === 'object' ? globalThis : window;\n//# sourceMappingURL=globalThis.js.map","/*\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 */\nimport { _globalThis } from '../platform';\nexport var GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics');\nexport var _global = _globalThis;\n/**\n * Make a function which accepts a version integer and returns the instance of an API if the version\n * is compatible, or a fallback version (usually NOOP) if it is not.\n *\n * @param requiredVersion Backwards compatibility version which is required to return the instance\n * @param instance Instance which should be returned if the required version is compatible\n * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible\n */\nexport function makeGetter(requiredVersion, instance, fallback) {\n return function (version) {\n return version === requiredVersion ? instance : fallback;\n };\n}\n/**\n * A number which should be incremented each time a backwards incompatible\n * change is made to the API. This number is used when an API package\n * attempts to access the global API to ensure it is getting a compatible\n * version. If the global API is not compatible with the API package\n * attempting to get it, a NOOP API implementation will be returned.\n */\nexport var API_BACKWARDS_COMPATIBILITY_VERSION = 3;\n//# sourceMappingURL=global-utils.js.map","/*\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 */\nimport { NOOP_METER_PROVIDER } from '../NoopMeterProvider';\nimport { API_BACKWARDS_COMPATIBILITY_VERSION, GLOBAL_METRICS_API_KEY, makeGetter, _global, } from './global-utils';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nvar MetricsAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function MetricsAPI() {\n }\n /** Get the singleton instance of the Metrics API */\n MetricsAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global meter. Returns the initialized global meter provider.\n */\n MetricsAPI.prototype.setGlobalMeterProvider = function (provider) {\n if (_global[GLOBAL_METRICS_API_KEY]) {\n // global meter provider has already been set\n return this.getMeterProvider();\n }\n _global[GLOBAL_METRICS_API_KEY] = makeGetter(API_BACKWARDS_COMPATIBILITY_VERSION, provider, NOOP_METER_PROVIDER);\n return provider;\n };\n /**\n * Returns the global meter provider.\n */\n MetricsAPI.prototype.getMeterProvider = function () {\n var _a, _b;\n return ((_b = (_a = _global[GLOBAL_METRICS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(_global, API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NOOP_METER_PROVIDER);\n };\n /**\n * Returns a meter from the global meter provider.\n */\n MetricsAPI.prototype.getMeter = function (name, version) {\n return this.getMeterProvider().getMeter(name, version);\n };\n /** Remove the global meter provider */\n MetricsAPI.prototype.disable = function () {\n delete _global[GLOBAL_METRICS_API_KEY];\n };\n return MetricsAPI;\n}());\nexport { MetricsAPI };\n//# sourceMappingURL=metrics.js.map","/*\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 * from './NoopMeter';\nexport * from './NoopMeterProvider';\nexport * from './types/BatchObserverResult';\nexport * from './types/BoundInstrument';\nexport * from './types/Meter';\nexport * from './types/MeterProvider';\nexport * from './types/Metric';\nexport * from './types/Observation';\nexport * from './types/ObserverResult';\nimport { MetricsAPI } from './api/metrics';\n/** Entrypoint for metrics API */\nexport var metrics = MetricsAPI.getInstance();\n//# sourceMappingURL=index.js.map","/*\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 */\n/** The kind of metric. */\nexport var MetricKind;\n(function (MetricKind) {\n MetricKind[MetricKind[\"COUNTER\"] = 0] = \"COUNTER\";\n MetricKind[MetricKind[\"UP_DOWN_COUNTER\"] = 1] = \"UP_DOWN_COUNTER\";\n MetricKind[MetricKind[\"VALUE_RECORDER\"] = 2] = \"VALUE_RECORDER\";\n MetricKind[MetricKind[\"SUM_OBSERVER\"] = 3] = \"SUM_OBSERVER\";\n MetricKind[MetricKind[\"UP_DOWN_SUM_OBSERVER\"] = 4] = \"UP_DOWN_SUM_OBSERVER\";\n MetricKind[MetricKind[\"VALUE_OBSERVER\"] = 5] = \"VALUE_OBSERVER\";\n MetricKind[MetricKind[\"BATCH_OBSERVER\"] = 6] = \"BATCH_OBSERVER\";\n})(MetricKind || (MetricKind = {}));\nexport var MetricKindValues = Object.values(MetricKind);\n/** The kind of aggregator. */\nexport var AggregatorKind;\n(function (AggregatorKind) {\n AggregatorKind[AggregatorKind[\"SUM\"] = 0] = \"SUM\";\n AggregatorKind[AggregatorKind[\"LAST_VALUE\"] = 1] = \"LAST_VALUE\";\n AggregatorKind[AggregatorKind[\"HISTOGRAM\"] = 2] = \"HISTOGRAM\";\n})(AggregatorKind || (AggregatorKind = {}));\n//# sourceMappingURL=types.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { diag } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api-metrics';\n/**\n * This class represent the base to BoundInstrument, which is responsible for generating\n * the TimeSeries.\n */\nvar BaseBoundInstrument = /** @class */ (function () {\n function BaseBoundInstrument(labels, _disabled, _valueType, _aggregator) {\n this._disabled = _disabled;\n this._valueType = _valueType;\n this._aggregator = _aggregator;\n this._labels = labels;\n }\n BaseBoundInstrument.prototype.update = function (value) {\n if (this._disabled)\n return;\n if (typeof value !== 'number') {\n diag.error(\"Metric cannot accept a non-number value for \" + Object.values(this._labels) + \".\");\n return;\n }\n if (this._valueType === api.ValueType.INT && !Number.isInteger(value)) {\n diag.warn(\"INT value type cannot accept a floating-point value for \" + Object.values(this._labels) + \", ignoring the fractional digits.\");\n value = Math.trunc(value);\n }\n this._aggregator.update(value);\n };\n BaseBoundInstrument.prototype.getLabels = function () {\n return this._labels;\n };\n BaseBoundInstrument.prototype.getAggregator = function () {\n return this._aggregator;\n };\n return BaseBoundInstrument;\n}());\nexport { BaseBoundInstrument };\n/**\n * BoundCounter allows the SDK to observe/record a single metric event. The\n * value of single instrument in the `Counter` associated with specified Labels.\n */\nvar BoundCounter = /** @class */ (function (_super) {\n __extends(BoundCounter, _super);\n function BoundCounter(labels, disabled, valueType, aggregator) {\n return _super.call(this, labels, disabled, valueType, aggregator) || this;\n }\n BoundCounter.prototype.add = function (value) {\n if (value < 0) {\n diag.error(\"Counter cannot descend for \" + Object.values(this._labels));\n return;\n }\n this.update(value);\n };\n return BoundCounter;\n}(BaseBoundInstrument));\nexport { BoundCounter };\n/**\n * BoundUpDownCounter allows the SDK to observe/record a single metric event.\n * The value of single instrument in the `UpDownCounter` associated with\n * specified Labels.\n */\nvar BoundUpDownCounter = /** @class */ (function (_super) {\n __extends(BoundUpDownCounter, _super);\n function BoundUpDownCounter(labels, disabled, valueType, aggregator) {\n return _super.call(this, labels, disabled, valueType, aggregator) || this;\n }\n BoundUpDownCounter.prototype.add = function (value) {\n this.update(value);\n };\n return BoundUpDownCounter;\n}(BaseBoundInstrument));\nexport { BoundUpDownCounter };\n/**\n * BoundMeasure is an implementation of the {@link BoundMeasure} interface.\n */\nvar BoundValueRecorder = /** @class */ (function (_super) {\n __extends(BoundValueRecorder, _super);\n function BoundValueRecorder(labels, disabled, valueType, aggregator) {\n return _super.call(this, labels, disabled, valueType, aggregator) || this;\n }\n BoundValueRecorder.prototype.record = function (value) {\n this.update(value);\n };\n return BoundValueRecorder;\n}(BaseBoundInstrument));\nexport { BoundValueRecorder };\n/**\n * BoundObserver is an implementation of the {@link BoundObserver} interface.\n */\nvar BoundObserver = /** @class */ (function (_super) {\n __extends(BoundObserver, _super);\n function BoundObserver(labels, disabled, valueType, aggregator) {\n return _super.call(this, labels, disabled, valueType, aggregator) || this;\n }\n return BoundObserver;\n}(BaseBoundInstrument));\nexport { BoundObserver };\n//# sourceMappingURL=BoundInstrument.js.map","/*\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 */\n/**\n * Type guard to remove nulls from arrays\n *\n * @param value value to be checked for null equality\n */\nexport function notNull(value) {\n return value !== null;\n}\n/**\n * Converting the unordered labels into unique identifier string.\n * @param labels user provided unordered Labels.\n */\nexport function hashLabels(labels) {\n var keys = Object.keys(labels);\n if (keys.length === 0)\n return '';\n keys = keys.sort();\n return keys.reduce(function (result, key) {\n if (result.length > 2) {\n result += ',';\n }\n return (result += key + ':' + labels[key]);\n }, '|#');\n}\n//# sourceMappingURL=Utils.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\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 */\nimport * as api from '@opentelemetry/api-metrics';\nimport { hashLabels } from './Utils';\n/** This is a SDK implementation of {@link Metric} interface. */\nvar Metric = /** @class */ (function () {\n function Metric(_name, _options, _kind, resource, instrumentationLibrary) {\n this._name = _name;\n this._options = _options;\n this._kind = _kind;\n this.resource = resource;\n this.instrumentationLibrary = instrumentationLibrary;\n this._instruments = new Map();\n this._disabled = !!_options.disabled;\n this._valueType =\n typeof _options.valueType === 'number'\n ? _options.valueType\n : api.ValueType.DOUBLE;\n this._boundaries = _options.boundaries;\n this._descriptor = this._getMetricDescriptor();\n this._aggregationTemporality =\n _options.aggregationTemporality === undefined\n ? api.AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE\n : _options.aggregationTemporality;\n }\n /**\n * Returns an Instrument associated with specified Labels.\n * It is recommended to keep a reference to the Instrument instead of always\n * calling this method for each operation.\n * @param labels key-values pairs that are associated with a specific metric\n * that you want to record.\n */\n Metric.prototype.bind = function (labels) {\n var hash = hashLabels(labels);\n if (this._instruments.has(hash))\n return this._instruments.get(hash);\n var instrument = this._makeInstrument(labels);\n this._instruments.set(hash, instrument);\n return instrument;\n };\n /**\n * Removes the Instrument from the metric, if it is present.\n * @param labels key-values pairs that are associated with a specific metric.\n */\n Metric.prototype.unbind = function (labels) {\n this._instruments.delete(hashLabels(labels));\n };\n /**\n * Clears all Instruments from the Metric.\n */\n Metric.prototype.clear = function () {\n this._instruments.clear();\n };\n /**\n * Returns kind of metric\n */\n Metric.prototype.getKind = function () {\n return this._kind;\n };\n Metric.prototype.getAggregationTemporality = function () {\n return this._aggregationTemporality;\n };\n Metric.prototype.getMetricRecord = function () {\n var _this = this;\n return new Promise(function (resolve) {\n resolve(Array.from(_this._instruments.values()).map(function (instrument) { return ({\n descriptor: _this._descriptor,\n labels: instrument.getLabels(),\n aggregator: instrument.getAggregator(),\n aggregationTemporality: _this.getAggregationTemporality(),\n resource: _this.resource,\n instrumentationLibrary: _this.instrumentationLibrary,\n }); }));\n });\n };\n Metric.prototype._getMetricDescriptor = function () {\n return __assign({ name: this._name, description: this._options.description || '', unit: this._options.unit || '1', metricKind: this._kind, valueType: this._valueType }, (this._boundaries && { boundaries: this._boundaries }));\n };\n return Metric;\n}());\nexport { Metric };\n//# sourceMappingURL=Metric.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BoundCounter } from './BoundInstrument';\nimport { MetricKind } from './export/types';\nimport { Metric } from './Metric';\n/** This is a SDK implementation of Counter Metric. */\nvar CounterMetric = /** @class */ (function (_super) {\n __extends(CounterMetric, _super);\n function CounterMetric(name, options, _processor, resource, instrumentationLibrary) {\n var _this = _super.call(this, name, options, MetricKind.COUNTER, resource, instrumentationLibrary) || this;\n _this._processor = _processor;\n return _this;\n }\n CounterMetric.prototype._makeInstrument = function (labels) {\n return new BoundCounter(labels, this._disabled, this._valueType, this._processor.aggregatorFor(this._descriptor));\n };\n /**\n * Adds the given value to the current value. Values cannot be negative.\n * @param value the value to add.\n * @param [labels = {}] key-values pairs that are associated with a specific metric\n * that you want to record.\n */\n CounterMetric.prototype.add = function (value, labels) {\n if (labels === void 0) { labels = {}; }\n this.bind(labels).add(value);\n };\n return CounterMetric;\n}(Metric));\nexport { CounterMetric };\n//# sourceMappingURL=CounterMetric.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BoundValueRecorder } from './BoundInstrument';\nimport { MetricKind } from './export/types';\nimport { Metric } from './Metric';\n/** This is a SDK implementation of Value Recorder Metric. */\nvar ValueRecorderMetric = /** @class */ (function (_super) {\n __extends(ValueRecorderMetric, _super);\n function ValueRecorderMetric(name, options, _processor, resource, instrumentationLibrary) {\n var _this = _super.call(this, name, options, MetricKind.VALUE_RECORDER, resource, instrumentationLibrary) || this;\n _this._processor = _processor;\n return _this;\n }\n ValueRecorderMetric.prototype._makeInstrument = function (labels) {\n return new BoundValueRecorder(labels, this._disabled, this._valueType, this._processor.aggregatorFor(this._descriptor));\n };\n ValueRecorderMetric.prototype.record = function (value, labels) {\n if (labels === void 0) { labels = {}; }\n this.bind(labels).record(value);\n };\n return ValueRecorderMetric;\n}(Metric));\nexport { ValueRecorderMetric };\n//# sourceMappingURL=ValueRecorderMetric.js.map","/*\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 */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { Resource } from '../../Resource';\n/**\n * Detects resources for the browser platform, which is currently only the\n * telemetry SDK resource. More could be added in the future. This method\n * is async to match the signature of corresponding method for node.\n */\nexport var detectResources = function () { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, Resource.empty()];\n });\n}); };\n//# sourceMappingURL=detect-resources.js.map","/*\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 */\nimport { ResourceAttributes as SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport { defaultServiceName } from './platform';\n/**\n * A Resource describes the entity for which a signals (metrics or trace) are\n * collected.\n */\nvar Resource = /** @class */ (function () {\n function Resource(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n attributes) {\n this.attributes = attributes;\n }\n /**\n * Returns an empty Resource\n */\n Resource.empty = function () {\n return Resource.EMPTY;\n };\n /**\n * Returns a Resource that indentifies the SDK in use.\n */\n Resource.default = function () {\n var _a;\n return new Resource((_a = {},\n _a[SemanticResourceAttributes.SERVICE_NAME] = defaultServiceName(),\n _a[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],\n _a[SemanticResourceAttributes.TELEMETRY_SDK_NAME] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_NAME],\n _a[SemanticResourceAttributes.TELEMETRY_SDK_VERSION] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_VERSION],\n _a));\n };\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n Resource.prototype.merge = function (other) {\n if (!other || !Object.keys(other.attributes).length)\n return this;\n // SpanAttributes from resource overwrite attributes from other resource.\n var mergedAttributes = Object.assign({}, this.attributes, other.attributes);\n return new Resource(mergedAttributes);\n };\n Resource.EMPTY = new Resource({});\n return Resource;\n}());\nexport { Resource };\n//# sourceMappingURL=Resource.js.map","/*\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 function defaultServiceName() {\n return 'unknown_service';\n}\n//# sourceMappingURL=default-service-name.js.map","/*\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 */\n/**\n * Implementation of api BatchObserverResult\n */\nvar BatchObserverResult = /** @class */ (function () {\n function BatchObserverResult() {\n /**\n * Cancels the further updates.\n * This is used to prevent updating the value of result that took too\n * long to update. For example to avoid update after timeout.\n * See {@link BatchObserver.collect}\n */\n this.cancelled = false;\n }\n /**\n * used to save a callback that will be called after the observations are\n * updated\n * @param [callback]\n */\n BatchObserverResult.prototype.onObserveCalled = function (callback) {\n this._callback = callback;\n };\n BatchObserverResult.prototype.observe = function (labels, observations) {\n var _this = this;\n if (this.cancelled || !this._callback) {\n return;\n }\n observations.forEach(function (observation) {\n observation.observer.bind(labels).update(observation.value);\n });\n if (!this._immediate) {\n this._immediate = setImmediate(function () {\n if (typeof _this._callback === 'function') {\n _this._callback();\n // prevent user from updating the values later if for any reason\n // the observerBatchResult will be referenced and then try to use\n _this._callback = undefined;\n }\n });\n }\n };\n return BatchObserverResult;\n}());\nexport { BatchObserverResult };\n//# sourceMappingURL=BatchObserverResult.js.map","/*\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 */\nimport { diag } from '@opentelemetry/api';\nimport { BatchObserverResult } from './BatchObserverResult';\nvar NOOP_CALLBACK = function () { };\nvar MAX_TIMEOUT_UPDATE_MS = 500;\n/** This is a SDK implementation of Batch Observer. */\nvar BatchObserver = /** @class */ (function () {\n function BatchObserver(options, callback) {\n var _a;\n this._maxTimeoutUpdateMS =\n (_a = options.maxTimeoutUpdateMS) !== null && _a !== void 0 ? _a : MAX_TIMEOUT_UPDATE_MS;\n this._callback = callback || NOOP_CALLBACK;\n }\n BatchObserver.prototype.collect = function () {\n var _this = this;\n diag.debug('getMetricRecord - start');\n return new Promise(function (resolve) {\n var observerResult = new BatchObserverResult();\n // cancels after MAX_TIMEOUT_MS - no more waiting for results\n var timer = setTimeout(function () {\n observerResult.cancelled = true;\n // remove callback to prevent user from updating the values later if\n // for any reason the observerBatchResult will be referenced\n observerResult.onObserveCalled();\n resolve();\n diag.debug('getMetricRecord - timeout');\n }, _this._maxTimeoutUpdateMS);\n // sets callback for each \"observe\" method\n observerResult.onObserveCalled(function () {\n clearTimeout(timer);\n resolve();\n diag.debug('getMetricRecord - end');\n });\n // calls the BatchObserverResult callback\n _this._callback(observerResult);\n });\n };\n return BatchObserver;\n}());\nexport { BatchObserver };\n//# sourceMappingURL=BatchObserver.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { ExportResultCode, unrefTimer, globalErrorHandler, } from '@opentelemetry/core';\nvar DEFAULT_EXPORT_INTERVAL = 60000;\nvar Controller = /** @class */ (function () {\n function Controller() {\n }\n return Controller;\n}());\nexport { Controller };\n/** Controller organizes a periodic push of metric data. */\nvar PushController = /** @class */ (function (_super) {\n __extends(PushController, _super);\n function PushController(_meter, _exporter, interval) {\n if (interval === void 0) { interval = DEFAULT_EXPORT_INTERVAL; }\n var _this = _super.call(this) || this;\n _this._meter = _meter;\n _this._exporter = _exporter;\n _this._timer = setInterval(function () {\n _this._collect().catch(function (err) {\n globalErrorHandler(err);\n });\n }, interval);\n unrefTimer(_this._timer);\n return _this;\n }\n PushController.prototype.shutdown = function () {\n clearInterval(this._timer);\n return this._collect();\n };\n PushController.prototype._collect = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this._meter.collect()];\n case 1:\n _a.sent();\n return [2 /*return*/, new Promise(function (resolve) {\n _this._exporter.export(_this._meter.getProcessor().checkPointSet(), function (result) {\n var _a;\n if (result.code !== ExportResultCode.SUCCESS) {\n globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error('PushController: export failed in _collect'));\n }\n resolve();\n });\n })];\n }\n });\n });\n };\n return PushController;\n}(Controller));\nexport { PushController };\n//# sourceMappingURL=Controller.js.map","/*\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 */\nvar NoopExporter = /** @class */ (function () {\n function NoopExporter() {\n }\n // By default does nothing\n NoopExporter.prototype.export = function (_metrics, _resultCallback) { };\n // By default does nothing\n NoopExporter.prototype.shutdown = function () {\n return Promise.resolve();\n };\n return NoopExporter;\n}());\nexport { NoopExporter };\n//# sourceMappingURL=NoopExporter.js.map","/*\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 */\nimport { AggregatorKind, } from '../types';\nimport { hrTime } from '@opentelemetry/core';\n/**\n * Basic aggregator which observes events and counts them in pre-defined buckets\n * and provides the total sum and count of all observations.\n */\nvar HistogramAggregator = /** @class */ (function () {\n function HistogramAggregator(boundaries) {\n this.kind = AggregatorKind.HISTOGRAM;\n if (boundaries === undefined || boundaries.length === 0) {\n throw new Error('HistogramAggregator should be created with boundaries.');\n }\n // we need to an ordered set to be able to correctly compute count for each\n // boundary since we'll iterate on each in order.\n this._boundaries = boundaries.sort(function (a, b) { return a - b; });\n this._current = this._newEmptyCheckpoint();\n this._lastUpdateTime = hrTime();\n }\n HistogramAggregator.prototype.update = function (value) {\n this._lastUpdateTime = hrTime();\n this._current.count += 1;\n this._current.sum += value;\n for (var i = 0; i < this._boundaries.length; i++) {\n if (value < this._boundaries[i]) {\n this._current.buckets.counts[i] += 1;\n return;\n }\n }\n // value is above all observed boundaries\n this._current.buckets.counts[this._boundaries.length] += 1;\n };\n HistogramAggregator.prototype.toPoint = function () {\n return {\n value: this._current,\n timestamp: this._lastUpdateTime,\n };\n };\n HistogramAggregator.prototype._newEmptyCheckpoint = function () {\n return {\n buckets: {\n boundaries: this._boundaries,\n counts: this._boundaries.map(function () { return 0; }).concat([0]),\n },\n sum: 0,\n count: 0,\n };\n };\n return HistogramAggregator;\n}());\nexport { HistogramAggregator };\n//# sourceMappingURL=Histogram.js.map","/*\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 */\nimport { AggregatorKind, } from '../types';\nimport { hrTime } from '@opentelemetry/core';\n/** Basic aggregator for LastValue which keeps the last recorded value. */\nvar LastValueAggregator = /** @class */ (function () {\n function LastValueAggregator() {\n this._current = 0;\n this._lastUpdateTime = [0, 0];\n this.kind = AggregatorKind.LAST_VALUE;\n }\n LastValueAggregator.prototype.update = function (value) {\n this._current = value;\n this._lastUpdateTime = hrTime();\n };\n LastValueAggregator.prototype.toPoint = function () {\n return {\n value: this._current,\n timestamp: this._lastUpdateTime,\n };\n };\n return LastValueAggregator;\n}());\nexport { LastValueAggregator };\n//# sourceMappingURL=LastValue.js.map","/*\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 */\nimport { AggregatorKind } from '../types';\nimport { hrTime } from '@opentelemetry/core';\n/** Basic aggregator which calculates a Sum from individual measurements. */\nvar SumAggregator = /** @class */ (function () {\n function SumAggregator() {\n this.kind = AggregatorKind.SUM;\n this._current = 0;\n this._lastUpdateTime = [0, 0];\n }\n SumAggregator.prototype.update = function (value) {\n this._current += value;\n this._lastUpdateTime = hrTime();\n };\n SumAggregator.prototype.toPoint = function () {\n return {\n value: this._current,\n timestamp: this._lastUpdateTime,\n };\n };\n return SumAggregator;\n}());\nexport { SumAggregator };\n//# sourceMappingURL=Sum.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as aggregators from './aggregators';\nimport { MetricKind, } from './types';\n/**\n * Base class for all processor types.\n *\n * The processor is responsible for storing the aggregators and aggregated\n * values received from updates from metrics in the meter. The stored values\n * will be sent to an exporter for exporting.\n */\nvar Processor = /** @class */ (function () {\n function Processor() {\n this._batchMap = new Map();\n }\n Processor.prototype.checkPointSet = function () {\n return Array.from(this._batchMap.values());\n };\n return Processor;\n}());\nexport { Processor };\n/**\n * Processor which retains all dimensions/labels. It accepts all records and\n * passes them for exporting.\n */\nvar UngroupedProcessor = /** @class */ (function (_super) {\n __extends(UngroupedProcessor, _super);\n function UngroupedProcessor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n UngroupedProcessor.prototype.aggregatorFor = function (metricDescriptor) {\n switch (metricDescriptor.metricKind) {\n case MetricKind.COUNTER:\n case MetricKind.UP_DOWN_COUNTER:\n return new aggregators.SumAggregator();\n case MetricKind.SUM_OBSERVER:\n case MetricKind.UP_DOWN_SUM_OBSERVER:\n case MetricKind.VALUE_OBSERVER:\n return new aggregators.LastValueAggregator();\n case MetricKind.VALUE_RECORDER:\n return new aggregators.HistogramAggregator(metricDescriptor.boundaries || [Infinity]);\n default:\n return new aggregators.LastValueAggregator();\n }\n };\n UngroupedProcessor.prototype.process = function (record) {\n var labels = Object.keys(record.labels)\n .map(function (k) { return k + \"=\" + record.labels[k]; })\n .join(',');\n this._batchMap.set(record.descriptor.name + labels, record);\n };\n return UngroupedProcessor;\n}(Processor));\nexport { UngroupedProcessor };\n//# sourceMappingURL=Processor.js.map","/*\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 */\n/**\n * Implementation of {@link TypeObserverResult}\n */\nvar ObserverResult = /** @class */ (function () {\n function ObserverResult() {\n this.values = new Map();\n }\n ObserverResult.prototype.observe = function (value, labels) {\n this.values.set(labels, value);\n };\n return ObserverResult;\n}());\nexport { ObserverResult };\n//# sourceMappingURL=ObserverResult.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { BoundObserver } from './BoundInstrument';\nimport { Metric } from './Metric';\nimport { ObserverResult } from './ObserverResult';\nvar NOOP_CALLBACK = function () { };\n/**\n * This is a SDK implementation of Base Observer Metric.\n * All observers should extend this class\n */\nvar BaseObserverMetric = /** @class */ (function (_super) {\n __extends(BaseObserverMetric, _super);\n function BaseObserverMetric(name, options, _processor, resource, metricKind, instrumentationLibrary, callback) {\n var _this = _super.call(this, name, options, metricKind, resource, instrumentationLibrary) || this;\n _this._processor = _processor;\n _this._callback = callback || NOOP_CALLBACK;\n return _this;\n }\n BaseObserverMetric.prototype._makeInstrument = function (labels) {\n return new BoundObserver(labels, this._disabled, this._valueType, this._processor.aggregatorFor(this._descriptor));\n };\n BaseObserverMetric.prototype.getMetricRecord = function () {\n return __awaiter(this, void 0, void 0, function () {\n var observerResult;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n observerResult = new ObserverResult();\n return [4 /*yield*/, this._callback(observerResult)];\n case 1:\n _a.sent();\n this._processResults(observerResult);\n return [2 /*return*/, _super.prototype.getMetricRecord.call(this)];\n }\n });\n });\n };\n BaseObserverMetric.prototype._processResults = function (observerResult) {\n var _this = this;\n observerResult.values.forEach(function (value, labels) {\n var instrument = _this.bind(labels);\n instrument.update(value);\n });\n };\n BaseObserverMetric.prototype.observation = function (value) {\n return {\n value: value,\n observer: this,\n };\n };\n return BaseObserverMetric;\n}(Metric));\nexport { BaseObserverMetric };\n//# sourceMappingURL=BaseObserverMetric.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BaseObserverMetric } from './BaseObserverMetric';\nimport { MetricKind } from './export/types';\n/** This is a SDK implementation of SumObserver Metric. */\nvar SumObserverMetric = /** @class */ (function (_super) {\n __extends(SumObserverMetric, _super);\n function SumObserverMetric(name, options, processor, resource, instrumentationLibrary, callback) {\n return _super.call(this, name, options, processor, resource, MetricKind.SUM_OBSERVER, instrumentationLibrary, callback) || this;\n }\n SumObserverMetric.prototype._processResults = function (observerResult) {\n var _this = this;\n observerResult.values.forEach(function (value, labels) {\n var instrument = _this.bind(labels);\n // SumObserver is monotonic which means it should only accept values\n // greater or equal then previous value\n var previous = instrument.getAggregator().toPoint();\n var previousValue = -Infinity;\n if (previous.timestamp[0] !== 0 || previous.timestamp[1] !== 0) {\n previousValue = previous.value;\n }\n if (value >= previousValue) {\n instrument.update(value);\n }\n });\n };\n return SumObserverMetric;\n}(BaseObserverMetric));\nexport { SumObserverMetric };\n//# sourceMappingURL=SumObserverMetric.js.map","/*\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 */\nimport * as api from '@opentelemetry/api-metrics';\n/** Default Meter configuration. */\nexport var DEFAULT_CONFIG = {};\n/** The default metric creation options value. */\nexport var DEFAULT_METRIC_OPTIONS = {\n disabled: false,\n description: '',\n unit: '1',\n valueType: api.ValueType.DOUBLE,\n};\n//# sourceMappingURL=types.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BoundUpDownCounter } from './BoundInstrument';\nimport { MetricKind } from './export/types';\nimport { Metric } from './Metric';\n/** This is a SDK implementation of UpDownCounter Metric. */\nvar UpDownCounterMetric = /** @class */ (function (_super) {\n __extends(UpDownCounterMetric, _super);\n function UpDownCounterMetric(name, options, _processor, resource, instrumentationLibrary) {\n var _this = _super.call(this, name, options, MetricKind.UP_DOWN_COUNTER, resource, instrumentationLibrary) || this;\n _this._processor = _processor;\n return _this;\n }\n UpDownCounterMetric.prototype._makeInstrument = function (labels) {\n return new BoundUpDownCounter(labels, this._disabled, this._valueType, this._processor.aggregatorFor(this._descriptor));\n };\n /**\n * Adds the given value to the current value. Values cannot be negative.\n * @param value the value to add.\n * @param [labels = {}] key-values pairs that are associated with a specific\n * metric that you want to record.\n */\n UpDownCounterMetric.prototype.add = function (value, labels) {\n if (labels === void 0) { labels = {}; }\n this.bind(labels).add(value);\n };\n return UpDownCounterMetric;\n}(Metric));\nexport { UpDownCounterMetric };\n//# sourceMappingURL=UpDownCounterMetric.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BaseObserverMetric } from './BaseObserverMetric';\nimport { MetricKind } from './export/types';\n/** This is a SDK implementation of UpDownSumObserver Metric. */\nvar UpDownSumObserverMetric = /** @class */ (function (_super) {\n __extends(UpDownSumObserverMetric, _super);\n function UpDownSumObserverMetric(name, options, processor, resource, instrumentationLibrary, callback) {\n return _super.call(this, name, options, processor, resource, MetricKind.UP_DOWN_SUM_OBSERVER, instrumentationLibrary, callback) || this;\n }\n return UpDownSumObserverMetric;\n}(BaseObserverMetric));\nexport { UpDownSumObserverMetric };\n//# sourceMappingURL=UpDownSumObserverMetric.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BaseObserverMetric } from './BaseObserverMetric';\nimport { MetricKind } from './export/types';\n/** This is a SDK implementation of Value Observer Metric. */\nvar ValueObserverMetric = /** @class */ (function (_super) {\n __extends(ValueObserverMetric, _super);\n function ValueObserverMetric(name, options, processor, resource, instrumentationLibrary, callback) {\n return _super.call(this, name, options, processor, resource, MetricKind.VALUE_OBSERVER, instrumentationLibrary, callback) || this;\n }\n return ValueObserverMetric;\n}(BaseObserverMetric));\nexport { ValueObserverMetric };\n//# sourceMappingURL=ValueObserverMetric.js.map","/*\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 */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { diag } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api-metrics';\nimport { Resource } from '@opentelemetry/resources';\nimport { BatchObserver } from './BatchObserver';\nimport { CounterMetric } from './CounterMetric';\nimport { PushController } from './export/Controller';\nimport { NoopExporter } from './export/NoopExporter';\nimport { UngroupedProcessor } from './export/Processor';\nimport { SumObserverMetric } from './SumObserverMetric';\nimport { DEFAULT_CONFIG, DEFAULT_METRIC_OPTIONS } from './types';\nimport { UpDownCounterMetric } from './UpDownCounterMetric';\nimport { UpDownSumObserverMetric } from './UpDownSumObserverMetric';\nimport { ValueObserverMetric } from './ValueObserverMetric';\nimport { ValueRecorderMetric } from './ValueRecorderMetric';\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nvar merge = require('lodash.merge');\n/**\n * Meter is an implementation of the {@link Meter} interface.\n */\nvar Meter = /** @class */ (function () {\n /**\n * Constructs a new Meter instance.\n */\n function Meter(instrumentationLibrary, config) {\n if (config === void 0) { config = {}; }\n var _a;\n this._batchObservers = [];\n this._metrics = new Map();\n this._isShutdown = false;\n this._shuttingDownPromise = Promise.resolve();\n var mergedConfig = merge({}, DEFAULT_CONFIG, config);\n this._processor = (_a = mergedConfig.processor) !== null && _a !== void 0 ? _a : new UngroupedProcessor();\n this._resource =\n mergedConfig.resource || Resource.empty();\n this._instrumentationLibrary = instrumentationLibrary;\n // start the push controller\n var exporter = mergedConfig.exporter || new NoopExporter();\n var interval = mergedConfig.interval;\n this._controller = new PushController(this, exporter, interval);\n }\n /**\n * Creates and returns a new {@link ValueRecorder}.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n Meter.prototype.createValueRecorder = function (name, options) {\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_VALUE_RECORDER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var valueRecorder = new ValueRecorderMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary);\n this._registerMetric(name, valueRecorder);\n return valueRecorder;\n };\n /**\n * Creates a new counter metric. Generally, this kind of metric when the\n * value is a quantity, the sum is of primary interest, and the event count\n * and value distribution are not of primary interest.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n Meter.prototype.createCounter = function (name, options) {\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_COUNTER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var counter = new CounterMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary);\n this._registerMetric(name, counter);\n return counter;\n };\n /**\n * Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous\n * instrument and very similar to Counter except that Add(increment)\n * supports negative increments. It is generally useful for capturing changes\n * in an amount of resources used, or any quantity that rises and falls\n * during a request.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n Meter.prototype.createUpDownCounter = function (name, options) {\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_COUNTER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var upDownCounter = new UpDownCounterMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary);\n this._registerMetric(name, upDownCounter);\n return upDownCounter;\n };\n /**\n * Creates a new `ValueObserver` metric.\n * @param name the name of the metric.\n * @param [options] the metric options.\n * @param [callback] the value observer callback\n */\n Meter.prototype.createValueObserver = function (name, options, callback) {\n if (options === void 0) { options = {}; }\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_VALUE_OBSERVER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var valueObserver = new ValueObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback);\n this._registerMetric(name, valueObserver);\n return valueObserver;\n };\n Meter.prototype.createSumObserver = function (name, options, callback) {\n if (options === void 0) { options = {}; }\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_SUM_OBSERVER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var sumObserver = new SumObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback);\n this._registerMetric(name, sumObserver);\n return sumObserver;\n };\n /**\n * Creates a new `UpDownSumObserver` metric.\n * @param name the name of the metric.\n * @param [options] the metric options.\n * @param [callback] the value observer callback\n */\n Meter.prototype.createUpDownSumObserver = function (name, options, callback) {\n if (options === void 0) { options = {}; }\n if (!this._isValidName(name)) {\n diag.warn(\"Invalid metric name \" + name + \". Defaulting to noop metric implementation.\");\n return api.NOOP_UP_DOWN_SUM_OBSERVER_METRIC;\n }\n var opt = __assign(__assign({}, DEFAULT_METRIC_OPTIONS), options);\n var upDownSumObserver = new UpDownSumObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback);\n this._registerMetric(name, upDownSumObserver);\n return upDownSumObserver;\n };\n /**\n * Creates a new batch observer.\n * @param callback the batch observer callback\n * @param [options] the batch options.\n */\n Meter.prototype.createBatchObserver = function (callback, options) {\n if (options === void 0) { options = {}; }\n var opt = __assign({}, options);\n var batchObserver = new BatchObserver(opt, callback);\n this._batchObservers.push(batchObserver);\n return batchObserver;\n };\n /**\n * Collects all the metrics created with this `Meter` for export.\n *\n * Utilizes the processor to create checkpoints of the current values in\n * each aggregator belonging to the metrics that were created with this\n * meter instance.\n */\n Meter.prototype.collect = function () {\n return __awaiter(this, void 0, void 0, function () {\n var observations, metricsRecords;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n observations = this._batchObservers.map(function (observer) {\n return observer.collect();\n });\n return [4 /*yield*/, Promise.all(observations)];\n case 1:\n _a.sent();\n metricsRecords = Array.from(this._metrics.values()).map(function (metric) {\n return metric.getMetricRecord();\n });\n return [4 /*yield*/, Promise.all(metricsRecords).then(function (records) {\n records.forEach(function (metrics) {\n metrics.forEach(function (metric) { return _this._processor.process(metric); });\n });\n })];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n Meter.prototype.getProcessor = function () {\n return this._processor;\n };\n Meter.prototype.shutdown = function () {\n var _this = this;\n if (this._isShutdown) {\n return this._shuttingDownPromise;\n }\n this._isShutdown = true;\n this._shuttingDownPromise = new Promise(function (resolve, reject) {\n Promise.resolve()\n .then(function () {\n return _this._controller.shutdown();\n })\n .then(resolve)\n .catch(function (e) {\n reject(e);\n });\n });\n return this._shuttingDownPromise;\n };\n /**\n * Registers metric to register.\n * @param name The name of the metric.\n * @param metric The metric to register.\n */\n Meter.prototype._registerMetric = function (name, metric) {\n if (this._metrics.has(name)) {\n diag.error(\"A metric with the name \" + name + \" has already been registered.\");\n return;\n }\n this._metrics.set(name, metric);\n };\n /**\n * Ensure a metric name conforms to the following rules:\n *\n * 1. They are non-empty strings\n *\n * 2. The first character must be non-numeric, non-space, non-punctuation\n *\n * 3. Subsequent characters must be belong to the alphanumeric characters,\n * '_', '.', and '-'.\n *\n * Names are case insensitive\n *\n * @param name Name of metric to be created\n */\n Meter.prototype._isValidName = function (name) {\n return Boolean(name.match(/^[a-z][a-z0-9_.-]*$/i));\n };\n return Meter;\n}());\nexport { Meter };\n//# sourceMappingURL=Meter.js.map","/*\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 */\nimport { Resource } from '@opentelemetry/resources';\nimport { Meter } from '.';\nimport { DEFAULT_CONFIG } from './types';\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nvar merge = require('lodash.merge');\n/**\n * This class represents a meter provider which platform libraries can extend\n */\nvar MeterProvider = /** @class */ (function () {\n function MeterProvider(config) {\n if (config === void 0) { config = {}; }\n this._meters = new Map();\n this._shuttingDownPromise = Promise.resolve();\n this._isShutdown = false;\n var mergedConfig = merge({}, DEFAULT_CONFIG, config);\n this.resource = mergedConfig.resource || Resource.empty();\n this.resource = Resource.default().merge(this.resource);\n this._config = Object.assign({}, mergedConfig, {\n resource: this.resource,\n });\n }\n /**\n * Returns a Meter, creating one if one with the given name and version is not already created\n *\n * @returns Meter A Meter with the given name and version\n */\n MeterProvider.prototype.getMeter = function (name, version, config) {\n var key = name + \"@\" + (version || '');\n if (!this._meters.has(key)) {\n this._meters.set(key, new Meter({ name: name, version: version }, config || this._config));\n }\n return this._meters.get(key);\n };\n MeterProvider.prototype.shutdown = function () {\n var _this = this;\n if (this._isShutdown) {\n return this._shuttingDownPromise;\n }\n this._isShutdown = true;\n this._shuttingDownPromise = new Promise(function (resolve, reject) {\n Promise.resolve()\n .then(function () {\n return Promise.all(Array.from(_this._meters, function (_a) {\n var _ = _a[0], meter = _a[1];\n return meter.shutdown();\n }));\n })\n .then(function () {\n if (_this._config.exporter) {\n return _this._config.exporter.shutdown();\n }\n return;\n })\n .then(resolve)\n .catch(function (e) {\n reject(e);\n });\n });\n return this._shuttingDownPromise;\n };\n return MeterProvider;\n}());\nexport { MeterProvider };\n//# sourceMappingURL=MeterProvider.js.map","/*\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 */\nimport { ExportResultCode } from '@opentelemetry/core';\n/**\n * This is implementation of {@link MetricExporter} that prints metrics data to\n * the console. This class can be used for diagnostic purposes.\n */\n/* eslint-disable no-console */\nvar ConsoleMetricExporter = /** @class */ (function () {\n function ConsoleMetricExporter() {\n }\n ConsoleMetricExporter.prototype.export = function (metrics, resultCallback) {\n for (var _i = 0, metrics_1 = metrics; _i < metrics_1.length; _i++) {\n var metric = metrics_1[_i];\n console.log(metric.descriptor);\n console.log(metric.labels);\n var point = metric.aggregator.toPoint();\n if (typeof point.value === 'number') {\n console.log('value: ' + point.value);\n }\n else if (typeof point.value.buckets === 'object') {\n var histogram = point.value;\n console.log(\"count: \" + histogram.count + \", sum: \" + histogram.sum + \", buckets: \" + histogram.buckets);\n }\n else {\n console.log(point.value);\n }\n }\n return resultCallback({ code: ExportResultCode.SUCCESS });\n };\n ConsoleMetricExporter.prototype.shutdown = function () {\n // By default does nothing\n return Promise.resolve();\n };\n return ConsoleMetricExporter;\n}());\nexport { ConsoleMetricExporter };\n//# sourceMappingURL=ConsoleMetricExporter.js.map","/*\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 */\nimport { ValueType } from '@opentelemetry/api-metrics';\nimport * as core from '@opentelemetry/core';\nimport { AggregatorKind, MetricKind, } from '@opentelemetry/metrics';\nimport { toCollectorResource } from './transform';\nimport { opentelemetryProto } from './types';\n/**\n * Converts labels\n * @param labels\n */\nexport function toCollectorLabels(labels) {\n return Object.entries(labels).map(function (_a) {\n var key = _a[0], value = _a[1];\n return { key: key, value: String(value) };\n });\n}\n/**\n * Given a MetricDescriptor, return its temporality in a compatible format with the collector\n * @param descriptor\n */\nexport function toAggregationTemporality(metric) {\n if (metric.descriptor.metricKind === MetricKind.VALUE_OBSERVER) {\n return opentelemetryProto.metrics.v1.AggregationTemporality\n .AGGREGATION_TEMPORALITY_UNSPECIFIED;\n }\n return metric.aggregationTemporality;\n}\n/**\n * Returns an DataPoint which can have integers or doublle values\n * @param metric\n * @param startTime\n */\nexport function toDataPoint(metric, startTime) {\n return {\n labels: toCollectorLabels(metric.labels),\n value: metric.aggregator.toPoint().value,\n startTimeUnixNano: startTime,\n timeUnixNano: core.hrTimeToNanoseconds(metric.aggregator.toPoint().timestamp),\n };\n}\n/**\n * Returns a HistogramPoint to the collector\n * @param metric\n * @param startTime\n */\nexport function toHistogramPoint(metric, startTime) {\n var _a = metric.aggregator.toPoint(), value = _a.value, timestamp = _a.timestamp;\n return {\n labels: toCollectorLabels(metric.labels),\n sum: value.sum,\n count: value.count,\n startTimeUnixNano: startTime,\n timeUnixNano: core.hrTimeToNanoseconds(timestamp),\n bucketCounts: value.buckets.counts,\n explicitBounds: value.buckets.boundaries,\n };\n}\n/**\n * Converts a metric to be compatible with the collector\n * @param metric\n * @param startTime start time in nanoseconds\n */\nexport function toCollectorMetric(metric, startTime) {\n var metricCollector = {\n name: metric.descriptor.name,\n description: metric.descriptor.description,\n unit: metric.descriptor.unit,\n };\n if (metric.aggregator.kind === AggregatorKind.SUM ||\n metric.descriptor.metricKind === MetricKind.SUM_OBSERVER ||\n metric.descriptor.metricKind === MetricKind.UP_DOWN_SUM_OBSERVER) {\n var result = {\n dataPoints: [toDataPoint(metric, startTime)],\n isMonotonic: metric.descriptor.metricKind === MetricKind.COUNTER ||\n metric.descriptor.metricKind === MetricKind.SUM_OBSERVER,\n aggregationTemporality: toAggregationTemporality(metric),\n };\n if (metric.descriptor.valueType === ValueType.INT) {\n metricCollector.intSum = result;\n }\n else {\n metricCollector.doubleSum = result;\n }\n }\n else if (metric.aggregator.kind === AggregatorKind.LAST_VALUE) {\n var result = {\n dataPoints: [toDataPoint(metric, startTime)],\n };\n if (metric.descriptor.valueType === ValueType.INT) {\n metricCollector.intGauge = result;\n }\n else {\n metricCollector.doubleGauge = result;\n }\n }\n else if (metric.aggregator.kind === AggregatorKind.HISTOGRAM) {\n var result = {\n dataPoints: [toHistogramPoint(metric, startTime)],\n aggregationTemporality: toAggregationTemporality(metric),\n };\n if (metric.descriptor.valueType === ValueType.INT) {\n metricCollector.intHistogram = result;\n }\n else {\n metricCollector.doubleHistogram = result;\n }\n }\n return metricCollector;\n}\n/**\n * Prepares metric service request to be sent to collector\n * @param metrics metrics\n * @param startTime start time of the metric in nanoseconds\n * @param collectorMetricExporterBase\n */\nexport function toCollectorExportMetricServiceRequest(metrics, startTime, collectorExporterBase) {\n var groupedMetrics = groupMetricsByResourceAndLibrary(metrics);\n var additionalAttributes = Object.assign({}, collectorExporterBase.attributes);\n return {\n resourceMetrics: toCollectorResourceMetrics(groupedMetrics, additionalAttributes, startTime),\n };\n}\n/**\n * Takes an array of metrics and groups them by resource and instrumentation\n * library\n * @param metrics metrics\n */\nexport function groupMetricsByResourceAndLibrary(metrics) {\n return metrics.reduce(function (metricMap, metric) {\n //group by resource\n var resourceMetrics = metricMap.get(metric.resource);\n if (!resourceMetrics) {\n resourceMetrics = new Map();\n metricMap.set(metric.resource, resourceMetrics);\n }\n //group by instrumentation library\n var libMetrics = resourceMetrics.get(metric.instrumentationLibrary);\n if (!libMetrics) {\n libMetrics = new Array();\n resourceMetrics.set(metric.instrumentationLibrary, libMetrics);\n }\n libMetrics.push(metric);\n return metricMap;\n }, new Map());\n}\n/**\n * Convert to InstrumentationLibraryMetrics\n * @param instrumentationLibrary\n * @param metrics\n * @param startTime\n */\nfunction toCollectorInstrumentationLibraryMetrics(instrumentationLibrary, metrics, startTime) {\n return {\n metrics: metrics.map(function (metric) { return toCollectorMetric(metric, startTime); }),\n instrumentationLibrary: instrumentationLibrary,\n };\n}\n/**\n * Returns a list of resource metrics which will be exported to the collector\n * @param groupedSpans\n * @param baseAttributes\n */\nfunction toCollectorResourceMetrics(groupedMetrics, baseAttributes, startTime) {\n return Array.from(groupedMetrics, function (_a) {\n var resource = _a[0], libMetrics = _a[1];\n return {\n resource: toCollectorResource(resource, baseAttributes),\n instrumentationLibraryMetrics: Array.from(libMetrics, function (_a) {\n var instrumentationLibrary = _a[0], metrics = _a[1];\n return toCollectorInstrumentationLibraryMetrics(instrumentationLibrary, metrics, startTime);\n }),\n };\n });\n}\n//# sourceMappingURL=transformMetrics.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { CollectorExporterBrowserBase } from './CollectorExporterBrowserBase';\nimport { toCollectorExportMetricServiceRequest } from '../../transformMetrics';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nvar DEFAULT_COLLECTOR_URL = 'http://localhost:55681/v1/metrics';\n/**\n * Collector Metric Exporter for Web\n */\nvar CollectorMetricExporter = /** @class */ (function (_super) {\n __extends(CollectorMetricExporter, _super);\n function CollectorMetricExporter(config) {\n if (config === void 0) { config = {}; }\n var _this = _super.call(this, config) || this;\n // Converts time to nanoseconds\n _this._startTime = new Date().getTime() * 1000000;\n _this._headers = Object.assign(_this._headers, baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS));\n return _this;\n }\n CollectorMetricExporter.prototype.convert = function (metrics) {\n return toCollectorExportMetricServiceRequest(metrics, this._startTime, this);\n };\n CollectorMetricExporter.prototype.getDefaultUrl = function (config) {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_ENDPOINT\n : DEFAULT_COLLECTOR_URL;\n };\n return CollectorMetricExporter;\n}(CollectorExporterBrowserBase));\nexport { CollectorMetricExporter };\n//# sourceMappingURL=CollectorMetricExporter.js.map","import {\n ArrayVector,\n DataFrame,\n DataQueryResponse,\n DataSourceInstanceSettings,\n Field,\n FieldType,\n MutableDataFrame,\n TraceKeyValuePair,\n TraceLog,\n TraceSpanRow,\n} from '@grafana/data';\nimport { SpanKind, SpanStatus, SpanStatusCode } from '@opentelemetry/api';\nimport { collectorTypes } from '@opentelemetry/exporter-collector';\nimport { ResourceAttributes } from '@opentelemetry/semantic-conventions';\nimport { createGraphFrames } from './graphTransform';\n\nexport function createTableFrame(\n logsFrame: DataFrame,\n datasourceUid: string,\n datasourceName: string,\n traceRegexs: string[]\n): DataFrame {\n const tableFrame = new MutableDataFrame({\n fields: [\n {\n name: 'Time',\n type: FieldType.time,\n config: {\n custom: {\n width: 150,\n },\n },\n },\n {\n name: 'traceID',\n type: FieldType.string,\n config: {\n displayNameFromDS: 'Trace ID',\n custom: { width: 300 },\n links: [\n {\n title: 'Click to open trace ${__value.raw}',\n url: '',\n internal: {\n datasourceUid,\n datasourceName,\n query: {\n query: '${__value.raw}',\n },\n },\n },\n ],\n },\n },\n {\n name: 'Message',\n type: FieldType.string,\n },\n ],\n meta: {\n preferredVisualisationType: 'table',\n },\n });\n\n if (!logsFrame || traceRegexs.length === 0) {\n return tableFrame;\n }\n\n const timeField = logsFrame.fields.find((f) => f.type === FieldType.time);\n\n // Going through all string fields to look for trace IDs\n for (let field of logsFrame.fields) {\n let hasMatch = false;\n if (field.type === FieldType.string) {\n const values = field.values.toArray();\n for (let i = 0; i < values.length; i++) {\n const line = values[i];\n if (line) {\n for (let traceRegex of traceRegexs) {\n const match = (line as string).match(traceRegex);\n if (match) {\n const traceId = match[1];\n const time = timeField ? timeField.values.get(i) : null;\n tableFrame.fields[0].values.add(time);\n tableFrame.fields[1].values.add(traceId);\n tableFrame.fields[2].values.add(line);\n hasMatch = true;\n }\n }\n }\n }\n }\n if (hasMatch) {\n break;\n }\n }\n\n return tableFrame;\n}\n\nexport function transformTraceList(\n response: DataQueryResponse,\n datasourceId: string,\n datasourceName: string,\n traceRegexs: string[]\n): DataQueryResponse {\n response.data.forEach((data, index) => {\n const frame = createTableFrame(data, datasourceId, datasourceName, traceRegexs);\n response.data[index] = frame;\n });\n return response;\n}\n\n// Don't forget to change the backend code when the id representation changed\nfunction transformBase64IDToHexString(base64: string) {\n const buffer = Buffer.from(base64, 'base64');\n const id = buffer.toString('hex');\n return id.length > 16 ? id.slice(16) : id;\n}\n\nfunction transformHexStringToBase64ID(hex: string) {\n const buffer = Buffer.from(hex, 'hex');\n const id = buffer.toString('base64');\n return id;\n}\n\nfunction getAttributeValue(value: collectorTypes.opentelemetryProto.common.v1.AnyValue): any {\n if (value.stringValue) {\n return value.stringValue;\n }\n\n if (value.boolValue !== undefined) {\n return Boolean(value.boolValue);\n }\n\n if (value.intValue !== undefined) {\n return Number.parseInt(value.intValue as any, 10);\n }\n\n if (value.doubleValue) {\n return Number.parseFloat(value.doubleValue as any);\n }\n\n if (value.arrayValue) {\n const arrayValue = [];\n for (const arValue of value.arrayValue.values) {\n arrayValue.push(getAttributeValue(arValue));\n }\n return arrayValue;\n }\n\n return '';\n}\n\nfunction resourceToProcess(resource: collectorTypes.opentelemetryProto.resource.v1.Resource | undefined) {\n const serviceTags: TraceKeyValuePair[] = [];\n let serviceName = 'OTLPResourceNoServiceName';\n if (!resource) {\n return { serviceName, serviceTags };\n }\n\n for (const attribute of resource.attributes) {\n if (attribute.key === ResourceAttributes.SERVICE_NAME) {\n serviceName = attribute.value.stringValue || serviceName;\n }\n serviceTags.push({ key: attribute.key, value: getAttributeValue(attribute.value) });\n }\n\n return { serviceName, serviceTags };\n}\n\nfunction getSpanTags(\n span: collectorTypes.opentelemetryProto.trace.v1.Span,\n instrumentationLibrary?: collectorTypes.opentelemetryProto.common.v1.InstrumentationLibrary\n): TraceKeyValuePair[] {\n const spanTags: TraceKeyValuePair[] = [];\n\n if (instrumentationLibrary) {\n if (instrumentationLibrary.name) {\n spanTags.push({ key: 'otel.library.name', value: instrumentationLibrary.name });\n }\n if (instrumentationLibrary.version) {\n spanTags.push({ key: 'otel.library.version', value: instrumentationLibrary.version });\n }\n }\n\n if (span.attributes) {\n for (const attribute of span.attributes) {\n spanTags.push({ key: attribute.key, value: getAttributeValue(attribute.value) });\n }\n }\n\n if (span.status) {\n if (span.status.code && (span.status.code as any) !== SpanStatusCode.UNSET) {\n spanTags.push({\n key: 'otel.status_code',\n value: SpanStatusCode[span.status.code],\n });\n if (span.status.message) {\n spanTags.push({ key: 'otel.status_description', value: span.status.message });\n }\n }\n if (span.status.code === SpanStatusCode.ERROR) {\n spanTags.push({ key: 'error', value: true });\n }\n }\n\n if (\n span.kind !== undefined &&\n span.kind !== collectorTypes.opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL\n ) {\n spanTags.push({\n key: 'span.kind',\n value: SpanKind[collectorTypes.opentelemetryProto.trace.v1.Span.SpanKind[span.kind] as any].toLowerCase(),\n });\n }\n\n return spanTags;\n}\n\nfunction getLogs(span: collectorTypes.opentelemetryProto.trace.v1.Span) {\n const logs: TraceLog[] = [];\n if (span.events) {\n for (const event of span.events) {\n const fields: TraceKeyValuePair[] = [];\n if (event.attributes) {\n for (const attribute of event.attributes) {\n fields.push({ key: attribute.key, value: getAttributeValue(attribute.value) });\n }\n }\n logs.push({ fields, timestamp: event.timeUnixNano / 1000000 });\n }\n }\n\n return logs;\n}\n\nexport function transformFromOTLP(\n traceData: collectorTypes.opentelemetryProto.trace.v1.ResourceSpans[],\n nodeGraph = false\n): DataQueryResponse {\n const frame = new MutableDataFrame({\n fields: [\n { name: 'traceID', type: FieldType.string },\n { name: 'spanID', type: FieldType.string },\n { name: 'parentSpanID', type: FieldType.string },\n { name: 'operationName', type: FieldType.string },\n { name: 'serviceName', type: FieldType.string },\n { name: 'serviceTags', type: FieldType.other },\n { name: 'startTime', type: FieldType.number },\n { name: 'duration', type: FieldType.number },\n { name: 'logs', type: FieldType.other },\n { name: 'tags', type: FieldType.other },\n ],\n meta: {\n preferredVisualisationType: 'trace',\n custom: {\n traceFormat: 'otlp',\n },\n },\n });\n try {\n for (const data of traceData) {\n const { serviceName, serviceTags } = resourceToProcess(data.resource);\n for (const librarySpan of data.instrumentationLibrarySpans) {\n for (const span of librarySpan.spans) {\n frame.add({\n traceID: transformBase64IDToHexString(span.traceId),\n spanID: transformBase64IDToHexString(span.spanId),\n parentSpanID: transformBase64IDToHexString(span.parentSpanId || ''),\n operationName: span.name || '',\n serviceName,\n serviceTags,\n startTime: span.startTimeUnixNano! / 1000000,\n duration: (span.endTimeUnixNano! - span.startTimeUnixNano!) / 1000000,\n tags: getSpanTags(span, librarySpan.instrumentationLibrary),\n logs: getLogs(span),\n } as TraceSpanRow);\n }\n }\n }\n } catch (error) {\n return { error: { message: 'JSON is not valid OpenTelemetry format' }, data: [] };\n }\n\n let data = [frame];\n if (nodeGraph) {\n data.push(...(createGraphFrames(frame) as MutableDataFrame[]));\n }\n\n return { data };\n}\n\n/**\n * Transforms trace dataframes to the OpenTelemetry format\n */\nexport function transformToOTLP(\n data: MutableDataFrame\n): { batches: collectorTypes.opentelemetryProto.trace.v1.ResourceSpans[] } {\n let result: { batches: collectorTypes.opentelemetryProto.trace.v1.ResourceSpans[] } = {\n batches: [],\n };\n\n // Lookup object to see which batch contains spans for which services\n let services: { [key: string]: number } = {};\n\n for (let i = 0; i < data.length; i++) {\n const span = data.get(i);\n\n // Group spans based on service\n if (!services[span.serviceName]) {\n services[span.serviceName] = result.batches.length;\n result.batches.push({\n resource: {\n attributes: [],\n droppedAttributesCount: 0,\n },\n instrumentationLibrarySpans: [\n {\n spans: [],\n },\n ],\n });\n }\n\n let batchIndex = services[span.serviceName];\n\n // Populate resource attributes from service tags\n if (result.batches[batchIndex].resource!.attributes.length === 0) {\n result.batches[batchIndex].resource!.attributes = tagsToAttributes(span.serviceTags);\n }\n\n // Populate instrumentation library if it exists\n if (!result.batches[batchIndex].instrumentationLibrarySpans[0].instrumentationLibrary) {\n let libraryName = span.tags.find((t: TraceKeyValuePair) => t.key === 'otel.library.name')?.value;\n if (libraryName) {\n result.batches[batchIndex].instrumentationLibrarySpans[0].instrumentationLibrary = {\n name: libraryName,\n version: span.tags.find((t: TraceKeyValuePair) => t.key === 'otel.library.version')?.value,\n };\n }\n }\n\n result.batches[batchIndex].instrumentationLibrarySpans[0].spans.push({\n traceId: transformHexStringToBase64ID(span.traceID.padStart(32, '0')),\n spanId: transformHexStringToBase64ID(span.spanID),\n traceState: '',\n parentSpanId: transformHexStringToBase64ID(span.parentSpanID || ''),\n name: span.operationName,\n kind: getOTLPSpanKind(span.tags) as any,\n startTimeUnixNano: span.startTime * 1000000,\n endTimeUnixNano: (span.startTime + span.duration) * 1000000,\n attributes: tagsToAttributes(span.tags),\n droppedAttributesCount: 0,\n droppedEventsCount: 0,\n droppedLinksCount: 0,\n status: getOTLPStatus(span.tags),\n events: getOTLPEvents(span.logs),\n });\n }\n\n return result;\n}\n\nfunction getOTLPSpanKind(tags: TraceKeyValuePair[]): string | undefined {\n let spanKind = undefined;\n const spanKindTagValue = tags.find((t) => t.key === 'span.kind')?.value;\n switch (spanKindTagValue) {\n case 'server':\n spanKind = 'SPAN_KIND_SERVER';\n break;\n case 'client':\n spanKind = 'SPAN_KIND_CLIENT';\n break;\n case 'producer':\n spanKind = 'SPAN_KIND_PRODUCER';\n break;\n case 'consumer':\n spanKind = 'SPAN_KIND_CONSUMER';\n break;\n }\n\n return spanKind;\n}\n\n/**\n * Converts key-value tags to OTLP attributes and removes tags added by Grafana\n */\nfunction tagsToAttributes(tags: TraceKeyValuePair[]): collectorTypes.opentelemetryProto.common.v1.KeyValue[] {\n return tags\n .filter(\n (t) =>\n ![\n 'span.kind',\n 'otel.library.name',\n 'otel.libary.version',\n 'otel.status_description',\n 'otel.status_code',\n ].includes(t.key)\n )\n .reduce<collectorTypes.opentelemetryProto.common.v1.KeyValue[]>(\n (attributes, tag) => [...attributes, { key: tag.key, value: toAttributeValue(tag) }],\n []\n );\n}\n\n/**\n * Returns the correct OTLP AnyValue based on the value of the tag value\n */\nfunction toAttributeValue(tag: TraceKeyValuePair): collectorTypes.opentelemetryProto.common.v1.AnyValue {\n if (typeof tag.value === 'string') {\n return { stringValue: tag.value };\n } else if (typeof tag.value === 'boolean') {\n return { boolValue: tag.value };\n } else if (typeof tag.value === 'number') {\n if (tag.value % 1 === 0) {\n return { intValue: tag.value };\n } else {\n return { doubleValue: tag.value };\n }\n } else if (typeof tag.value === 'object') {\n if (Array.isArray(tag.value)) {\n const values: collectorTypes.opentelemetryProto.common.v1.AnyValue[] = [];\n for (const val of tag.value) {\n values.push(toAttributeValue(val));\n }\n\n return { arrayValue: { values } };\n }\n }\n return { stringValue: tag.value };\n}\n\nfunction getOTLPStatus(tags: TraceKeyValuePair[]): SpanStatus | undefined {\n let status = undefined;\n const statusCodeTag = tags.find((t) => t.key === 'otel.status_code');\n if (statusCodeTag) {\n status = {\n code: statusCodeTag.value,\n message: tags.find((t) => t.key === 'otel_status_description')?.value,\n };\n }\n\n return status;\n}\n\nfunction getOTLPEvents(logs: TraceLog[]): collectorTypes.opentelemetryProto.trace.v1.Span.Event[] | undefined {\n if (!logs || !logs.length) {\n return undefined;\n }\n\n let events: collectorTypes.opentelemetryProto.trace.v1.Span.Event[] = [];\n for (const log of logs) {\n let event: collectorTypes.opentelemetryProto.trace.v1.Span.Event = {\n timeUnixNano: log.timestamp * 1000000,\n attributes: [],\n droppedAttributesCount: 0,\n name: '',\n };\n for (const field of log.fields) {\n event.attributes!.push({\n key: field.key,\n value: toAttributeValue(field),\n });\n }\n events.push(event);\n }\n return events;\n}\n\nexport function transformTrace(response: DataQueryResponse, nodeGraph = false): DataQueryResponse {\n // We need to parse some of the fields which contain stringified json.\n // Seems like we can't just map the values as the frame we got from backend has some default processing\n // and will stringify the json back when we try to set it. So we create a new field and swap it instead.\n const frame: DataFrame = response.data[0];\n\n if (!frame) {\n return emptyDataQueryResponse;\n }\n\n parseJsonFields(frame);\n\n let data = [...response.data];\n if (nodeGraph) {\n data.push(...createGraphFrames(frame));\n }\n\n return {\n ...response,\n data,\n };\n}\n\n/**\n * Change fields which are json string into JS objects. Modifies the frame in place.\n */\nfunction parseJsonFields(frame: DataFrame) {\n for (const fieldName of ['serviceTags', 'logs', 'tags']) {\n const field = frame.fields.find((f) => f.name === fieldName);\n if (field) {\n const fieldIndex = frame.fields.indexOf(field);\n const values = new ArrayVector();\n const newField: Field = {\n ...field,\n values,\n type: FieldType.other,\n };\n\n for (let i = 0; i < field.values.length; i++) {\n const value = field.values.get(i);\n values.set(i, value === '' ? undefined : JSON.parse(value));\n }\n frame.fields[fieldIndex] = newField;\n }\n }\n}\n\ntype SearchResponse = {\n traceID: string;\n rootServiceName: string;\n rootTraceName: string;\n startTimeUnixNano: string;\n durationMs: number;\n};\n\nexport function createTableFrameFromSearch(data: SearchResponse[], instanceSettings: DataSourceInstanceSettings) {\n const frame = new MutableDataFrame({\n fields: [\n {\n name: 'traceID',\n type: FieldType.string,\n config: {\n displayNameFromDS: 'Trace ID',\n links: [\n {\n title: 'Trace: ${__value.raw}',\n url: '',\n internal: {\n datasourceUid: instanceSettings.uid,\n datasourceName: instanceSettings.name,\n query: {\n query: '${__value.raw}',\n queryType: 'traceId',\n },\n },\n },\n ],\n },\n },\n { name: 'traceName', type: FieldType.string, config: { displayNameFromDS: 'Trace name' } },\n { name: 'startTime', type: FieldType.time, config: { displayNameFromDS: 'Start time' } },\n { name: 'duration', type: FieldType.number, config: { displayNameFromDS: 'Duration', unit: 'ms' } },\n ],\n meta: {\n preferredVisualisationType: 'table',\n },\n });\n if (!data?.length) {\n return frame;\n }\n // Show the most recent traces\n const traceData = data.map(transformToTraceData).sort((a, b) => b?.startTime! - a?.startTime!);\n\n for (const trace of traceData) {\n frame.add(trace);\n }\n\n return frame;\n}\n\nfunction transformToTraceData(data: SearchResponse) {\n let traceName = '';\n if (data.rootServiceName) {\n traceName += data.rootServiceName + ' ';\n }\n if (data.rootTraceName) {\n traceName += data.rootTraceName;\n }\n return {\n traceID: data.traceID,\n startTime: parseInt(data.startTimeUnixNano, 10) / 1000 / 1000,\n duration: data.durationMs,\n traceName,\n };\n}\n\nconst emptyDataQueryResponse = {\n data: [\n new MutableDataFrame({\n fields: [\n {\n name: 'trace',\n type: FieldType.trace,\n values: [],\n },\n ],\n meta: {\n preferredVisualisationType: 'trace',\n custom: {\n traceFormat: 'otlp',\n },\n },\n }),\n ],\n};\n","/**\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n"],"names":["getNonOverlappingDuration","ranges","sort","a","b","reduce","acc","range","length","tail","slice","prevStart","prevEnd","start","end","makeSpanMap","getSpan","spanMap","span","index","id","children","parentId","parentIds","push","undefined","getStats","duration","traceDuration","selfDuration","main","toFixedNoTrailingZeros","secondary","n","parseFloat","toFixed","makeFrames","MutableDataFrame","fields","name","Fields","type","FieldType","config","displayName","color","mode","meta","preferredVisualisationType","createGraphFrames","data","nodes","edges","view","DataFrameView","traceEndTime","traceStartTime","Infinity","i","row","get","startTime","findTraceDuration","spanID","parentSpanID","map","c","childrenDuration","stats","serviceName","operationName","convertTraceToGraph","nodesFrame","edgesFrame","node","add","edge","secondsMetric","totalsMetric","serviceMapMetrics","mapPromMetricsToServiceMap","responses","totalsDFView","secondsDFView","responsesMap","groupBy","r","refId","getMetricFrames","nodesMap","edgesMap","collectMetricData","rangeMs","to","valueOf","from","createDF","unit","createServiceMapDataFrames","nodeId","Object","keys","title","mainStat","total","seconds","Number","NaN","secondaryStat","edgeId","source","target","convertToDataFrames","frame","stat","metric","valueName","client","server","BaggageImpl","entries","this","_entries","Map","prototype","getEntry","key","entry","assign","getAllEntries","Array","_a","setEntry","newBaggage","set","removeEntry","delete","removeEntries","_i","arguments","keys_1","clear","baggageEntryMetadataSymbol","Symbol","createBaggage","DiagLogLevel","defaultTextMapGetter","carrier","defaultTextMapSetter","value","createContextKey","description","for","TraceFlags","ROOT_CONTEXT","BaseContext","parentContext","self","_currentContext","getValue","setValue","context","deleteValue","VALID_TRACEID_REGEX","VALID_SPANID_REGEX","INVALID_SPANID","INVALID_TRACEID","INVALID_SPAN_CONTEXT","traceId","spanId","traceFlags","NONE","isValidTraceId","test","isSpanContextValid","spanContext","wrapSpanContext","NonRecordingSpan","_spanContext","setAttribute","_key","_value","setAttributes","_attributes","addEvent","_name","setStatus","_status","updateName","_endTime","isRecording","recordException","_exception","_time","SPAN_KEY","setSpan","deleteSpan","setSpanContext","getSpanContext","NoopTracer","startSpan","options","Boolean","root","parentFromContext","startActiveSpan","arg2","arg3","arg4","opts","ctx","fn","active","contextWithSpanSet","with","SamplingDecision","SpanKind","SpanStatusCode","NOOP_TRACER","ProxyTracer","_provider","version","_getTracer","_options","_context","_fn","tracer","Reflect","apply","_delegate","getDelegateTracer","NOOP_TRACER_PROVIDER","NoopTracerProvider","getTracer","_version","ProxyTracerProvider","getDelegate","setDelegate","delegate","__spreadArray","il","j","NoopContextManager","thisArg","args","call","bind","enable","disable","_globalThis","globalThis","window","VERSION","re","isCompatible","ownVersion","acceptedVersions","Set","rejectedVersions","myVersionMatch","match","ownVersionParsed","globalVersion","_reject","v","_accept","has","globalVersionMatch","globalVersionParsed","_makeCompatibilityCheck","major","split","GLOBAL_OPENTELEMETRY_API_KEY","_global","registerGlobal","instance","diag","allowOverride","api","err","Error","error","stack","message","debug","getGlobal","_b","unregisterGlobal","DiagComponentLogger","props","_namespace","namespace","logProxy","info","warn","verbose","funcName","logger","unshift","DiagAPI","_logProxy","setLogger","logLevel","INFO","oldLogger","newLogger","maxLevel","_filterFunc","theLevel","theFunc","ALL","ERROR","WARN","DEBUG","VERBOSE","createLogLevelDiagLogger","createComponentLogger","_instance","NOOP_CONTEXT_MANAGER","ContextAPI","getInstance","setGlobalContextManager","contextManager","_getContextManager","TraceAPI","_proxyTracerProvider","setGlobalTracerProvider","provider","success","getTracerProvider","NoopTextMapPropagator","inject","_carrier","extract","BAGGAGE_KEY","getBaggage","setBaggage","baggage","deleteBaggage","NOOP_TEXT_MAP_PROPAGATOR","PropagationAPI","setGlobalPropagator","propagator","setter","_getGlobalPropagator","getter","trace","propagation","SUPPRESS_TRACING_KEY","isTracingSuppressed","BAGGAGE_HEADER","parsePairKeyValue","valueProps","keyPairPart","shift","keyPair","metadata","str","decodeURIComponent","trim","join","__TYPE__","toString","parseKeyPairsIntoRecord","filter","headers","HttpBaggagePropagator","headerValue","keyPairs","hValue","current","serializeKeyPairs","encodeURIComponent","getKeyPairs","pair","forEach","baggageEntry","delegateHandler","ex","JSON","stringify","result","getOwnPropertyNames","propertyName","String","getPrototypeOf","flattenException","stringifyException","TracesSamplerValues","globalErrorHandler","ENVIRONMENT_NUMBERS_KEYS","isEnvVarANumber","indexOf","ENVIRONMENT_LISTS_KEYS","isEnvVarAList","DEFAULT_ENVIRONMENT","CONTAINER_NAME","ECS_CONTAINER_METADATA_URI_V4","ECS_CONTAINER_METADATA_URI","HOSTNAME","KUBERNETES_SERVICE_HOST","NAMESPACE","OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_EXPORTER_JAEGER_AGENT_HOST","OTEL_EXPORTER_JAEGER_ENDPOINT","OTEL_EXPORTER_JAEGER_PASSWORD","OTEL_EXPORTER_JAEGER_USER","OTEL_EXPORTER_OTLP_ENDPOINT","OTEL_EXPORTER_OTLP_TRACES_ENDPOINT","OTEL_EXPORTER_OTLP_METRICS_ENDPOINT","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_ZIPKIN_ENDPOINT","OTEL_LOG_LEVEL","OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_TRACES_EXPORTER","OTEL_TRACES_SAMPLER","ParentBasedAlwaysOn","OTEL_TRACES_SAMPLER_ARG","parseNumber","environment","values","min","max","isNaN","parseStringList","output","input","separator","givenValue","logLevelMap","setLogLevelFromEnv","toUpperCase","getEnv","globalEnv","env","parseEnvironment","hexToBase64","hexStr","hexStrLen","hexAsciiCharsStr","hexPair","substring","hexVal","parseInt","fromCharCode","btoa","DbSystemValues","DbCassandraConsistencyLevelValues","FaasTriggerValues","FaasDocumentOperationValues","FaasInvokedProviderValues","NetTransportValues","HttpFlavorValues","MessagingDestinationKindValues","MessagingOperationValues","RpcGrpcStatusCodeValues","otperformance","performance","CloudProviderValues","CloudPlatformValues","AwsEcsLaunchtypeValues","HostArchValues","OsTypeValues","TelemetrySdkLanguageValues","ResourceAttributes","SDK_INFO","WEBJS","ExportResultCode","SECOND_TO_NANOSECONDS","Math","pow","numberToHrtime","epochMillis","epochSeconds","trunc","getTimeOrigin","timeOrigin","perf","timing","fetchStart","hrTime","performanceNow","now","nanos","hrTimeToNanoseconds","CompositePropagator","_propagators","propagators","_fields","p","x","y","concat","constructor","VALID_KEY_REGEX","RegExp","VALID_VALUE_BASE_REGEX","INVALID_VALUE_COMMA_EQUAL_REGEX","TraceState","rawTraceState","_internalState","_parse","traceState","_clone","unset","serialize","_this","_keys","agg","reverse","part","listMember","validateKey","validateValue","size","TRACE_PARENT_HEADER","TRACE_STATE_HEADER","TRACE_PARENT_REGEX","RPCType","HttpTraceContextPropagator","traceParent","traceParentHeader","isArray","exec","parseTraceParent","isRemote","traceStateHeader","state","AlwaysOffSampler","shouldSample","decision","NOT_RECORD","AlwaysOnSampler","RECORD_AND_SAMPLED","CollectorExporterBase","ParentBasedSampler","_c","_d","_root","_remoteParentSampled","remoteParentSampled","_remoteParentNotSampled","remoteParentNotSampled","_localParentSampled","localParentSampled","_localParentNotSampled","localParentNotSampled","spanName","spanKind","attributes","links","SAMPLED","TraceIdRatioBasedSampler","_ratio","_normalize","_upperBound","floor","_accumulate","ratio","accumulation","pos","_isShutdown","_shuttingDownPromise","Promise","resolve","_sendingPromises","url","getDefaultUrl","hostname","shutdown","_concurrencyLimit","concurrencyLimit","onInit","export","items","resultCallback","code","FAILED","_export","then","SUCCESS","catch","reject","send","e","onShutdown","all","extendStatics","opentelemetryProto","__extends","d","setPrototypeOf","__proto__","hasOwnProperty","TypeError","__","create","metrics","v1","AggregationTemporality","ConstantSampler","ConstantDecision","Span","common","ValueType","CollectorExporterError","_super","COLLECTOR_SPAN_KIND_MAPPING","INTERNAL","SPAN_KIND_INTERNAL","SERVER","SPAN_KIND_SERVER","CLIENT","SPAN_KIND_CLIENT","PRODUCER","SPAN_KIND_PRODUCER","CONSUMER","SPAN_KIND_CONSUMER","CollectorExporterBrowserBase","_useXHR","navigator","sendBeacon","_headers","partialHeaders","parseHeaders","addEventListener","removeEventListener","onSuccess","onError","serviceRequest","convert","body","promise","_onSuccess","_onFinish","_onError","splice","xhr","XMLHttpRequest","open","setRequestHeader","k","onreadystatechange","readyState","DONE","status","sendWithXhr","sendWithBeacon","toCollectorAttributes","anyValue","toCollectorAnyValue","toCollectorAttributeKeyValue","stringValue","boolValue","isInteger","intValue","doubleValue","arrayValue","kvlistValue","toCollectorLinks","useHex","link","droppedAttributesCount","toCollectorStatus","spanStatus","toCollectorResource","resource","additionalAttributes","toCollectorTraceState","toCollectorExportTraceServiceRequest","spans","collectorTraceExporterBase","resourceSpans","toCollectorResourceSpans","libSpans","instrumentationLibrary","groupSpansByResourceAndLibrary","toCollectorInstrumentationLibrarySpans","parentSpanId","kind","collectorKind","SPAN_KIND_UNSPECIFIED","startTimeUnixNano","endTimeUnixNano","endTime","events","timedEvents","timedEvent","timeUnixNano","time","droppedEventsCount","droppedLinksCount","toCollectorSpan","groupedSpans","baseAttributes","instrumentationLibrarySpans","CollectorTraceExporter","NoopMeter","createValueRecorder","NOOP_VALUE_RECORDER_METRIC","createCounter","NOOP_COUNTER_METRIC","createUpDownCounter","createValueObserver","_callback","NOOP_VALUE_OBSERVER_METRIC","createSumObserver","NOOP_SUM_OBSERVER_METRIC","createUpDownSumObserver","NOOP_UP_DOWN_SUM_OBSERVER_METRIC","createBatchObserver","NOOP_BATCH_OBSERVER","NoopMetric","instrument","_instrument","_labels","unbind","NoopCounterMetric","labels","NoopValueRecorderMetric","record","NoopBaseObserverMetric","observation","observer","NoopBatchObserver","NoopBoundCounter","NoopBoundValueRecorder","_baggage","NoopBoundBaseObserver","update","NOOP_METER","NOOP_BOUND_BASE_OBSERVER","NOOP_METER_PROVIDER","NoopMeterProvider","getMeter","GLOBAL_METRICS_API_KEY","MetricsAPI","setGlobalMeterProvider","getMeterProvider","requiredVersion","fallback","MetricKind","BaseBoundInstrument","_disabled","_valueType","_aggregator","getLabels","getAggregator","BoundCounter","disabled","valueType","aggregator","BoundUpDownCounter","BoundValueRecorder","BoundObserver","AggregatorKind","hashLabels","__assign","t","s","Metric","_kind","_instruments","_boundaries","boundaries","_descriptor","_getMetricDescriptor","_aggregationTemporality","aggregationTemporality","hash","_makeInstrument","getKind","getAggregationTemporality","getMetricRecord","descriptor","metricKind","CounterMetric","_processor","COUNTER","aggregatorFor","ValueRecorderMetric","VALUE_RECORDER","Resource","empty","EMPTY","default","merge","other","BatchObserverResult","cancelled","onObserveCalled","callback","observe","observations","_immediate","setImmediate","NOOP_CALLBACK","BatchObserver","_maxTimeoutUpdateMS","maxTimeoutUpdateMS","collect","observerResult","timer","setTimeout","clearTimeout","_arguments","P","generator","fulfilled","step","next","rejected","done","f","g","_","label","sent","trys","ops","verb","iterator","op","pop","PushController","_meter","_exporter","interval","_timer","setInterval","_collect","clearInterval","getProcessor","checkPointSet","NoopExporter","_metrics","_resultCallback","HistogramAggregator","HISTOGRAM","_current","_newEmptyCheckpoint","_lastUpdateTime","count","sum","buckets","counts","toPoint","timestamp","LastValueAggregator","LAST_VALUE","SumAggregator","SUM","UngroupedProcessor","metricDescriptor","UP_DOWN_COUNTER","SUM_OBSERVER","UP_DOWN_SUM_OBSERVER","VALUE_OBSERVER","process","_batchMap","Processor","ObserverResult","BaseObserverMetric","_processResults","SumObserverMetric","processor","previous","previousValue","DEFAULT_CONFIG","DEFAULT_METRIC_OPTIONS","UpDownCounterMetric","UpDownSumObserverMetric","ValueObserverMetric","Meter","_batchObservers","mergedConfig","_resource","_instrumentationLibrary","exporter","_controller","_isValidName","opt","valueRecorder","_registerMetric","counter","upDownCounter","valueObserver","sumObserver","upDownSumObserver","batchObserver","metricsRecords","records","MeterProvider","_meters","_config","ConsoleMetricExporter","metrics_1","console","log","point","histogram","toCollectorLabels","toAggregationTemporality","toDataPoint","toHistogramPoint","bucketCounts","explicitBounds","toCollectorExportMetricServiceRequest","collectorExporterBase","resourceMetrics","toCollectorResourceMetrics","metricMap","libMetrics","groupMetricsByResourceAndLibrary","toCollectorInstrumentationLibraryMetrics","metricCollector","dataPoints","isMonotonic","INT","intSum","doubleSum","intGauge","doubleGauge","intHistogram","doubleHistogram","toCollectorMetric","groupedMetrics","instrumentationLibraryMetrics","CollectorMetricExporter","_startTime","Date","getTime","transformTraceList","response","datasourceId","datasourceName","traceRegexs","logsFrame","datasourceUid","tableFrame","custom","width","displayNameFromDS","internal","query","timeField","find","field","hasMatch","toArray","line","traceRegex","createTableFrame","transformBase64IDToHexString","base64","Buffer","transformHexStringToBase64ID","hex","getAttributeValue","arValue","resourceToProcess","serviceTags","attribute","getSpanTags","spanTags","UNSET","collectorTypes","toLowerCase","getLogs","logs","event","transformFromOTLP","traceData","nodeGraph","traceFormat","librarySpan","traceID","tags","transformToOTLP","batches","services","batchIndex","tagsToAttributes","libraryName","padStart","getOTLPSpanKind","getOTLPStatus","getOTLPEvents","includes","tag","toAttributeValue","val","statusCodeTag","transformTrace","emptyDataQueryResponse","fieldName","fieldIndex","ArrayVector","newField","parse","parseJsonFields","createTableFrameFromSearch","instanceSettings","uid","queryType","transformToTraceData","traceName","rootServiceName","rootTraceName","durationMs","HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","funcTag","objectTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","freeSelf","Function","freeExports","exports","nodeType","freeModule","module","moduleExports","freeProcess","nodeUtil","types","require","binding","nodeIsTypedArray","isTypedArray","func","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","IE_PROTO","nativeObjectToString","objectCtorString","reIsNative","replace","Uint8Array","allocUnsafe","getPrototype","arg","objectCreate","propertyIsEnumerable","symToStringTag","toStringTag","defineProperty","getNative","nativeIsBuffer","isBuffer","nativeMax","nativeNow","nativeCreate","baseCreate","object","proto","isObject","Hash","ListCache","MapCache","Stack","__data__","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","iteratee","baseTimes","isIndex","assignMergeValue","eq","baseAssignValue","assignValue","objValue","assocIndexOf","array","getMapData","pairs","LARGE_ARRAY_SIZE","fromRight","baseFor","keysFunc","iterable","baseGetTag","isOwn","unmasked","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsNative","isMasked","isFunction","toSource","baseKeysIn","nativeKeysIn","isProto","isPrototype","baseMerge","srcIndex","customizer","srcValue","mergeFunc","safeGet","stacked","newValue","isCommon","isTyped","isArrayLike","copyArray","buffer","isDeep","copy","cloneBuffer","typedArray","arrayBuffer","byteLength","byteOffset","Ctor","isPlainObject","isNew","copyObject","keysIn","toPlainObject","initCloneObject","baseMergeDeep","baseRest","setToString","otherArgs","overRest","identity","lastCalled","stamp","remaining","shortOut","string","isLength","baseUnary","assigner","sources","guard","isIterateeCall"],"sourceRoot":""}