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Msa,EAAUjB,GACvBI,EAAOd,eAAe,eAAgBuB,EAAQF,GAKvD,IAFAE,GAAS,EAAAO,EAAA,GAAmBV,EAAWD,IAE1B,GAAI,CACf,IAAIY,EAAe3a,KAAKC,MAAMsa,EAAUjB,GACxC,OAAOI,EAAOd,eAAe,UAAW+B,EAAcV,GAEtD,IAAIW,EAAyBT,EAAS,GAClCU,EAAQ7a,KAAK8a,MAAMX,EAAS,IAEhC,OAAIS,EAAyB,EACpBlB,EAAOd,eAAe,cAAeiC,EAAOZ,GAC1CW,EAAyB,EAC3BlB,EAAOd,eAAe,aAAciC,EAAOZ,GAE3CP,EAAOd,eAAe,eAAgBiC,EAAQ,EAAGZ","sources":["webpack://grafana/./public/app/core/utils/tracing.ts","webpack://grafana/./public/app/plugins/datasource/tempo/graphTransform.ts","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/version.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/internal/semver.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/diag/types.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/api/diag.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/baggage/utils.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/context/context.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/api/context.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/status.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/api/trace.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/api/propagation.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-api-npm-1.1.0-7f8c5a33ef-8be8e8dd20.zip/node_modules/@opentelemetry/api/build/esm/index.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-semantic-conventions-npm-1.2.0-0bb5c75af0-ba8ebaaeca.zip/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js","webpack://grafana/../../opt/drone/yarncache/@opentelemetry-semantic-conventions-npm-1.2.0-0bb5c75af0-ba8ebaaeca.zip/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js","webpack://grafana/./public/app/plugins/datasource/tempo/resultTransformer.ts","webpack://grafana/../../opt/drone/yarncache/date-fns-npm-2.28.0-c19c5add1b-a0516b2e4f.zip/node_modules/date-fns/esm/_lib/cloneObject/index.js","webpack://grafana/../../opt/drone/yarncache/date-fns-npm-2.28.0-c19c5add1b-a0516b2e4f.zip/node_modules/date-fns/esm/_lib/assign/index.js","webpack://grafana/../../opt/drone/yarncache/date-fns-npm-2.28.0-c19c5add1b-a0516b2e4f.zip/node_modules/date-fns/esm/formatDistance/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>(getSpan: (index: number) => { span: T; id: string; parentIds: string[] } | undefined): {\n [id: string]: { span: T; children: string[] };\n} {\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 {\n DataFrame,\n DataFrameView,\n DataQueryResponse,\n FieldColorModeId,\n FieldDTO,\n MutableDataFrame,\n NodeGraphDataFrameFieldNames as Fields,\n TimeRange,\n} from '@grafana/data';\n\nimport { getNonOverlappingDuration, getStats, makeFrames, makeSpanMap } from '../../../core/utils/tracing';\n\n/**\n * Row in a trace dataFrame\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\nexport const secondsMetric = 'traces_service_graph_request_server_seconds_sum';\nexport const totalsMetric = 'traces_service_graph_request_total';\nexport const failedMetric = 'traces_service_graph_request_failed_total';\nexport const histogramMetric = 'traces_service_graph_request_server_seconds_bucket';\n\nexport const serviceMapMetrics = [\n secondsMetric,\n totalsMetric,\n failedMetric,\n histogramMetric,\n // These are used for debugging the tempo collection so probably not useful for service map right now.\n // 'traces_service_graph_unpaired_spans_total',\n // 'traces_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(\n responses: DataQueryResponse[],\n range: TimeRange\n): { nodes: DataFrame; edges: DataFrame } {\n const frames = 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, ServiceMapStatistics> = {};\n const edgesMap: Record<string, EdgeObject> = {};\n // At this moment we don't have any error/success or other counts so we just use these 2\n collectMetricData(frames[totalsMetric], 'total', totalsMetric, nodesMap, edgesMap);\n collectMetricData(frames[secondsMetric], 'seconds', secondsMetric, nodesMap, edgesMap);\n collectMetricData(frames[failedMetric], 'failed', failedMetric, 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, config: { displayName: 'Service name' } },\n { name: Fields.mainStat, config: { unit: 'ms/r', displayName: 'Average response time' } },\n {\n name: Fields.secondaryStat,\n config: { unit: 'r/sec', displayName: 'Requests per second' },\n },\n {\n name: Fields.arc + 'success',\n config: { displayName: 'Success', color: { fixedColor: 'green', mode: FieldColorModeId.Fixed } },\n },\n {\n name: Fields.arc + 'failed',\n config: { displayName: 'Failed', color: { fixedColor: 'red', mode: FieldColorModeId.Fixed } },\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: 'r', displayName: 'Requests' } },\n { name: Fields.secondaryStat, config: { unit: 'ms/r', displayName: 'Average response time' } },\n ]);\n\n return [nodes, edges];\n}\n\n/**\n * Group frames from response based on ref id which is set the same as the metric name so we know which metric is where\n * and also put it into DataFrameView so it's easier to work with.\n * @param responses\n */\nfunction getMetricFrames(responses: DataQueryResponse[]): Record<string, DataFrameView> {\n return responses[0].data.reduce<Record<string, DataFrameView>>((acc, frame) => {\n acc[frame.refId] = new DataFrameView(frame);\n return acc;\n }, {});\n}\n\ntype ServiceMapStatistics = {\n total?: number;\n seconds?: number;\n failed?: number;\n};\n\ntype EdgeObject = ServiceMapStatistics & {\n source: string;\n target: string;\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 | undefined,\n stat: keyof ServiceMapStatistics,\n metric: string,\n nodesMap: Record<string, ServiceMapStatistics>,\n edgesMap: Record<string, EdgeObject>\n) {\n if (!frame) {\n return;\n }\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 // Create edge as it does not exist yet\n edgesMap[edgeId] = {\n target: row.server,\n source: row.client,\n [stat]: row[valueName],\n };\n } else {\n // Add stat to edge\n // We are adding the values if exists but that should not happen in general as there should be single row for\n // an edge.\n edgesMap[edgeId][stat] = (edgesMap[edgeId][stat] || 0) + row[valueName];\n }\n\n if (!nodesMap[row.server]) {\n // Create node for server\n nodesMap[row.server] = {\n [stat]: row[valueName],\n };\n } else {\n // Add stat to server node. Sum up values if there are multiple edges targeting this server node.\n nodesMap[row.server][stat] = (nodesMap[row.server][stat] || 0) + row[valueName];\n }\n\n if (!nodesMap[row.client]) {\n // Create the client node but don't add the stat as edge stats are attributed to the server node. This means for\n // example that the number of requests in a node show how many requests it handled not how many it generated.\n nodesMap[row.client] = {\n [stat]: 0,\n };\n }\n }\n}\n\nfunction convertToDataFrames(\n nodesMap: Record<string, ServiceMapStatistics>,\n edgesMap: Record<string, EdgeObject>,\n range: TimeRange\n): { nodes: DataFrame; edges: 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 [Fields.id]: nodeId,\n [Fields.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 [Fields.mainStat]: node.total ? (node.seconds! / node.total) * 1000 : Number.NaN, // Average response time\n [Fields.secondaryStat]: node.total ? Math.round((node.total / (rangeMs / 1000)) * 100) / 100 : Number.NaN, // Request per second (to 2 decimals)\n [Fields.arc + 'success']: node.total ? (node.total - Math.min(node.failed || 0, node.total)) / node.total : 1,\n [Fields.arc + 'failed']: node.total ? Math.min(node.failed || 0, node.total) / node.total : 0,\n });\n }\n for (const edgeId of Object.keys(edgesMap)) {\n const edge = edgesMap[edgeId];\n edges.add({\n [Fields.id]: edgeId,\n [Fields.source]: edge.source,\n [Fields.target]: edge.target,\n [Fields.mainStat]: edge.total, // Requests\n [Fields.secondaryStat]: edge.total ? (edge.seconds! / edge.total) * 1000 : Number.NaN, // Average response time\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 */\n// Updates to this file should also be replicated to @opentelemetry/api-metrics and\n// @opentelemetry/core too.\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\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 :\n typeof self === 'object' ? self :\n typeof window === 'object' ? window :\n typeof global === 'object' ? global :\n {};\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.1.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 { 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 */\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 */\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 args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, args);\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 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 { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nvar diag = DiagAPI.instance();\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 args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n var theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\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 */\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 */\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 */\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 { TraceFlags } from './trace_flags';\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};\n//# sourceMappingURL=invalid-span-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 { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\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 { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nvar VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nvar VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\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 { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nvar context = ContextAPI.getInstance();\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, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\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, this.options);\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, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\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, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\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, _options) {\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 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=tracestate-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 './tracestate-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 TraceStateImpl = /** @class */ (function () {\n function TraceStateImpl(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n TraceStateImpl.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 TraceStateImpl.prototype.unset = function (key) {\n var traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n };\n TraceStateImpl.prototype.get = function (key) {\n return this._internalState.get(key);\n };\n TraceStateImpl.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 TraceStateImpl.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 TraceStateImpl.prototype._keys = function () {\n return Array.from(this._internalState.keys()).reverse();\n };\n TraceStateImpl.prototype._clone = function () {\n var traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n };\n return TraceStateImpl;\n}());\nexport { TraceStateImpl };\n//# sourceMappingURL=tracestate-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 */\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 './common/Attributes';\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 { createTraceState } from './trace/internal/utils';\nexport * from './trace/tracer_provider';\nexport * from './trace/tracer';\nexport * from './trace/tracer_options';\nexport { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';\nexport { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';\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 */\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexport var SemanticAttributes = {\n /**\n * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).\n *\n * Note: This may be different from `faas.id` if an alias is involved.\n */\n AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn',\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 &#34;schema name&#34;.\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 &#34;in flight&#34;.\n This may be actually &#34;in flight&#34; in some languages (e.g. if the exception\n is passed to a Context manager&#39;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 internet connection type currently being used by the host.\n */\n NET_HOST_CONNECTION_TYPE: 'net.host.connection.type',\n /**\n * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.\n */\n NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype',\n /**\n * The name of the mobile carrier.\n */\n NET_HOST_CARRIER_NAME: 'net.host.carrier.name',\n /**\n * The mobile carrier country code.\n */\n NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc',\n /**\n * The mobile carrier network code.\n */\n NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc',\n /**\n * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.\n */\n NET_HOST_CARRIER_ICC: 'net.host.carrier.icc',\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 &#34;managed&#34; 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&#39;s name).\n */\n CODE_FUNCTION: 'code.function',\n /**\n * The &#34;namespace&#34; 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&#39;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). An empty Host header should also be reported, see note.\n *\n * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.\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\n identify the network-level peer, which may be a proxy.\n \n This attribute should be set when a source of information different\n from the one used for `net.peer.ip`, is available even if that other\n source just confirms the same value as `net.peer.ip`.\n Rationale: For `net.peer.ip`, one typically does not know if it\n comes from a proxy, reverse proxy, or the actual client. Setting\n `http.client_ip` when it&#39;s the same as `net.peer.ip` means that\n one is at least somewhat confident that the address is not that of\n the closest 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 &#34;Correlation ID&#34;.\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 &#34;send&#34;, 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 * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message.\n */\n MESSAGING_CONSUMER_ID: 'messaging.consumer_id',\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&#39;re processed on the same partition. They differ from `messaging.message_id` in that they&#39;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&#39;s string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don&#39;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 (logical) name of the service being called, including its package name, if applicable.\n *\n * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n */\n RPC_SERVICE: 'rpc.service',\n /**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\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 * `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 * Whether this is a received or sent message.\n */\n MESSAGE_TYPE: 'message.type',\n /**\n * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.\n *\n * Note: This way we guarantee that the values will be consistent between different implementations.\n */\n MESSAGE_ID: 'message.id',\n /**\n * Compressed size of the message in bytes.\n */\n MESSAGE_COMPRESSED_SIZE: 'message.compressed_size',\n /**\n * Uncompressed size of the message in bytes.\n */\n MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size',\n};\nexport var DbSystemValues = {\n /** Some other SQL database. Fallback only. See notes. */\n OTHER_SQL: 'other_sql',\n /** Microsoft SQL Server. */\n MSSQL: 'mssql',\n /** MySQL. */\n MYSQL: 'mysql',\n /** Oracle Database. */\n ORACLE: 'oracle',\n /** IBM Db2. */\n DB2: 'db2',\n /** PostgreSQL. */\n POSTGRESQL: 'postgresql',\n /** Amazon Redshift. */\n REDSHIFT: 'redshift',\n /** Apache Hive. */\n HIVE: 'hive',\n /** Cloudscape. */\n CLOUDSCAPE: 'cloudscape',\n /** HyperSQL DataBase. */\n HSQLDB: 'hsqldb',\n /** Progress Database. */\n PROGRESS: 'progress',\n /** SAP MaxDB. */\n MAXDB: 'maxdb',\n /** SAP HANA. */\n HANADB: 'hanadb',\n /** Ingres. */\n INGRES: 'ingres',\n /** FirstSQL. */\n FIRSTSQL: 'firstsql',\n /** EnterpriseDB. */\n EDB: 'edb',\n /** InterSystems Caché. */\n CACHE: 'cache',\n /** Adabas (Adaptable Database System). */\n ADABAS: 'adabas',\n /** Firebird. */\n FIREBIRD: 'firebird',\n /** Apache Derby. */\n DERBY: 'derby',\n /** FileMaker. */\n FILEMAKER: 'filemaker',\n /** Informix. */\n INFORMIX: 'informix',\n /** InstantDB. */\n INSTANTDB: 'instantdb',\n /** InterBase. */\n INTERBASE: 'interbase',\n /** MariaDB. */\n MARIADB: 'mariadb',\n /** Netezza. */\n NETEZZA: 'netezza',\n /** Pervasive PSQL. */\n PERVASIVE: 'pervasive',\n /** PointBase. */\n POINTBASE: 'pointbase',\n /** SQLite. */\n SQLITE: 'sqlite',\n /** Sybase. */\n SYBASE: 'sybase',\n /** Teradata. */\n TERADATA: 'teradata',\n /** Vertica. */\n VERTICA: 'vertica',\n /** H2. */\n H2: 'h2',\n /** ColdFusion IMQ. */\n COLDFUSION: 'coldfusion',\n /** Apache Cassandra. */\n CASSANDRA: 'cassandra',\n /** Apache HBase. */\n HBASE: 'hbase',\n /** MongoDB. */\n MONGODB: 'mongodb',\n /** Redis. */\n REDIS: 'redis',\n /** Couchbase. */\n COUCHBASE: 'couchbase',\n /** CouchDB. */\n COUCHDB: 'couchdb',\n /** Microsoft Azure Cosmos DB. */\n COSMOSDB: 'cosmosdb',\n /** Amazon DynamoDB. */\n DYNAMODB: 'dynamodb',\n /** Neo4j. */\n NEO4J: 'neo4j',\n /** Apache Geode. */\n GEODE: 'geode',\n /** Elasticsearch. */\n ELASTICSEARCH: 'elasticsearch',\n /** Memcached. */\n MEMCACHED: 'memcached',\n /** CockroachDB. */\n COCKROACHDB: 'cockroachdb',\n};\nexport var DbCassandraConsistencyLevelValues = {\n /** all. */\n ALL: 'all',\n /** each_quorum. */\n EACH_QUORUM: 'each_quorum',\n /** quorum. */\n QUORUM: 'quorum',\n /** local_quorum. */\n LOCAL_QUORUM: 'local_quorum',\n /** one. */\n ONE: 'one',\n /** two. */\n TWO: 'two',\n /** three. */\n THREE: 'three',\n /** local_one. */\n LOCAL_ONE: 'local_one',\n /** any. */\n ANY: 'any',\n /** serial. */\n SERIAL: 'serial',\n /** local_serial. */\n LOCAL_SERIAL: 'local_serial',\n};\nexport var FaasTriggerValues = {\n /** A response to some data source operation such as a database or filesystem read/write. */\n DATASOURCE: 'datasource',\n /** To provide an answer to an inbound HTTP request. */\n HTTP: 'http',\n /** A function is set to be executed when messages are sent to a messaging system. */\n PUBSUB: 'pubsub',\n /** A function is scheduled to be executed regularly. */\n TIMER: 'timer',\n /** If none of the others apply. */\n OTHER: 'other',\n};\nexport var FaasDocumentOperationValues = {\n /** When a new object is created. */\n INSERT: 'insert',\n /** When an object is modified. */\n EDIT: 'edit',\n /** When an object is deleted. */\n DELETE: 'delete',\n};\nexport var FaasInvokedProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexport var NetTransportValues = {\n /** ip_tcp. */\n IP_TCP: 'ip_tcp',\n /** ip_udp. */\n IP_UDP: 'ip_udp',\n /** Another IP-based protocol. */\n IP: 'ip',\n /** Unix Domain socket. See below. */\n UNIX: 'unix',\n /** Named or anonymous pipe. See note below. */\n PIPE: 'pipe',\n /** In-process communication. */\n INPROC: 'inproc',\n /** Something else (non IP-based). */\n OTHER: 'other',\n};\nexport var NetHostConnectionTypeValues = {\n /** wifi. */\n WIFI: 'wifi',\n /** wired. */\n WIRED: 'wired',\n /** cell. */\n CELL: 'cell',\n /** unavailable. */\n UNAVAILABLE: 'unavailable',\n /** unknown. */\n UNKNOWN: 'unknown',\n};\nexport var NetHostConnectionSubtypeValues = {\n /** GPRS. */\n GPRS: 'gprs',\n /** EDGE. */\n EDGE: 'edge',\n /** UMTS. */\n UMTS: 'umts',\n /** CDMA. */\n CDMA: 'cdma',\n /** EVDO Rel. 0. */\n EVDO_0: 'evdo_0',\n /** EVDO Rev. A. */\n EVDO_A: 'evdo_a',\n /** CDMA2000 1XRTT. */\n CDMA2000_1XRTT: 'cdma2000_1xrtt',\n /** HSDPA. */\n HSDPA: 'hsdpa',\n /** HSUPA. */\n HSUPA: 'hsupa',\n /** HSPA. */\n HSPA: 'hspa',\n /** IDEN. */\n IDEN: 'iden',\n /** EVDO Rev. B. */\n EVDO_B: 'evdo_b',\n /** LTE. */\n LTE: 'lte',\n /** EHRPD. */\n EHRPD: 'ehrpd',\n /** HSPAP. */\n HSPAP: 'hspap',\n /** GSM. */\n GSM: 'gsm',\n /** TD-SCDMA. */\n TD_SCDMA: 'td_scdma',\n /** IWLAN. */\n IWLAN: 'iwlan',\n /** 5G NR (New Radio). */\n NR: 'nr',\n /** 5G NRNSA (New Radio Non-Standalone). */\n NRNSA: 'nrnsa',\n /** LTE CA. */\n LTE_CA: 'lte_ca',\n};\nexport var HttpFlavorValues = {\n /** HTTP 1.0. */\n HTTP_1_0: '1.0',\n /** HTTP 1.1. */\n HTTP_1_1: '1.1',\n /** HTTP 2. */\n HTTP_2_0: '2.0',\n /** SPDY protocol. */\n SPDY: 'SPDY',\n /** QUIC protocol. */\n QUIC: 'QUIC',\n};\nexport var MessagingDestinationKindValues = {\n /** A message sent to a queue. */\n QUEUE: 'queue',\n /** A message sent to a topic. */\n TOPIC: 'topic',\n};\nexport var MessagingOperationValues = {\n /** receive. */\n RECEIVE: 'receive',\n /** process. */\n PROCESS: 'process',\n};\nexport var RpcGrpcStatusCodeValues = {\n /** OK. */\n OK: 0,\n /** CANCELLED. */\n CANCELLED: 1,\n /** UNKNOWN. */\n UNKNOWN: 2,\n /** INVALID_ARGUMENT. */\n INVALID_ARGUMENT: 3,\n /** DEADLINE_EXCEEDED. */\n DEADLINE_EXCEEDED: 4,\n /** NOT_FOUND. */\n NOT_FOUND: 5,\n /** ALREADY_EXISTS. */\n ALREADY_EXISTS: 6,\n /** PERMISSION_DENIED. */\n PERMISSION_DENIED: 7,\n /** RESOURCE_EXHAUSTED. */\n RESOURCE_EXHAUSTED: 8,\n /** FAILED_PRECONDITION. */\n FAILED_PRECONDITION: 9,\n /** ABORTED. */\n ABORTED: 10,\n /** OUT_OF_RANGE. */\n OUT_OF_RANGE: 11,\n /** UNIMPLEMENTED. */\n UNIMPLEMENTED: 12,\n /** INTERNAL. */\n INTERNAL: 13,\n /** UNAVAILABLE. */\n UNAVAILABLE: 14,\n /** DATA_LOSS. */\n DATA_LOSS: 15,\n /** UNAUTHENTICATED. */\n UNAUTHENTICATED: 16,\n};\nexport var MessageTypeValues = {\n /** sent. */\n SENT: 'SENT',\n /** received. */\n RECEIVED: 'RECEIVED',\n};\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 SemanticResourceAttributes = {\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&#39;s docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [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 &#34;zones&#34; on Alibaba Cloud and 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&#39;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&#39;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 single function that this runtime instance executes.\n *\n * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes).\n */\n FAAS_NAME: 'faas.name',\n /**\n * The unique ID of the single function that this runtime instance executes.\n *\n * Note: Depending on the cloud provider, use:\n \n * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).\n Take care not to use the &#34;invoked ARN&#34; directly but replace any\n [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple\n different aliases.\n * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)\n * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).\n \n On some providers, it may not be possible to determine the full ID at startup,\n which is why this field cannot be made required. For example, on AWS the account ID\n part of the ARN is not available without calling another AWS API\n which may be deemed too slow for a short-running lambda function.\n As an alternative, consider setting `faas.id` as a span attribute instead.\n */\n FAAS_ID: 'faas.id',\n /**\n * The immutable version of the function being executed.\n *\n * Note: Depending on the cloud provider and platform, use:\n \n * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)\n (an integer represented as a decimal string).\n * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)\n (i.e., the function name plus the revision suffix).\n * **Google Cloud Functions:** The value of the\n [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).\n * **Azure Functions:** Not applicable. Do not set this attribute.\n */\n FAAS_VERSION: 'faas.version',\n /**\n * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.\n *\n * Note: * **AWS Lambda:** Use the (full) log stream name.\n */\n FAAS_INSTANCE: 'faas.instance',\n /**\n * The amount of memory available to the serverless function in MiB.\n *\n * Note: It&#39;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 SpanAttributes](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 SpanAttributes](../../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};\nexport var CloudProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexport var CloudPlatformValues = {\n /** Alibaba Cloud Elastic Compute Service. */\n ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs',\n /** Alibaba Cloud Function Compute. */\n ALIBABA_CLOUD_FC: 'alibaba_cloud_fc',\n /** AWS Elastic Compute Cloud. */\n AWS_EC2: 'aws_ec2',\n /** AWS Elastic Container Service. */\n AWS_ECS: 'aws_ecs',\n /** AWS Elastic Kubernetes Service. */\n AWS_EKS: 'aws_eks',\n /** AWS Lambda. */\n AWS_LAMBDA: 'aws_lambda',\n /** AWS Elastic Beanstalk. */\n AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk',\n /** Azure Virtual Machines. */\n AZURE_VM: 'azure_vm',\n /** Azure Container Instances. */\n AZURE_CONTAINER_INSTANCES: 'azure_container_instances',\n /** Azure Kubernetes Service. */\n AZURE_AKS: 'azure_aks',\n /** Azure Functions. */\n AZURE_FUNCTIONS: 'azure_functions',\n /** Azure App Service. */\n AZURE_APP_SERVICE: 'azure_app_service',\n /** Google Cloud Compute Engine (GCE). */\n GCP_COMPUTE_ENGINE: 'gcp_compute_engine',\n /** Google Cloud Run. */\n GCP_CLOUD_RUN: 'gcp_cloud_run',\n /** Google Cloud Kubernetes Engine (GKE). */\n GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine',\n /** Google Cloud Functions (GCF). */\n GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions',\n /** Google Cloud App Engine (GAE). */\n GCP_APP_ENGINE: 'gcp_app_engine',\n};\nexport var AwsEcsLaunchtypeValues = {\n /** ec2. */\n EC2: 'ec2',\n /** fargate. */\n FARGATE: 'fargate',\n};\nexport var HostArchValues = {\n /** AMD64. */\n AMD64: 'amd64',\n /** ARM32. */\n ARM32: 'arm32',\n /** ARM64. */\n ARM64: 'arm64',\n /** Itanium. */\n IA64: 'ia64',\n /** 32-bit PowerPC. */\n PPC32: 'ppc32',\n /** 64-bit PowerPC. */\n PPC64: 'ppc64',\n /** 32-bit x86. */\n X86: 'x86',\n};\nexport var OsTypeValues = {\n /** Microsoft Windows. */\n WINDOWS: 'windows',\n /** Linux. */\n LINUX: 'linux',\n /** Apple Darwin. */\n DARWIN: 'darwin',\n /** FreeBSD. */\n FREEBSD: 'freebsd',\n /** NetBSD. */\n NETBSD: 'netbsd',\n /** OpenBSD. */\n OPENBSD: 'openbsd',\n /** DragonFly BSD. */\n DRAGONFLYBSD: 'dragonflybsd',\n /** HP-UX (Hewlett Packard Unix). */\n HPUX: 'hpux',\n /** AIX (Advanced Interactive eXecutive). */\n AIX: 'aix',\n /** Oracle Solaris. */\n SOLARIS: 'solaris',\n /** IBM z/OS. */\n Z_OS: 'z_os',\n};\nexport var TelemetrySdkLanguageValues = {\n /** cpp. */\n CPP: 'cpp',\n /** dotnet. */\n DOTNET: 'dotnet',\n /** erlang. */\n ERLANG: 'erlang',\n /** go. */\n GO: 'go',\n /** java. */\n JAVA: 'java',\n /** nodejs. */\n NODEJS: 'nodejs',\n /** php. */\n PHP: 'php',\n /** python. */\n PYTHON: 'python',\n /** ruby. */\n RUBY: 'ruby',\n /** webjs. */\n WEBJS: 'webjs',\n};\n//# sourceMappingURL=SemanticResourceAttributes.js.map","import { SpanStatus, SpanStatusCode } from '@opentelemetry/api';\nimport { collectorTypes } from '@opentelemetry/exporter-collector';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\nimport differenceInHours from 'date-fns/differenceInHours';\nimport formatDistance from 'date-fns/formatDistance';\n\nimport {\n ArrayVector,\n DataFrame,\n DataQueryResponse,\n DataSourceInstanceSettings,\n Field,\n FieldType,\n MutableDataFrame,\n TraceKeyValuePair,\n TraceLog,\n TraceSpanReference,\n TraceSpanRow,\n dateTimeFormat,\n} from '@grafana/data';\n\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 raw = atob(base64);\n let result = '';\n for (let i = 0; i < raw.length; i++) {\n const hex = raw.charCodeAt(i).toString(16);\n result += hex.length === 2 ? hex : '0' + hex;\n }\n\n return result.length > 16 ? result.slice(16) : result;\n}\n\nfunction transformHexStringToBase64ID(hex: string) {\n const hexArray = hex.match(/\\w{2}/g) || [];\n return btoa(\n hexArray\n .map(function (a) {\n return String.fromCharCode(parseInt(a, 16));\n })\n .join('')\n );\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 === SemanticResourceAttributes.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 (span.kind !== undefined) {\n const split = span.kind.toString().toLowerCase().split('_');\n spanTags.push({\n key: 'span.kind',\n value: split.length ? split[split.length - 1] : span.kind.toString(),\n });\n }\n\n return spanTags;\n}\n\nfunction getReferences(span: collectorTypes.opentelemetryProto.trace.v1.Span) {\n const references: TraceSpanReference[] = [];\n if (span.links) {\n for (const link of span.links) {\n const { traceId, spanId } = link;\n const tags: TraceKeyValuePair[] = [];\n if (link.attributes) {\n for (const attribute of link.attributes) {\n tags.push({ key: attribute.key, value: getAttributeValue(attribute.value) });\n }\n }\n references.push({ traceID: traceId, spanID: spanId, tags });\n }\n }\n\n return references;\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: 'references', 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 references: getReferences(span),\n } as TraceSpanRow);\n }\n }\n }\n } catch (error) {\n console.error(error);\n return { error: { message: 'JSON is not valid OpenTelemetry format: ' + error }, 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(data: MutableDataFrame): {\n batches: collectorTypes.opentelemetryProto.trace.v1.ResourceSpans[];\n} {\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 links: getOTLPReferences(span.references),\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\nfunction getOTLPReferences(\n references: TraceSpanReference[]\n): collectorTypes.opentelemetryProto.trace.v1.Span.Link[] | undefined {\n if (!references || !references.length) {\n return undefined;\n }\n\n let links: collectorTypes.opentelemetryProto.trace.v1.Span.Link[] = [];\n for (const ref of references) {\n let link: collectorTypes.opentelemetryProto.trace.v1.Span.Link = {\n traceId: ref.traceID,\n spanId: ref.spanID,\n attributes: [],\n droppedAttributesCount: 0,\n };\n if (ref.tags?.length) {\n for (const tag of ref.tags) {\n link.attributes?.push({\n key: tag.key,\n value: toAttributeValue(tag),\n });\n }\n }\n links.push(link);\n }\n return links;\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 try {\n parseJsonFields(frame);\n } catch (error) {\n console.error(error);\n return { error: { message: 'Unable to parse trace response: ' + error }, data: [] };\n }\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', 'references']) {\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\nexport type 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 unit: 'string',\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.string, 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\n .sort((a, b) => parseInt(b?.startTimeUnixNano!, 10) / 1000000 - parseInt(a?.startTimeUnixNano!, 10) / 1000000)\n .map(transformToTraceData);\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\n const traceStartTime = parseInt(data.startTimeUnixNano!, 10) / 1000000;\n\n let startTime = dateTimeFormat(traceStartTime);\n\n if (Math.abs(differenceInHours(new Date(traceStartTime), Date.now())) <= 1) {\n startTime = formatDistance(new Date(traceStartTime), Date.now(), {\n addSuffix: true,\n includeSeconds: true,\n });\n }\n\n return {\n traceID: data.traceID,\n startTime: startTime,\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","import assign from \"../assign/index.js\";\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import compareAsc from \"../compareAsc/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWords ` to `formatDistance`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWords(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 11, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n *\n * // v2.0.0 onward\n *\n * formatDistance(\n * new Date(1986, 3, 4, 11, 32, 0),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n requiredArgs(2, arguments);\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\n var months; // 0 up to 2 mins\n\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance('halfAMinute', null, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n }\n } // 2 mins up to 0.75 hrs\n\n } else if (minutes < 45) {\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60);\n return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft); // 2 months up to 12 months\n\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12;\n var years = Math.floor(months / 12); // N years up to 1 years 3 months\n\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n }\n }\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","failedMetric","histogramMetric","serviceMapMetrics","mapPromMetricsToServiceMap","responses","frames","frame","refId","getMetricFrames","nodesMap","edgesMap","collectMetricData","rangeMs","to","valueOf","from","createDF","unit","fixedColor","FieldColorModeId","createServiceMapDataFrames","nodeId","Object","keys","total","seconds","Number","NaN","Math","round","min","failed","edgeId","source","target","convertToDataFrames","stat","metric","valueName","client","server","_globalThis","globalThis","self","window","g","VERSION","re","isCompatible","ownVersion","acceptedVersions","Set","rejectedVersions","myVersionMatch","match","ownVersionParsed","globalVersion","_reject","v","_accept","has","globalVersionMatch","globalVersionParsed","_makeCompatibilityCheck","major","split","GLOBAL_OPENTELEMETRY_API_KEY","Symbol","for","_global","registerGlobal","instance","diag","allowOverride","_a","api","version","err","Error","error","stack","message","debug","getGlobal","_b","unregisterGlobal","DiagLogLevel","DiagComponentLogger","props","this","_namespace","namespace","prototype","args","_i","arguments","logProxy","info","warn","verbose","funcName","logger","unshift","apply","DiagAPI","_logProxy","setLogger","logLevel","INFO","oldLogger","newLogger","maxLevel","_filterFunc","theLevel","theFunc","bind","NONE","ALL","ERROR","WARN","DEBUG","VERBOSE","createLogLevelDiagLogger","disable","createComponentLogger","options","_instance","BaggageImpl","entries","_entries","Map","getEntry","key","entry","assign","getAllEntries","Array","setEntry","newBaggage","set","removeEntry","delete","removeEntries","keys_1","clear","createBaggage","defaultTextMapGetter","carrier","defaultTextMapSetter","value","createContextKey","description","TraceFlags","BaseContext","parentContext","_currentContext","getValue","setValue","context","deleteValue","ROOT_CONTEXT","__spreadArray","il","j","NoopContextManager","active","with","_context","fn","thisArg","call","enable","NOOP_CONTEXT_MANAGER","ContextAPI","getInstance","setGlobalContextManager","contextManager","_getContextManager","INVALID_SPANID","INVALID_TRACEID","INVALID_SPAN_CONTEXT","traceId","spanId","traceFlags","NonRecordingSpan","_spanContext","spanContext","setAttribute","_key","_value","setAttributes","_attributes","addEvent","_name","setStatus","_status","updateName","_endTime","isRecording","recordException","_exception","_time","SPAN_KEY","setSpan","deleteSpan","setSpanContext","getSpanContext","VALID_TRACEID_REGEX","VALID_SPANID_REGEX","isSpanContextValid","test","wrapSpanContext","NoopTracer","startSpan","Boolean","root","parentFromContext","startActiveSpan","arg2","arg3","arg4","opts","ctx","contextWithSpanSet","SamplingDecision","SpanKind","SpanStatusCode","NOOP_TRACER","ProxyTracer","_provider","_getTracer","_options","_fn","tracer","Reflect","_delegate","getDelegateTracer","NOOP_TRACER_PROVIDER","NoopTracerProvider","getTracer","_version","ProxyTracerProvider","getDelegate","setDelegate","delegate","VALID_KEY_REGEX","RegExp","VALID_VALUE_BASE_REGEX","INVALID_VALUE_COMMA_EQUAL_REGEX","TraceStateImpl","rawTraceState","_internalState","_parse","traceState","_clone","unset","serialize","_this","_keys","agg","join","reverse","part","listMember","trim","indexOf","validateKey","validateValue","size","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","SemanticResourceAttributes","transformTraceList","response","datasourceId","datasourceName","traceRegexs","forEach","logsFrame","datasourceUid","tableFrame","custom","width","displayNameFromDS","links","title","url","internal","query","timeField","find","f","field","hasMatch","values","toArray","line","traceRegex","time","createTableFrame","transformBase64IDToHexString","base64","raw","atob","result","hex","charCodeAt","toString","transformHexStringToBase64ID","hexArray","btoa","String","fromCharCode","parseInt","getAttributeValue","stringValue","boolValue","intValue","doubleValue","arrayValue","arValue","resourceToProcess","resource","serviceTags","attribute","attributes","getSpanTags","instrumentationLibrary","spanTags","status","code","UNSET","kind","toLowerCase","getReferences","references","link","tags","traceID","getLogs","logs","events","event","timestamp","timeUnixNano","transformFromOTLP","traceData","nodeGraph","traceFormat","librarySpan","instrumentationLibrarySpans","spans","parentSpanId","startTimeUnixNano","endTimeUnixNano","console","transformToOTLP","batches","services","droppedAttributesCount","batchIndex","tagsToAttributes","libraryName","t","padStart","getOTLPSpanKind","droppedEventsCount","droppedLinksCount","getOTLPStatus","getOTLPEvents","getOTLPReferences","spanKind","filter","includes","tag","toAttributeValue","isArray","val","statusCodeTag","log","ref","transformTrace","emptyDataQueryResponse","parseJsonFields","fieldName","fieldIndex","ArrayVector","newField","JSON","parse","createTableFrameFromSearch","instanceSettings","uid","queryType","transformToTraceData","trace","traceName","rootServiceName","rootTraceName","dateTimeFormat","abs","differenceInHours","Date","now","formatDistance","addSuffix","includeSeconds","durationMs","cloneObject","dirtyObject","TypeError","property","hasOwnProperty","MINUTES_IN_DAY","MINUTES_IN_MONTH","dirtyDate","dirtyBaseDate","requiredArgs","locale","RangeError","comparison","compareAsc","isNaN","dateLeft","dateRight","localizeOptions","toDate","months","differenceInSeconds","offsetInSeconds","getTimezoneOffsetInMilliseconds","minutes","hours","days","differenceInMonths","nearestMonth","monthsSinceStartOfYear","years","floor"],"sourceRoot":""}