{
  "version": 3,
  "sources": ["../../../../src/rum/agent/src/plugins/config.ts", "../../../../src/rum/agent/src/capture-policy.ts", "../../../../src/rum/agent/src/identity.ts", "../../../../src/rum/agent/src/diagnostics.ts", "../../../../src/rum/agent/src/context.ts", "../../../../src/rum/agent/src/config.ts", "../../../../src/rum/agent/src/consent-epoch.ts", "../../../../src/rum/agent/src/plugins/runtime.ts", "../../../../src/rum/agent/src/navigation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/version.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/internal/semver.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/internal/global-utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/diag/ComponentLogger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/diag/types.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/diag/internal/logLevelLogger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/api/diag.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/baggage/internal/baggage-impl.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/baggage/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/context/context.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/diag/consoleLogger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/metrics/NoopMeter.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/propagation/TextMapPropagator.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/context/NoopContextManager.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/api/context.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/trace_flags.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/invalid-span-constants.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/NonRecordingSpan.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/context-utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/spancontext-utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/NoopTracer.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/ProxyTracer.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/NoopTracerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/ProxyTracerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/SamplingResult.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/span_kind.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace/status.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/context-api.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/diag-api.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/metrics/NoopMeterProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/api/metrics.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/metrics-api.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/propagation/NoopTextMapPropagator.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/baggage/context-helpers.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/api/propagation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/propagation-api.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/api/trace.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api/src/trace-api.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/types/LogRecord.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/NoopLogger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/internal/global-utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/NoopLoggerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/ProxyLogger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/ProxyLoggerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/api/logs.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/api-logs/src/index.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/trace/suppress-tracing.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/common/attributes.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/common/logging-error-handler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/common/global-error-handler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/version.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/semantic-conventions/src/stable_attributes.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/platform/browser/sdk-info.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/platform/browser/index.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/common/time.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/ExportResult.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/propagation/composite.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/internal/validators.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/trace/TraceState.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/trace/W3CTraceContextPropagator.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/utils/timeout.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/utils/promise.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/core/src/utils/callback.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/resources/src/default-service-name.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/resources/src/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/resources/src/ResourceImpl.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/document/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/document/DocumentSpanProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/document/LocationDocumentProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/document/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/session/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/session/SessionSpanProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-sdk/src/session/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/dist/package.js", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/autoLoaderUtils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/autoLoader.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/shimmer.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/platform/browser/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/instrumentation/src/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/errors/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/utils/ContextRegistry.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/utils/NetworkContextRegistry.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/utils/request.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/utils/url.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/fetch/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/fetch/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/xhr/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/dist/xhr/instrumentation.js", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/navigation/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/navigation/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/navigation/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/resource-timing/idle-callback-shim.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/resource-timing/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/browser-instrumentation/src/resource-timing/instrumentation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/common/internal.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/logs/internal.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/common/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/logs/json/logs.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/trace/internal.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/otlp-transformer/src/trace/json/trace.ts", "../../../../src/rum/agent/src/otel/consent-exporter.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/utils/validation.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/LogRecordImpl.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/Logger.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/export/NoopLogRecordProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/MultiLogRecordProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/internal/utils.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/LoggerMetrics.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/version.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/internal/LoggerProviderSharedState.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/LoggerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/export/LogRecordProcessorMetrics.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/export/BatchLogRecordProcessorBase.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-logs/src/platform/browser/export/BatchLogRecordProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/enums.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/inspect.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/Span.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/Sampler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/semconv.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/TracerMetrics.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/version.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/Tracer.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/MultiSpanProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/sampler/AlwaysOffSampler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/sampler/AlwaysOnSampler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/sampler/ParentBasedSampler.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/export/SpanProcessorMetrics.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/export/BatchSpanProcessorBase.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/platform/browser/export/BatchSpanProcessor.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/platform/browser/RandomIdGenerator.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/TracerProvider.ts", "../../../../src/rum/agent/node_modules/@opentelemetry/sdk-trace/src/sampler/TraceIdRatioBasedSampler.ts", "../../../../src/rum/agent/src/resource-timing-caps.ts", "../../../../src/rum/agent/src/version.ts", "../../../../src/rum/agent/src/resource-enrichment.ts", "../../../../src/rum/agent/src/otel/processors.ts", "../../../../src/rum/agent/src/otel/context-manager.ts", "../../../../src/rum/agent/src/otel/network.ts", "../../../../src/rum/agent/src/otel/setup.ts", "../../../../src/rum/agent/src/session.ts", "../../../../src/rum/agent/src/index.ts", "../../../../src/rum/agent/src/script-metadata.ts", "../../../../src/rum/agent/src/browser.ts"],
  "sourcesContent": ["/** Performance, errors and network tracing default on; content capture is opt-in. */\nexport interface RumPluginConfig {\n  documentLoad?: boolean;\n  webVitals?: boolean;\n  fetch?: boolean;\n  xhr?: boolean;\n  console?: boolean;\n  userActions?: boolean;\n  resources?: boolean;\n  spa?: boolean;\n  errors?: boolean;\n  interactions?: boolean;\n  domMutations?: boolean;\n  longTasks?: boolean;\n}\n\n/** @deprecated Transport always uses standard OTLP endpoints; omit exportMode. */\nexport type ExportMode = \"rum\" | \"otlp\";\n\nexport function resolvePlugins(plugins?: RumPluginConfig): Required<RumPluginConfig> {\n  return {\n    documentLoad: plugins?.documentLoad !== false,\n    webVitals: plugins?.webVitals !== false,\n    fetch: plugins?.fetch !== false,\n    xhr: plugins?.xhr !== false,\n    console: plugins?.console === true,\n    userActions: plugins?.userActions === true,\n    resources: plugins?.resources !== false,\n    spa: plugins?.spa !== false,\n    errors: plugins?.errors !== false,\n    interactions: plugins?.interactions === true,\n    domMutations: plugins?.domMutations === true,\n    longTasks: plugins?.longTasks === true,\n  };\n}\n\n/** Optional URL redaction before export (e.g. strip query tokens). */\nexport type RedactUrlFn = (url: string) => string;\n\nexport function defaultRedactUrl(url: string): string {\n  try {\n    const u = new URL(url, typeof location !== \"undefined\" ? location.href : \"http://local\");\n    u.username = \"\";\n    u.password = \"\";\n    for (const key of [...u.searchParams.keys()]) {\n      if (\n        /^(?:token|key|password|secret|api[_-]?key|access[_-]?token|refresh[_-]?token|authorization|auth|code)$/i.test(\n          key,\n        )\n      ) {\n        u.searchParams.set(key, \"[REDACTED]\");\n      }\n    }\n    u.hash = \"\";\n    return u.toString();\n  } catch {\n    return \"[REDACTED]\";\n  }\n}\n\n/** A failed sanitizer must never export the original value or break the page. */\nexport function safeRedactUrl(redact: RedactUrlFn, url: string): string {\n  try {\n    return redact(url);\n  } catch {\n    return \"[REDACTED]\";\n  }\n}\n", "import { safeRedactUrl, type RedactUrlFn } from \"./plugins/config.ts\";\nimport type { ElementLike } from \"./lcp.ts\";\n\nexport { REPLAY_SCHEMA, SNAPSHOT_BYTES } from \"./replay/schema.ts\";\nexport const CAPTURE_EVENTS = 40;\nexport const CAPTURE_BYTES = 64 * 1024;\nconst MASK = \"[data-corridora-mask], [data-mask], input, textarea, select, script, style\";\nconst SAFE = new Set([\n  \"type\",\n  \"role\",\n  \"aria-hidden\",\n  \"disabled\",\n  \"checked\",\n  \"selected\",\n  \"colspan\",\n  \"rowspan\",\n]);\nconst URL_ATTRS = new Set([\"href\", \"src\"]);\n\n/** Public helper keeps its legacy input shape; capture omits host identifiers. */\nexport function elementLabel(el: ElementLike | null | undefined, identifiers = true): string {\n  if (!el) return \"\";\n  const tag = (el.tagName ?? \"\").toLowerCase().slice(0, 64);\n  if (!identifiers) return tag;\n  const id = el.id ?? el.getAttribute?.(\"id\");\n  if (id) return `#${id}`.slice(0, 512);\n  const raw = typeof el.className === \"string\" ? el.className : (el.getAttribute?.(\"class\") ?? \"\");\n  const classes = raw.split(/\\s+/).filter(Boolean).slice(0, 2);\n  return (tag ? `${tag}${classes.length ? `.${classes.join(\".\")}` : \"\"}` : \"\").slice(0, 512);\n}\n\nexport function masked(node: Node): boolean {\n  const el = node instanceof Element ? node : node.parentElement;\n  return !!el?.closest(MASK);\n}\n\nexport function captureAttribute(\n  el: Element,\n  name: string,\n  redact: RedactUrlFn,\n): string | undefined {\n  if (masked(el)) return \"[REDACTED]\";\n  if (URL_ATTRS.has(name)) {\n    const raw = el.getAttribute(name);\n    if (raw === null) return \"\";\n    if (raw.length > 2048) return \"[REDACTED]\";\n    // Unsupported URL schemes never become executable replay links.\n    try {\n      const url = new URL(raw, location.href);\n      return [\"http:\", \"https:\"].includes(url.protocol)\n        ? safeRedactUrl(redact, url.href).slice(0, 512)\n        : \"[REDACTED]\";\n    } catch {\n      return \"[REDACTED]\";\n    }\n  }\n  if (SAFE.has(name)) {\n    const raw = el.getAttribute(name) ?? \"\";\n    if (!raw) return \"\";\n    if ([\"disabled\", \"checked\", \"selected\"].includes(name)) return \"true\";\n    if (name === \"aria-hidden\") return [\"true\", \"false\"].includes(raw) ? raw : \"[REDACTED]\";\n    if ([\"colspan\", \"rowspan\"].includes(name)) return /^\\d{1,3}$/.test(raw) ? raw : \"[REDACTED]\";\n    const types =\n      name === \"type\"\n        ? \"button submit reset text password email number checkbox radio hidden tel url search date file range\"\n        : \"button link navigation main note region presentation none dialog alert status list listitem table row cell heading img textbox\";\n    return types.split(\" \").includes(raw) ? raw : \"[REDACTED]\";\n  }\n  if ([\"value\", \"placeholder\", \"alt\", \"title\", \"aria-label\"].includes(name)) return \"[REDACTED]\";\n  return undefined;\n}\n\n/** Shared event/byte budgets for optional content producers. */\nexport function createCaptureBudget(now = Date.now) {\n  let at = now();\n  let events = 0;\n  let bytes = 0;\n  let dropped = 0;\n  return {\n    admit(value: unknown): boolean {\n      const current = now();\n      if (current - at >= 1000 || current < at) {\n        at = current;\n        events = 0;\n        bytes = 0;\n      }\n      const size = new TextEncoder().encode(JSON.stringify(value)).byteLength;\n      if (events >= CAPTURE_EVENTS || bytes + size > CAPTURE_BYTES) {\n        dropped++;\n        return false;\n      }\n      events++;\n      bytes += size;\n      return true;\n    },\n    dropped: () => dropped,\n  };\n}\n", "/** Shared cryptographic identity policy; no Math.random fallback. */\nexport function randomId(): string {\n  if (typeof globalThis.crypto?.randomUUID === \"function\") return crypto.randomUUID();\n  if (typeof globalThis.crypto?.getRandomValues !== \"function\")\n    throw new Error(\"RUM requires cryptographic random values\");\n  return Array.from(crypto.getRandomValues(new Uint8Array(16)), (n) =>\n    n.toString(16).padStart(2, \"0\"),\n  ).join(\"\");\n}\n\nexport function preflight(): void {\n  randomId();\n  if (typeof fetch !== \"function\" || typeof performance?.now !== \"function\")\n    throw new Error(\"RUM requires fetch and Performance APIs\");\n}\n", "import type { RumDiagnostic } from \"./config.ts\";\n\n/** Counts only, no URLs, keys, content or console output. Bounded and nonrecursive. */\nexport function createDiagnostics(callback?: (diagnostic: RumDiagnostic) => void) {\n  let calls = 0;\n  let running = false;\n  return (code: RumDiagnostic[\"code\"], count = 1): void => {\n    if (!callback || running || calls >= 50) return;\n    calls++;\n    running = true;\n    try {\n      callback({ code, count: Math.min(1_000_000, Math.max(0, count)) });\n    } catch {\n      // A host diagnostic sink must not disrupt instrumentation.\n    } finally {\n      running = false;\n    }\n  };\n}\n", "import type { ResolvedAgentConfig } from \"./config.ts\";\n\nexport type DeviceType = \"mobile\" | \"tablet\" | \"desktop\";\n\nexport interface ParsedUserAgent {\n  browserName: string;\n  browserVersion: string;\n  deviceType: DeviceType;\n}\n\n/** Per-page RUM context resolved at runtime from the browser environment. */\nexport interface RumContext {\n  sessionId: string;\n  pageRoute?: string;\n  pageUrl?: string;\n  userAgent?: string;\n  geoCountry?: string;\n  geoCity?: string;\n}\n\nconst firstMatch = (ua: string, re: RegExp): string => ua.match(re)?.[1] ?? \"\";\n\n/**\n * Best-effort UA parsing. Heuristics favour the common engines; order matters\n * because most UAs embed several engine tokens (Edge/Opera masquerade as Chrome,\n * Chrome embeds Safari, etc.).\n */\nexport function parseUserAgent(ua: string): ParsedUserAgent {\n  const s = ua ?? \"\";\n\n  let browserName = \"unknown\";\n  let browserVersion = \"\";\n  if (/\\bEdg(?:e|A|iOS)?\\//.test(s)) {\n    browserName = \"Edge\";\n    browserVersion = firstMatch(s, /\\bEdg(?:e|A|iOS)?\\/([\\d.]+)/);\n  } else if (/\\b(?:OPR|Opera)\\//.test(s)) {\n    browserName = \"Opera\";\n    browserVersion = firstMatch(s, /\\b(?:OPR|Opera)\\/([\\d.]+)/);\n  } else if (/\\bFirefox\\//.test(s)) {\n    browserName = \"Firefox\";\n    browserVersion = firstMatch(s, /\\bFirefox\\/([\\d.]+)/);\n  } else if (/\\bChrome\\//.test(s)) {\n    browserName = \"Chrome\";\n    browserVersion = firstMatch(s, /\\bChrome\\/([\\d.]+)/);\n  } else if (/\\bSafari\\//.test(s) && /\\bVersion\\//.test(s)) {\n    browserName = \"Safari\";\n    browserVersion = firstMatch(s, /\\bVersion\\/([\\d.]+)/);\n  }\n\n  let deviceType: DeviceType = \"desktop\";\n  if (\n    /\\b(iPad|Tablet|PlayBook|Silk)\\b/.test(s) ||\n    (/\\bAndroid\\b/.test(s) && !/\\bMobile\\b/.test(s))\n  ) {\n    deviceType = \"tablet\";\n  } else if (\n    /\\b(Mobi|iPhone|iPod|Windows Phone|IEMobile)\\b/.test(s) ||\n    (/\\bAndroid\\b/.test(s) && /\\bMobile\\b/.test(s))\n  ) {\n    deviceType = \"mobile\";\n  }\n\n  return { browserName, browserVersion, deviceType };\n}\n\n/**\n * Builds the RUM resource attribute map. The ingest pipeline reads RUM context\n * (session, page, browser, device, geo) from these resource attributes, so the\n * canonical keys are always present; user-provided `resourceAttributes` are\n * merged last and may add or override entries (e.g. geo).\n */\nexport function buildResourceAttributes(\n  config: Pick<ResolvedAgentConfig, \"serviceName\" | \"resourceAttributes\">,\n  ctx: RumContext,\n): Record<string, string> {\n  const ua = parseUserAgent(ctx.userAgent ?? \"\");\n  const attrs: Record<string, string> = {\n    \"service.name\": config.serviceName,\n    \"session.id\": ctx.sessionId,\n    \"browser.name\": ua.browserName,\n    \"device.type\": ua.deviceType,\n  };\n\n  if (ua.browserVersion) attrs[\"browser.version\"] = ua.browserVersion;\n  if (ctx.pageRoute) attrs[\"page.route\"] = ctx.pageRoute;\n  if (ctx.pageUrl) attrs[\"page.url\"] = ctx.pageUrl;\n  if (ctx.geoCountry) attrs[\"geo.country\"] = ctx.geoCountry;\n  if (ctx.geoCity) attrs[\"geo.city\"] = ctx.geoCity;\n\n  return { ...attrs, ...config.resourceAttributes };\n}\n", "import {\n  defaultRedactUrl,\n  resolvePlugins,\n  type ExportMode,\n  type RedactUrlFn,\n  type RumPluginConfig,\n} from \"./plugins/config.ts\";\n\nexport type ConsentState = \"pending\" | \"granted\" | \"denied\";\n\n/** Unknown or expired host choices must never enable collection. */\nexport function normalizeConsent(value: unknown): ConsentState {\n  return value === \"granted\" || value === \"denied\" ? value : \"pending\";\n}\n\nexport interface CorridoraAgentConfig {\n  /** Ingest base URL, e.g. https://ingest.corridora.io */\n  endpoint: string;\n  /** Ingest key sent as X-CORRIDORA-KEY. */\n  ingestKey: string;\n  /** logical service.name resource attribute. */\n  serviceName: string;\n  /** Current analytics choice supplied by the host CMP; defaults to pending. */\n  consent?: ConsentState;\n  /** Wait for analytics consent before collecting; defaults to true. */\n  requireAnalyticsConsent?: boolean;\n  /** OTLP/HTTP JSON transport; other encodings are unsupported. */\n  encoding?: \"json\";\n  /** Extra resource attributes merged onto every signal. */\n  resourceAttributes?: Record<string, string>;\n  /**\n   * @deprecated Compatibility no-op; omit this field. Logs and traces use\n   * standard OTLP paths. No direct metrics exporter is installed.\n   */\n  exportMode?: ExportMode;\n  /** Toggle performance/network/error instrumentation and optional content capture. */\n  plugins?: RumPluginConfig;\n  /** Redact sensitive URL parts before export. */\n  redactUrl?: RedactUrlFn;\n  /**\n   * Exact HTTPS origins that may receive browser trace context. Same-origin\n   * requests are eligible without being listed; wildcards are not supported.\n   */\n  tracePropagationOrigins?: string[];\n  /** Root trace sampling probability. Child spans follow their parent's decision. */\n  traceSampleRate?: number;\n  /** Log SPA path changes to the browser console. */\n  debug?: boolean;\n  /** Bounded operational diagnostics; exceptions from the callback are ignored. */\n  onDiagnostic?: (diagnostic: RumDiagnostic) => void;\n}\n\nexport interface RumDiagnostic {\n  code:\n    | \"initialization_failed\"\n    | \"consent_cleanup_failed\"\n    | \"export_failed\"\n    | \"cap_dropped\"\n    | \"replay_dropped\"\n    | \"replay_sampled\";\n  count: number;\n}\n\nexport interface ResolvedAgentConfig\n  extends Required<\n    Omit<\n      CorridoraAgentConfig,\n      | \"resourceAttributes\"\n      | \"plugins\"\n      | \"redactUrl\"\n      | \"tracePropagationOrigins\"\n      | \"debug\"\n      | \"onDiagnostic\"\n    >\n  > {\n  resourceAttributes: Record<string, string>;\n  plugins: Required<RumPluginConfig>;\n  redactUrl: RedactUrlFn;\n  tracePropagationOrigins: string[];\n  debug: boolean;\n  onDiagnostic?: (diagnostic: RumDiagnostic) => void;\n  /** Split OTLP signal endpoints derived from `endpoint`. */\n  signalEndpoints: {\n    traces: string;\n    /** @deprecated Compatibility URL only; no direct metrics export. */\n    metrics: string;\n    logs: string;\n  };\n}\n\nconst trimTrailingSlash = (url: string): string => url.replace(/\\/+$/, \"\");\n\n/**\n * Normalize ingest base URL. Strips accidental OTLP signal suffixes and legacy\n * proxy paths so the agent only ever POSTs to standard OTLP/HTTP paths:\n *   {base}/v1/traces | {base}/v1/metrics | {base}/v1/logs\n */\nexport function normalizeOtlpBase(endpoint: string): string {\n  let base = trimTrailingSlash(endpoint.trim());\n  // Strip a full signal path if the caller passed one by mistake.\n  base = base.replace(/\\/v1\\/(traces|metrics|logs)$/i, \"\");\n  // Legacy non-OTLP proxy prefixes (never used as POST targets).\n  base = base.replace(/\\/corridora-ingest$/i, \"\");\n  base = base.replace(/\\/otlp-http$/i, \"\");\n  return trimTrailingSlash(base);\n}\n\n/** Standard OTLP/HTTP signal paths under an ingest base URL. */\nexport function otlpSignalEndpoints(base: string): ResolvedAgentConfig[\"signalEndpoints\"] {\n  const root = trimTrailingSlash(base);\n  return {\n    traces: `${root}/v1/traces`,\n    metrics: `${root}/v1/metrics`,\n    logs: `${root}/v1/logs`,\n  };\n}\n\n/** Normalize, deduplicate, and safely reject non-HTTPS propagation origins. */\nexport function normalizeTracePropagationOrigins(origins?: readonly string[]): string[] {\n  const normalized = new Set<string>();\n  for (const raw of origins ?? []) {\n    try {\n      const url = new URL(raw.trim());\n      if (url.protocol === \"https:\" && !url.hostname.includes(\"*\")) {\n        normalized.add(url.origin);\n      }\n    } catch {\n      // Invalid entries never widen propagation.\n    }\n  }\n  return [...normalized];\n}\n\n/**\n * Normalizes user config and derives the split OTLP signal endpoints.\n * Pure and side-effect free so it is unit-testable without a browser.\n */\nexport function resolveConfig(config: CorridoraAgentConfig): ResolvedAgentConfig {\n  if (!config.endpoint?.trim()) throw new Error(\"CorridoraAgentConfig.endpoint is required\");\n  if (!config.ingestKey?.trim()) throw new Error(\"CorridoraAgentConfig.ingestKey is required\");\n  if (!config.serviceName?.trim()) throw new Error(\"CorridoraAgentConfig.serviceName is required\");\n  if (config.encoding !== undefined && config.encoding !== \"json\")\n    throw new Error(\"Only JSON encoding is supported\");\n  const traceSampleRate = config.traceSampleRate ?? 1;\n  if (!Number.isFinite(traceSampleRate) || traceSampleRate < 0 || traceSampleRate > 1) {\n    throw new Error(\"traceSampleRate must be between 0 and 1\");\n  }\n\n  const base = normalizeOtlpBase(config.endpoint);\n  const url = new URL(base);\n  if (\n    ![\"http:\", \"https:\"].includes(url.protocol) ||\n    url.username ||\n    url.password ||\n    url.search ||\n    url.hash\n  )\n    throw new Error(\n      \"endpoint must be an absolute HTTP(S) URL without credentials, query or fragment\",\n    );\n  return {\n    endpoint: base,\n    ingestKey: config.ingestKey.trim(),\n    serviceName: config.serviceName.trim(),\n    requireAnalyticsConsent: config.requireAnalyticsConsent !== false,\n    consent:\n      config.requireAnalyticsConsent === false ? \"granted\" : normalizeConsent(config.consent),\n    encoding: \"json\",\n    exportMode: config.exportMode ?? \"otlp\",\n    // An analytics grant does not authorize content capture. These require a\n    // separate purpose and remain unavailable in the first consent release.\n    plugins: Object.freeze({\n      ...resolvePlugins(config.plugins),\n      console: false,\n      userActions: false,\n      interactions: false,\n      domMutations: false,\n    }),\n    redactUrl: config.redactUrl ?? defaultRedactUrl,\n    tracePropagationOrigins: normalizeTracePropagationOrigins(config.tracePropagationOrigins),\n    traceSampleRate,\n    resourceAttributes: config.resourceAttributes ?? {},\n    debug: config.debug === true,\n    onDiagnostic: config.onDiagnostic,\n    signalEndpoints: otlpSignalEndpoints(base),\n  };\n}\n", "/** A capture epoch is never reopened: a later grant creates a different object. */\nexport interface CaptureEpoch {\n  /** Monotonic observation boundary, in performance.now() milliseconds. */\n  readonly startedAt: number;\n  isActive(): boolean;\n}\n\n/** Supplied by a host CMP so delayed browser tasks cannot outlive its choice. */\nexport interface ConsentOptions {\n  /** Expiry of the current host decision, in Date.now() milliseconds. */\n  expiresAt?: number;\n  /** Revalidate the current purpose and original host revision at every gate. */\n  isCurrent?: () => boolean;\n}\n\n/** A failed validity check permanently closes this epoch before notifying its owner. */\nexport function createCaptureEpoch(\n  options: ConsentOptions | undefined,\n  invalidated: () => void,\n  startedAt = performance.now(),\n  now: () => number = Date.now,\n): CaptureEpoch & { close(): void } {\n  const expiresAt = options?.expiresAt;\n  const isCurrent = options?.isCurrent;\n  let active = true;\n  let checking = false;\n  return {\n    startedAt,\n    close() {\n      active = false;\n    },\n    isActive() {\n      if (!active || checking) return false;\n      checking = true;\n      let valid = expiresAt === undefined || (Number.isSafeInteger(expiresAt) && expiresAt > now());\n      try {\n        if (valid && isCurrent !== undefined)\n          valid = typeof isCurrent === \"function\" && isCurrent() === true;\n      } catch {\n        valid = false;\n      } finally {\n        checking = false;\n      }\n      // The host callback may synchronously withdraw or replace this epoch.\n      if (!active) return false;\n      if (valid) return true;\n      active = false;\n      invalidated();\n      return false;\n    },\n  };\n}\n\n/** OTel timestamps are epoch-based seconds/nanoseconds, not observation offsets. */\nexport function isEpochTimestamp(\n  timestamp: readonly [number, number],\n  epoch: CaptureEpoch,\n  timeOrigin = performance.timeOrigin,\n): boolean {\n  return timestamp[0] * 1000 + timestamp[1] / 1e6 >= timeOrigin + epoch.startedAt;\n}\n\n/** Resource records can be emitted long after their observation started. */\nexport function isEpochResource(attributes: Record<string, unknown>, epoch: CaptureEpoch): boolean {\n  const start = Number(attributes[\"browser.resource_timing.fetch_start\"]);\n  if (!Number.isFinite(start) || start < epoch.startedAt) return false;\n  for (const key of [\"redirect_start\", \"worker_start\"]) {\n    const earlier = Number(attributes[`browser.resource_timing.${key}`]);\n    if (earlier > 0 && earlier < epoch.startedAt) return false;\n  }\n  // startTime includes redirects which fetchStart alone can miss. Reject an\n  // ambiguous match rather than assigning an earlier request to a later grant.\n  try {\n    const entries = performance.getEntriesByName(String(attributes[\"url.full\"] ?? \"\"), \"resource\");\n    const matches = entries.filter(\n      (entry) => (entry as PerformanceResourceTiming).fetchStart === start,\n    );\n    if (matches.length > 0) return matches.every((entry) => entry.startTime >= epoch.startedAt);\n  } catch {\n    return false;\n  }\n  return true;\n}\n", "import type { Emitter } from \"../types.ts\";\n\n/** Build SPA navigation log attrs; exported for unit tests / legacy callers. */\nexport function spaNavigationAttributes(\n  previousRoute: string,\n  nextRoute: string,\n  pageUrl: string,\n): Record<string, string> {\n  return {\n    \"navigation.type\": \"spa\",\n    \"page.route\": nextRoute,\n    \"page.route.previous\": previousRoute,\n    \"page.url\": pageUrl,\n  };\n}\n\nexport function longTaskAttributes(\n  entry: Pick<PerformanceEntry, \"name\" | \"duration\" | \"startTime\">,\n): Record<string, string> {\n  return {\n    \"browser.long_task.name\": entry.name || \"self\",\n    \"browser.long_task.duration\": String(entry.duration),\n    \"browser.long_task.start_time\": String(entry.startTime),\n  };\n}\n\nexport function startLongTaskPlugin(\n  emitter: Emitter,\n  startedAt = 0,\n  isActive: () => boolean = () => true,\n): () => void {\n  if (typeof PerformanceObserver === \"undefined\") return () => {};\n  try {\n    const observer = new PerformanceObserver((list) => {\n      for (const entry of list.getEntries()) {\n        if (!isActive() || entry.startTime < startedAt) continue;\n        emitter.emitLog({\n          eventName: \"browser.long_task\",\n          attributes: longTaskAttributes(entry),\n          startTimeMs: performance.timeOrigin + entry.startTime,\n        });\n      }\n    });\n    observer.observe({ type: \"longtask\", buffered: true });\n    return () => observer.disconnect();\n  } catch {\n    return () => {};\n  }\n}\n", "import { randomId } from \"./identity.ts\";\nexport interface NavigationIdentity {\n  id: string;\n  url: string;\n  sessionId: string;\n}\n/** Document measurements retain their origin when the SPA changes the visible URL. */\nexport function createNavigationContext(\n  url: string,\n  getSessionId: () => string,\n  newId: () => string = randomId,\n  now = () => performance.now(),\n) {\n  let document: NavigationIdentity = { id: newId(), url, sessionId: getSessionId() };\n  let current = document;\n  const history = [{ identity: document, at: 0 }];\n  return {\n    document: () => document,\n    current: () => {\n      const sessionId = getSessionId();\n      if (current.sessionId !== sessionId) {\n        current = { id: newId(), url: current.url, sessionId };\n        history.push({ identity: current, at: now() });\n        if (history.length > 64) history.shift();\n      }\n      return current;\n    },\n    navigate(nextUrl: string, sameDocument: boolean) {\n      current = sameDocument ? { id: newId(), url: nextUrl, sessionId: getSessionId() } : document;\n      if (sameDocument) {\n        history.push({ identity: current, at: now() });\n        if (history.length > 64) history.shift();\n      }\n      return current;\n    },\n    restore(nextUrl: string) {\n      document = { id: newId(), url: nextUrl, sessionId: getSessionId() };\n      current = document;\n      history.push({ identity: current, at: now() });\n      if (history.length > 64) history.shift();\n    },\n    reset(nextUrl: string) {\n      current = { id: newId(), url: nextUrl, sessionId: getSessionId() };\n      history.push({ identity: current, at: now() });\n      if (history.length > 64) history.shift();\n    },\n    at(relativeMs: number): NavigationIdentity | null {\n      return [...history].reverse().find((item) => item.at <= relativeMs)?.identity ?? null;\n    },\n  };\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.1';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VERSION } from '../version';\n\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n\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(\n  ownVersion: string\n): (globalVersion: string) => boolean {\n  const acceptedVersions = new Set<string>([ownVersion]);\n  const rejectedVersions = new Set<string>();\n\n  const myVersionMatch = ownVersion.match(re);\n  if (!myVersionMatch) {\n    // we cannot guarantee compatibility so we always return noop\n    return () => false;\n  }\n\n  const ownVersionParsed = {\n    major: +myVersionMatch[1],\n    minor: +myVersionMatch[2],\n    patch: +myVersionMatch[3],\n    prerelease: myVersionMatch[4],\n  };\n\n  // if ownVersion has a prerelease tag, versions must match exactly\n  if (ownVersionParsed.prerelease != null) {\n    return function isExactmatch(globalVersion: string): boolean {\n      return globalVersion === ownVersion;\n    };\n  }\n\n  function _reject(v: string) {\n    rejectedVersions.add(v);\n    return false;\n  }\n\n  function _accept(v: string) {\n    acceptedVersions.add(v);\n    return true;\n  }\n\n  return function isCompatible(globalVersion: string): boolean {\n    if (acceptedVersions.has(globalVersion)) {\n      return true;\n    }\n\n    if (rejectedVersions.has(globalVersion)) {\n      return false;\n    }\n\n    const 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\n    const globalVersionParsed = {\n      major: +globalVersionMatch[1],\n      minor: +globalVersionMatch[2],\n      patch: +globalVersionMatch[3],\n      prerelease: globalVersionMatch[4],\n    };\n\n    // if globalVersion has a prerelease tag, versions must match exactly\n    if (globalVersionParsed.prerelease != null) {\n      return _reject(globalVersion);\n    }\n\n    // major versions must match\n    if (ownVersionParsed.major !== globalVersionParsed.major) {\n      return _reject(globalVersion);\n    }\n\n    if (ownVersionParsed.major === 0) {\n      if (\n        ownVersionParsed.minor === globalVersionParsed.minor &&\n        ownVersionParsed.patch <= globalVersionParsed.patch\n      ) {\n        return _accept(globalVersion);\n      }\n\n      return _reject(globalVersion);\n    }\n\n    if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n      return _accept(globalVersion);\n    }\n\n    return _reject(globalVersion);\n  };\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 const isCompatible = _makeCompatibilityCheck(VERSION);\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport type { ContextManager } from '../context/types';\nimport type { DiagLogger } from '../diag/types';\nimport type { TextMapPropagator } from '../propagation/TextMapPropagator';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\n\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\n  `opentelemetry.js.api.${major}`\n);\n\ndeclare const self: unknown;\ndeclare const window: unknown;\ndeclare const global: unknown;\n\nconst _global = (\n  typeof globalThis === 'object'\n    ? globalThis\n    : typeof self === 'object'\n      ? self\n      : typeof window === 'object'\n        ? window\n        : typeof global === 'object'\n          ? global\n          : {}\n) as OTelGlobal;\n\nexport function registerGlobal<Type extends keyof OTelGlobalAPI>(\n  type: Type,\n  instance: OTelGlobalAPI[Type],\n  diag: DiagLogger,\n  allowOverride = false\n): boolean {\n  const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[\n    GLOBAL_OPENTELEMETRY_API_KEY\n  ] ?? {\n    version: VERSION,\n  });\n\n  if (!allowOverride && api[type]) {\n    // already registered an API of this type\n    const err = new Error(\n      `@opentelemetry/api: Attempted duplicate registration of API: ${type}`\n    );\n    diag.error(err.stack || err.message);\n    return false;\n  }\n\n  if (api.version !== VERSION) {\n    // All registered APIs must be of the same version exactly\n    const err = new Error(\n      `@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`\n    );\n    diag.error(err.stack || err.message);\n    return false;\n  }\n\n  api[type] = instance;\n  diag.debug(\n    `@opentelemetry/api: Registered a global for ${type} v${VERSION}.`\n  );\n\n  return true;\n}\n\nexport function getGlobal<Type extends keyof OTelGlobalAPI>(\n  type: Type\n): OTelGlobalAPI[Type] | undefined {\n  const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;\n  if (!globalVersion || !isCompatible(globalVersion)) {\n    return;\n  }\n  return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];\n}\n\nexport function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {\n  diag.debug(\n    `@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`\n  );\n  const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n\n  if (api) {\n    delete api[type];\n  }\n}\n\ntype OTelGlobal = {\n  [GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;\n};\n\ntype OTelGlobalAPI = {\n  version: string;\n\n  diag?: DiagLogger;\n  trace?: TracerProvider;\n  context?: ContextManager;\n  metrics?: MeterProvider;\n  propagation?: TextMapPropagator;\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getGlobal } from '../internal/global-utils';\nimport type { ComponentLoggerOptions, DiagLogger } from './types';\n\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 */\nexport class DiagComponentLogger implements DiagLogger {\n  private _namespace: string;\n\n  constructor(props: ComponentLoggerOptions) {\n    this._namespace = props.namespace || 'DiagComponentLogger';\n  }\n\n  public debug(...args: unknown[]): void {\n    return logProxy('debug', this._namespace, args);\n  }\n\n  public error(...args: unknown[]): void {\n    return logProxy('error', this._namespace, args);\n  }\n\n  public info(...args: unknown[]): void {\n    return logProxy('info', this._namespace, args);\n  }\n\n  public warn(...args: unknown[]): void {\n    return logProxy('warn', this._namespace, args);\n  }\n\n  public verbose(...args: unknown[]): void {\n    return logProxy('verbose', this._namespace, args);\n  }\n}\n\nfunction logProxy(\n  funcName: keyof DiagLogger,\n  namespace: string,\n  args: unknown[]\n): void {\n  const logger = getGlobal('diag');\n  // shortcut if logger not set\n  if (!logger) {\n    return;\n  }\n\n  return logger[funcName](namespace, ...args);\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport type DiagLogFunction = (message: string, ...args: unknown[]) => void;\n\n/**\n * Defines an internal diagnostic logger interface which is used to log internal diagnostic\n * messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.\n * API provided implementations include :-\n * - a No-Op {@link createNoopDiagLogger}\n * - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}\n * - a general Console {@link DiagConsoleLogger} version.\n *\n * @since 1.0.0\n */\nexport interface DiagLogger {\n  /** Log an error scenario that was not expected and caused the requested operation to fail. */\n  error: DiagLogFunction;\n\n  /**\n   * Log a warning scenario to inform the developer of an issues that should be investigated.\n   * The requested operation may or may not have succeeded or completed.\n   */\n  warn: DiagLogFunction;\n\n  /**\n   * Log a general informational message, this should not affect functionality.\n   * This is also the default logging level so this should NOT be used for logging\n   * debugging level information.\n   */\n  info: DiagLogFunction;\n\n  /**\n   * Log a general debug message that can be useful for identifying a failure.\n   * Information logged at this level may include diagnostic details that would\n   * help identify a failure scenario.\n   * For example: Logging the order of execution of async operations.\n   */\n  debug: DiagLogFunction;\n\n  /**\n   * Log a detailed (verbose) trace level logging that can be used to identify failures\n   * where debug level logging would be insufficient, this level of tracing can include\n   * input and output parameters and as such may include PII information passing through\n   * the API. As such it is recommended that this level of tracing should not be enabled\n   * in a production environment.\n   */\n  verbose: DiagLogFunction;\n}\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 enum DiagLogLevel {\n  /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n  NONE = 0,\n\n  /** Identifies an error scenario */\n  ERROR = 30,\n\n  /** Identifies a warning scenario */\n  WARN = 50,\n\n  /** General informational log message */\n  INFO = 60,\n\n  /** General debug log message */\n  DEBUG = 70,\n\n  /**\n   * Detailed trace level logging should only be used for development, should only be set\n   * in a development environment.\n   */\n  VERBOSE = 80,\n\n  /** Used to set the logging level to include all logging */\n  ALL = 9999,\n}\n\n/**\n * Defines options for ComponentLogger\n *\n * @since 1.0.0\n */\nexport interface ComponentLoggerOptions {\n  namespace: string;\n}\n\n/**\n * @since 1.4.1\n */\nexport interface DiagLoggerOptions {\n  /**\n   * The {@link DiagLogLevel} used to filter logs sent to the logger.\n   *\n   * @defaultValue DiagLogLevel.INFO\n   */\n  logLevel?: DiagLogLevel;\n\n  /**\n   * Setting this value to `true` will suppress the warning message normally emitted when registering a logger when another logger is already registered.\n   */\n  suppressOverrideMessage?: boolean;\n}\n\nexport interface DiagLoggerApi {\n  /**\n   * Set the global DiagLogger and DiagLogLevel.\n   * If a global diag logger is already set, this will override it.\n   *\n   * @param logger - The {@link DiagLogger} instance to set as the default logger.\n   * @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.\n   * @returns `true` if the logger was successfully registered, else `false`\n   */\n  setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;\n\n  /**\n   *\n   * @param logger - The {@link DiagLogger} instance to set as the default logger.\n   * @param logLevel - The {@link DiagLogLevel} used to filter logs sent to the logger. If not provided it will default to {@link DiagLogLevel.INFO}.\n   * @returns `true` if the logger was successfully registered, else `false`\n   */\n  setLogger(logger: DiagLogger, logLevel?: DiagLogLevel): boolean;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogFunction, DiagLogger } from '../types';\nimport { DiagLogLevel } from '../types';\n\nexport function createLogLevelDiagLogger(\n  maxLevel: DiagLogLevel,\n  logger: DiagLogger\n): DiagLogger {\n  if (maxLevel < DiagLogLevel.NONE) {\n    maxLevel = DiagLogLevel.NONE;\n  } else if (maxLevel > DiagLogLevel.ALL) {\n    maxLevel = DiagLogLevel.ALL;\n  }\n\n  // In case the logger is null or undefined\n  logger = logger || {};\n\n  function _filterFunc(\n    funcName: keyof DiagLogger,\n    theLevel: DiagLogLevel\n  ): DiagLogFunction {\n    const theFunc = logger[funcName];\n\n    if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n      return theFunc.bind(logger);\n    }\n    return function () {};\n  }\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", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport type {\n  ComponentLoggerOptions,\n  DiagLogFunction,\n  DiagLogger,\n  DiagLoggerApi,\n} from '../diag/types';\nimport { DiagLogLevel } from '../diag/types';\nimport {\n  getGlobal,\n  registerGlobal,\n  unregisterGlobal,\n} from '../internal/global-utils';\n\nconst API_NAME = 'diag';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n *\n * @since 1.0.0\n */\nexport class DiagAPI implements DiagLogger, DiagLoggerApi {\n  private static _instance?: DiagAPI;\n\n  /** Get the singleton instance of the DiagAPI API */\n  public static instance(): DiagAPI {\n    if (!this._instance) {\n      this._instance = new DiagAPI();\n    }\n\n    return this._instance;\n  }\n\n  /**\n   * Private internal constructor\n   * @private\n   */\n  private constructor() {\n    function _logProxy(funcName: keyof DiagLogger): DiagLogFunction {\n      return function (...args) {\n        const logger = getGlobal('diag');\n        // shortcut if logger not set\n        if (!logger) return;\n        return logger[funcName](...args);\n      };\n    }\n\n    // Using self local variable for minification purposes as 'this' cannot be minified\n    const self = this;\n\n    // DiagAPI specific functions\n\n    const setLogger: DiagLoggerApi['setLogger'] = (\n      logger,\n      optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }\n    ) => {\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        const err = new Error(\n          'Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'\n        );\n        self.error(err.stack ?? err.message);\n        return false;\n      }\n\n      if (typeof optionsOrLogLevel === 'number') {\n        optionsOrLogLevel = {\n          logLevel: optionsOrLogLevel,\n        };\n      }\n\n      const oldLogger = getGlobal('diag');\n      const newLogger = createLogLevelDiagLogger(\n        optionsOrLogLevel.logLevel ?? DiagLogLevel.INFO,\n        logger\n      );\n      // There already is an logger registered. We'll let it know before overwriting it.\n      if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n        const stack = new Error().stack ?? '<failed to generate stacktrace>';\n        oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n        newLogger.warn(\n          `Current logger will overwrite one already registered from ${stack}`\n        );\n      }\n\n      return registerGlobal('diag', newLogger, self, true);\n    };\n\n    self.setLogger = setLogger;\n\n    self.disable = () => {\n      unregisterGlobal(API_NAME, self);\n    };\n\n    self.createComponentLogger = (options: ComponentLoggerOptions) => {\n      return new DiagComponentLogger(options);\n    };\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\n  public setLogger!: DiagLoggerApi['setLogger'];\n  /**\n   *\n   */\n  public createComponentLogger!: (\n    options: ComponentLoggerOptions\n  ) => DiagLogger;\n\n  // DiagLogger implementation\n  public verbose!: DiagLogFunction;\n  public debug!: DiagLogFunction;\n  public info!: DiagLogFunction;\n  public warn!: DiagLogFunction;\n  public error!: DiagLogFunction;\n\n  /**\n   * Unregister the global logger and return to Noop\n   */\n  public disable!: () => void;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n  private _entries: Map<string, BaggageEntry>;\n\n  constructor(entries?: Map<string, BaggageEntry>) {\n    this._entries = entries ? new Map(entries) : new Map();\n  }\n\n  getEntry(key: string): BaggageEntry | undefined {\n    const entry = this._entries.get(key);\n    if (!entry) {\n      return undefined;\n    }\n\n    return Object.assign({}, entry);\n  }\n\n  getAllEntries(): [string, BaggageEntry][] {\n    return Array.from(this._entries.entries());\n  }\n\n  setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n    const newBaggage = new BaggageImpl(this._entries);\n    newBaggage._entries.set(key, entry);\n    return newBaggage;\n  }\n\n  removeEntry(key: string): BaggageImpl {\n    const newBaggage = new BaggageImpl(this._entries);\n    newBaggage._entries.delete(key);\n    return newBaggage;\n  }\n\n  removeEntries(...keys: string[]): BaggageImpl {\n    const newBaggage = new BaggageImpl(this._entries);\n    for (const key of keys) {\n      newBaggage._entries.delete(key);\n    }\n    return newBaggage;\n  }\n\n  clear(): BaggageImpl {\n    return new BaggageImpl();\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\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(\n  entries: Record<string, BaggageEntry> = {}\n): Baggage {\n  return new BaggageImpl(new Map(Object.entries(entries)));\n}\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 * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(\n  str: string\n): BaggageEntryMetadata {\n  if (typeof str !== 'string') {\n    diag.error(\n      `Cannot create baggage metadata from unknown type: ${typeof str}`\n    );\n    str = '';\n  }\n\n  return {\n    __TYPE__: baggageEntryMetadataSymbol,\n    toString() {\n      return str;\n    },\n  };\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from './types';\n\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description: string) {\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}\n\nclass BaseContext implements Context {\n  private _currentContext!: Map<symbol, unknown>;\n\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  constructor(parentContext?: Map<symbol, unknown>) {\n    // for minification\n    const self = this;\n\n    self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n    self.getValue = (key: symbol) => self._currentContext.get(key);\n\n    self.setValue = (key: symbol, value: unknown): Context => {\n      const context = new BaseContext(self._currentContext);\n      context._currentContext.set(key, value);\n      return context;\n    };\n\n    self.deleteValue = (key: symbol): Context => {\n      const context = new BaseContext(self._currentContext);\n      context._currentContext.delete(key);\n      return context;\n    };\n  }\n\n  /**\n   * Get a value from the context.\n   *\n   * @param key key which identifies a context value\n   */\n  public getValue!: (key: symbol) => unknown;\n\n  /**\n   * Create a new context which inherits from this context and has\n   * the given key set to the given value.\n   *\n   * @param key context key for which to set the value\n   * @param value value to set for the given key\n   */\n  public setValue!: (key: symbol, value: unknown) => Context;\n\n  /**\n   * Return a new context which inherits from this context but does\n   * not contain a value for the given key.\n   *\n   * @param key context key for which to clear a value\n   */\n  public deleteValue!: (key: symbol) => Context;\n}\n\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogger, DiagLogFunction } from './types';\n\ntype ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';\nconst consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [\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// Save original console methods at module load time, before any instrumentation\n// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.\n// Exported for testing only — not part of the public API.\nexport const _originalConsoleMethods: Partial<\n  Record<ConsoleMapKeys | 'log', typeof console.log>\n> = {};\nif (typeof console !== 'undefined') {\n  const keys: (ConsoleMapKeys | 'log')[] = [\n    'error',\n    'warn',\n    'info',\n    'debug',\n    'trace',\n    'log',\n  ];\n  for (const key of keys) {\n    // eslint-disable-next-line no-console\n    if (typeof console[key] === 'function') {\n      // eslint-disable-next-line no-console\n      _originalConsoleMethods[key] = console[key];\n    }\n  }\n}\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 *\n * @since 1.0.0\n */\nexport class DiagConsoleLogger implements DiagLogger {\n  constructor() {\n    function _consoleFunc(funcName: ConsoleMapKeys): DiagLogFunction {\n      return function (...args) {\n        // Prefer original (pre-instrumentation) methods saved at module load time.\n        let theFunc = _originalConsoleMethods[funcName];\n        // Some environments only expose the console when the F12 developer console is open\n        if (typeof theFunc !== 'function') {\n          theFunc = _originalConsoleMethods['log'];\n        }\n        // Fall back in case console was not available at module load time but became available later.\n        if (typeof theFunc !== 'function' && console) {\n          // eslint-disable-next-line no-console\n          theFunc = console[funcName];\n          if (typeof theFunc !== 'function') {\n            // eslint-disable-next-line no-console\n            theFunc = console.log;\n          }\n        }\n        if (typeof theFunc === 'function') {\n          return theFunc.apply(console, args);\n        }\n      };\n    }\n\n    for (let i = 0; i < consoleMap.length; i++) {\n      this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n    }\n  }\n\n  /** Log an error scenario that was not expected and caused the requested operation to fail. */\n  public error!: DiagLogFunction;\n\n  /**\n   * Log a warning scenario to inform the developer of an issues that should be investigated.\n   * The requested operation may or may not have succeeded or completed.\n   */\n  public warn!: DiagLogFunction;\n\n  /**\n   * Log a general informational message, this should not affect functionality.\n   * This is also the default logging level so this should NOT be used for logging\n   * debugging level information.\n   */\n  public info!: DiagLogFunction;\n\n  /**\n   * Log a general debug message that can be useful for identifying a failure.\n   * Information logged at this level may include diagnostic details that would\n   * help identify a failure scenario. Useful scenarios would be to log the execution\n   * order of async operations\n   */\n  public debug!: DiagLogFunction;\n\n  /**\n   * Log a detailed (verbose) trace level logging that can be used to identify failures\n   * where debug level logging would be insufficient, this level of tracing can include\n   * input and output parameters and as such may include PII information passing through\n   * the API. As such it is recommended that this level of tracing should not be enabled\n   * in a production environment.\n   */\n  public verbose!: DiagLogFunction;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter } from './Meter';\nimport type {\n  BatchObservableCallback,\n  Counter,\n  Gauge,\n  Histogram,\n  MetricAttributes,\n  MetricOptions,\n  Observable,\n  ObservableCallback,\n  ObservableCounter,\n  ObservableGauge,\n  ObservableUpDownCounter,\n  UpDownCounter,\n} from './Metric';\n\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter implements Meter {\n  constructor() {}\n\n  /**\n   * @see {@link Meter.createGauge}\n   */\n  createGauge(_name: string, _options?: MetricOptions): Gauge {\n    return NOOP_GAUGE_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createHistogram}\n   */\n  createHistogram(_name: string, _options?: MetricOptions): Histogram {\n    return NOOP_HISTOGRAM_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createCounter}\n   */\n  createCounter(_name: string, _options?: MetricOptions): Counter {\n    return NOOP_COUNTER_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createUpDownCounter}\n   */\n  createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter {\n    return NOOP_UP_DOWN_COUNTER_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createObservableGauge}\n   */\n  createObservableGauge(\n    _name: string,\n    _options?: MetricOptions\n  ): ObservableGauge {\n    return NOOP_OBSERVABLE_GAUGE_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createObservableCounter}\n   */\n  createObservableCounter(\n    _name: string,\n    _options?: MetricOptions\n  ): ObservableCounter {\n    return NOOP_OBSERVABLE_COUNTER_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.createObservableUpDownCounter}\n   */\n  createObservableUpDownCounter(\n    _name: string,\n    _options?: MetricOptions\n  ): ObservableUpDownCounter {\n    return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n  }\n\n  /**\n   * @see {@link Meter.addBatchObservableCallback}\n   */\n  addBatchObservableCallback(\n    _callback: BatchObservableCallback,\n    _observables: Observable[]\n  ): void {}\n\n  /**\n   * @see {@link Meter.removeBatchObservableCallback}\n   */\n  removeBatchObservableCallback(_callback: BatchObservableCallback): void {}\n}\n\nexport class NoopMetric {}\n\nexport class NoopCounterMetric extends NoopMetric implements Counter {\n  add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopUpDownCounterMetric\n  extends NoopMetric\n  implements UpDownCounter\n{\n  add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopGaugeMetric extends NoopMetric implements Gauge {\n  record(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopHistogramMetric extends NoopMetric implements Histogram {\n  record(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopObservableMetric {\n  addCallback(_callback: ObservableCallback) {}\n\n  removeCallback(_callback: ObservableCallback) {}\n}\n\nexport class NoopObservableCounterMetric\n  extends NoopObservableMetric\n  implements ObservableCounter {}\n\nexport class NoopObservableGaugeMetric\n  extends NoopObservableMetric\n  implements ObservableGauge {}\n\nexport class NoopObservableUpDownCounterMetric\n  extends NoopObservableMetric\n  implements ObservableUpDownCounter {}\n\nexport const NOOP_METER = new NoopMeter();\n\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC =\n  new NoopObservableUpDownCounterMetric();\n\n/**\n * Create a no-op Meter\n *\n * @since 1.3.0\n */\nexport function createNoopMeter(): Meter {\n  return NOOP_METER;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\n\n/**\n * Injects `Context` into and extracts it from carriers that travel\n * in-band across process boundaries. Encoding is expected to conform to the\n * HTTP Header Field semantics. Values are often encoded as RPC/HTTP request\n * headers.\n *\n * The carrier of propagated data on both the client (injector) and server\n * (extractor) side is usually an object such as http headers. Propagation is\n * usually implemented via library-specific request interceptors, where the\n * client-side injects values and the server-side extracts them.\n *\n * @since 1.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TextMapPropagator<Carrier = any> {\n  /**\n   * Injects values from a given `Context` into a carrier.\n   *\n   * OpenTelemetry defines a common set of format values (TextMapPropagator),\n   * and each has an expected `carrier` type.\n   *\n   * @param context the Context from which to extract values to transmit over\n   *     the wire.\n   * @param carrier the carrier of propagation fields, such as http request\n   *     headers.\n   * @param setter an optional {@link TextMapSetter}. If undefined, values will be\n   *     set by direct object assignment.\n   */\n  inject(\n    context: Context,\n    carrier: Carrier,\n    setter: TextMapSetter<Carrier>\n  ): void;\n\n  /**\n   * Given a `Context` and a carrier, extract context values from a\n   * carrier and return a new context, created from the old context, with the\n   * extracted values.\n   *\n   * @param context the Context from which to extract values to transmit over\n   *     the wire.\n   * @param carrier the carrier of propagation fields, such as http request\n   *     headers.\n   * @param getter an optional {@link TextMapGetter}. If undefined, keys will be all\n   *     own properties, and keys will be accessed by direct object access.\n   */\n  extract(\n    context: Context,\n    carrier: Carrier,\n    getter: TextMapGetter<Carrier>\n  ): Context;\n\n  /**\n   * Return a list of all fields which may be used by the propagator.\n   */\n  fields(): string[];\n}\n\n/**\n * A setter is specified by the caller to define a specific method\n * to set key/value pairs on the carrier within a propagator\n *\n * @since 1.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TextMapSetter<Carrier = any> {\n  /**\n   * Callback used to set a key/value pair on an object.\n   *\n   * Should be called by the propagator each time a key/value pair\n   * should be set, and should set that key/value pair on the propagator.\n   *\n   * @param carrier object or class which carries key/value pairs\n   * @param key string key to modify\n   * @param value value to be set to the key on the carrier\n   */\n  set(carrier: Carrier, key: string, value: string): void;\n}\n\n/**\n * A getter is specified by the caller to define a specific method\n * to get the value of a key from a carrier.\n *\n * @since 1.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TextMapGetter<Carrier = any> {\n  /**\n   * Get a list of all keys available on the carrier.\n   *\n   * @param carrier\n   */\n  keys(carrier: Carrier): string[];\n\n  /**\n   * Get the value of a specific key from the carrier.\n   *\n   * @param carrier\n   * @param key\n   */\n  get(carrier: Carrier, key: string): undefined | string | string[];\n}\n\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapGetter: TextMapGetter = {\n  get(carrier, key) {\n    if (carrier == null) {\n      return undefined;\n    }\n    return carrier[key];\n  },\n\n  keys(carrier) {\n    if (carrier == null) {\n      return [];\n    }\n    return Object.keys(carrier);\n  },\n};\n\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapSetter: TextMapSetter = {\n  set(carrier, key, value) {\n    if (carrier == null) {\n      return;\n    }\n\n    carrier[key] = value;\n  },\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport type * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n  active(): types.Context {\n    return ROOT_CONTEXT;\n  }\n\n  with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n    _context: types.Context,\n    fn: F,\n    thisArg?: ThisParameterType<F>,\n    ...args: A\n  ): ReturnType<F> {\n    return fn.call(thisArg, ...args);\n  }\n\n  bind<T>(_context: types.Context, target: T): T {\n    return target;\n  }\n\n  enable(): this {\n    return this;\n  }\n\n  disable(): this {\n    return this;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport type { Context, ContextManager } from '../context/types';\nimport {\n  getGlobal,\n  registerGlobal,\n  unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n  private static _instance?: ContextAPI;\n\n  /** Empty private constructor prevents end users from constructing a new instance of the API */\n  private constructor() {}\n\n  /** Get the singleton instance of the Context API */\n  public static getInstance(): ContextAPI {\n    if (!this._instance) {\n      this._instance = new ContextAPI();\n    }\n\n    return this._instance;\n  }\n\n  /**\n   * Set the current context manager.\n   *\n   * @returns true if the context manager was successfully registered, else false\n   */\n  public setGlobalContextManager(contextManager: ContextManager): boolean {\n    return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n  }\n\n  /**\n   * Get the currently active context\n   */\n  public active(): Context {\n    return this._getContextManager().active();\n  }\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  public with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n    context: Context,\n    fn: F,\n    thisArg?: ThisParameterType<F>,\n    ...args: A\n  ): ReturnType<F> {\n    return this._getContextManager().with(context, fn, thisArg, ...args);\n  }\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  public bind<T>(context: Context, target: T): T {\n    return this._getContextManager().bind(context, target);\n  }\n\n  private _getContextManager(): ContextManager {\n    return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n  }\n\n  /** Disable and remove the global context manager */\n  public disable() {\n    this._getContextManager().disable();\n    unregisterGlobal(API_NAME, DiagAPI.instance());\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport enum TraceFlags {\n  /** Represents no flag set. */\n  NONE = 0x0,\n  /** Bit to represent whether trace is sampled in trace flags. */\n  SAMPLED = 0x1 << 0,\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { SpanContext } from './span_context';\nimport { TraceFlags } from './trace_flags';\n\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPANID = '0000000000000000';\n\n/**\n * @since 1.0.0\n */\nexport const INVALID_TRACEID = '00000000000000000000000000000000';\n\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPAN_CONTEXT: SpanContext = {\n  traceId: INVALID_TRACEID,\n  spanId: INVALID_SPANID,\n  traceFlags: TraceFlags.NONE,\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Exception } from '../common/Exception';\nimport type { TimeInput } from '../common/Time';\nimport type { SpanAttributes } from './attributes';\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\nimport type { Span } from './span';\nimport type { SpanContext } from './span_context';\nimport type { SpanStatus } from './status';\nimport type { Link } from './link';\n\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 */\nexport class NonRecordingSpan implements Span {\n  private readonly _spanContext: SpanContext;\n\n  constructor(spanContext: SpanContext = INVALID_SPAN_CONTEXT) {\n    this._spanContext = spanContext;\n  }\n\n  // Returns a SpanContext.\n  spanContext(): SpanContext {\n    return this._spanContext;\n  }\n\n  // By default does nothing\n  setAttribute(_key: string, _value: unknown): this {\n    return this;\n  }\n\n  // By default does nothing\n  setAttributes(_attributes: SpanAttributes): this {\n    return this;\n  }\n\n  // By default does nothing\n  addEvent(_name: string, _attributes?: SpanAttributes): this {\n    return this;\n  }\n\n  addLink(_link: Link): this {\n    return this;\n  }\n\n  addLinks(_links: Link[]): this {\n    return this;\n  }\n\n  // By default does nothing\n  setStatus(_status: SpanStatus): this {\n    return this;\n  }\n\n  // By default does nothing\n  updateName(_name: string): this {\n    return this;\n  }\n\n  // By default does nothing\n  end(_endTime?: TimeInput): void {}\n\n  // isRecording always returns false for NonRecordingSpan.\n  isRecording(): boolean {\n    return false;\n  }\n\n  // By default does nothing\n  recordException(_exception: Exception, _time?: TimeInput): void {}\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createContextKey } from '../context/context';\nimport type { Context } from '../context/types';\nimport type { Span } from './span';\nimport type { SpanContext } from './span_context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n\n/**\n * span key\n */\nconst SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context: Context): Span | undefined {\n  return (context.getValue(SPAN_KEY) as Span) || undefined;\n}\n\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan(): Span | undefined {\n  return getSpan(ContextAPI.getInstance().active());\n}\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: Context, span: Span): Context {\n  return context.setValue(SPAN_KEY, span);\n}\n\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context: Context): Context {\n  return context.deleteValue(SPAN_KEY);\n}\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(\n  context: Context,\n  spanContext: SpanContext\n): Context {\n  return setSpan(context, new NonRecordingSpan(spanContext));\n}\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: Context): SpanContext | undefined {\n  return getSpan(context)?.spanContext();\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport type { Span } from './span';\nimport type { SpanContext } from './span_context';\n\n// Valid characters (0-9, a-f, A-F) are marked as 1.\nconst isHex = new Uint8Array([\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n]);\n\nfunction isValidHex(id: string, length: number): boolean {\n  // As of 1.9.0 the id was allowed to be a non-string value,\n  // even though it was not possible in the types.\n  if (typeof id !== 'string' || id.length !== length) return false;\n\n  let r = 0;\n  for (let i = 0; i < id.length; i += 4) {\n    r +=\n      (isHex[id.charCodeAt(i)] | 0) +\n      (isHex[id.charCodeAt(i + 1)] | 0) +\n      (isHex[id.charCodeAt(i + 2)] | 0) +\n      (isHex[id.charCodeAt(i + 3)] | 0);\n  }\n\n  return r === length;\n}\n\n/**\n * @since 1.0.0\n */\nexport function isValidTraceId(traceId: string): boolean {\n  return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;\n}\n\n/**\n * @since 1.0.0\n */\nexport function isValidSpanId(spanId: string): boolean {\n  return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;\n}\n\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n *\n * @since 1.0.0\n */\nexport function isSpanContextValid(spanContext: SpanContext): boolean {\n  return (\n    isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)\n  );\n}\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: SpanContext): Span {\n  return new NonRecordingSpan(spanContext);\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ContextAPI } from '../api/context';\nimport type { Context } from '../context/types';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport type { Span } from './span';\nimport { isSpanContextValid } from './spancontext-utils';\nimport type { SpanOptions } from './SpanOptions';\nimport type { SpanContext } from './span_context';\nimport type { Tracer } from './tracer';\n\nconst contextApi = ContextAPI.getInstance();\n\n/**\n * No-op implementations of {@link Tracer}.\n */\nexport class NoopTracer implements Tracer {\n  // startSpan starts a noop span.\n  startSpan(\n    name: string,\n    options?: SpanOptions,\n    context = contextApi.active()\n  ): Span {\n    const root = Boolean(options?.root);\n    if (root) {\n      return new NonRecordingSpan();\n    }\n\n    const parentFromContext = context && getSpanContext(context);\n\n    if (\n      isSpanContext(parentFromContext) &&\n      isSpanContextValid(parentFromContext)\n    ) {\n      return new NonRecordingSpan(parentFromContext);\n    } else {\n      return new NonRecordingSpan();\n    }\n  }\n\n  startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n    name: string,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n    name: string,\n    opts: SpanOptions | undefined,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n    name: string,\n    opts: SpanOptions | undefined,\n    ctx: Context | undefined,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n    name: string,\n    arg2?: F | SpanOptions,\n    arg3?: F | Context,\n    arg4?: F\n  ): ReturnType<F> | undefined {\n    let opts: SpanOptions | undefined;\n    let ctx: Context | undefined;\n    let fn: F;\n\n    if (arguments.length < 2) {\n      return;\n    } else if (arguments.length === 2) {\n      fn = arg2 as F;\n    } else if (arguments.length === 3) {\n      opts = arg2 as SpanOptions | undefined;\n      fn = arg3 as F;\n    } else {\n      opts = arg2 as SpanOptions | undefined;\n      ctx = arg3 as Context | undefined;\n      fn = arg4 as F;\n    }\n\n    const parentContext = ctx ?? contextApi.active();\n    const span = this.startSpan(name, opts, parentContext);\n    const contextWithSpanSet = setSpan(parentContext, span);\n\n    return contextApi.with(contextWithSpanSet, fn, undefined, span);\n  }\n}\n\nfunction isSpanContext(spanContext: unknown): spanContext is SpanContext {\n  return (\n    spanContext !== null &&\n    typeof spanContext === 'object' &&\n    'spanId' in spanContext &&\n    typeof spanContext['spanId'] === 'string' &&\n    'traceId' in spanContext &&\n    typeof spanContext['traceId'] === 'string' &&\n    'traceFlags' in spanContext &&\n    typeof spanContext['traceFlags'] === 'number'\n  );\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport { NoopTracer } from './NoopTracer';\nimport type { Span } from './span';\nimport type { SpanOptions } from './SpanOptions';\nimport type { Tracer } from './tracer';\nimport type { TracerOptions } from './tracer_options';\n\nconst NOOP_TRACER = new NoopTracer();\n\n/**\n * Proxy tracer provided by the proxy tracer provider\n *\n * @since 1.0.0\n */\nexport class ProxyTracer implements Tracer {\n  // When a real implementation is provided, this will be it\n  private _delegate?: Tracer;\n  private _provider: TracerDelegator;\n  public readonly name: string;\n  public readonly version?: string;\n  public readonly options?: TracerOptions;\n\n  constructor(\n    provider: TracerDelegator,\n    name: string,\n    version?: string,\n    options?: TracerOptions\n  ) {\n    this._provider = provider;\n    this.name = name;\n    this.version = version;\n    this.options = options;\n  }\n\n  startSpan(name: string, options?: SpanOptions, context?: Context): Span {\n    return this._getTracer().startSpan(name, options, context);\n  }\n\n  startActiveSpan<F extends (span: Span) => unknown>(\n    _name: string,\n    _options: F | SpanOptions,\n    _context?: F | Context,\n    _fn?: F\n  ): ReturnType<F> {\n    const tracer = this._getTracer();\n    return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n  }\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  private _getTracer() {\n    if (this._delegate) {\n      return this._delegate;\n    }\n\n    const tracer = this._provider.getDelegateTracer(\n      this.name,\n      this.version,\n      this.options\n    );\n\n    if (!tracer) {\n      return NOOP_TRACER;\n    }\n\n    this._delegate = tracer;\n    return this._delegate;\n  }\n}\n\n/**\n * @since 1.0.3\n */\nexport interface TracerDelegator {\n  getDelegateTracer(\n    name: string,\n    version?: string,\n    options?: TracerOptions\n  ): Tracer | undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NoopTracer } from './NoopTracer';\nimport type { Tracer } from './tracer';\nimport type { TracerOptions } from './tracer_options';\nimport type { TracerProvider } from './tracer_provider';\n\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 */\nexport class NoopTracerProvider implements TracerProvider {\n  getTracer(\n    _name?: string,\n    _version?: string,\n    _options?: TracerOptions\n  ): Tracer {\n    return new NoopTracer();\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Tracer } from './tracer';\nimport type { TracerProvider } from './tracer_provider';\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nimport type { TracerOptions } from './tracer_options';\n\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n\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 *\n * @deprecated This will be removed in the next major version.\n * @since 1.0.0\n */\nexport class ProxyTracerProvider implements TracerProvider {\n  private _delegate?: TracerProvider;\n\n  /**\n   * Get a {@link ProxyTracer}\n   */\n  getTracer(name: string, version?: string, options?: TracerOptions): Tracer {\n    return (\n      this.getDelegateTracer(name, version, options) ??\n      new ProxyTracer(this, name, version, options)\n    );\n  }\n\n  getDelegate(): TracerProvider {\n    return this._delegate ?? NOOP_TRACER_PROVIDER;\n  }\n\n  /**\n   * Set the delegate tracer provider\n   */\n  setDelegate(delegate: TracerProvider) {\n    this._delegate = delegate;\n  }\n\n  getDelegateTracer(\n    name: string,\n    version?: string,\n    options?: TracerOptions\n  ): Tracer | undefined {\n    return this._delegate?.getTracer(name, version, options);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { SpanAttributes } from './attributes';\nimport type { TraceState } from './trace_state';\n\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n *\n * @since 1.0.0\n */\nexport enum SamplingDecision {\n  /**\n   * `Span.isRecording() === false`, span will not be recorded and all events\n   * and attributes will be dropped.\n   */\n  NOT_RECORD,\n  /**\n   * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n   * MUST NOT be set.\n   */\n  RECORD,\n  /**\n   * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n   * MUST be set.\n   */\n  RECORD_AND_SAMPLED,\n}\n\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling result contains a decision for a {@link Span} and additional\n * attributes the sampler would like to added to the Span.\n *\n * @since 1.0.0\n */\nexport interface SamplingResult {\n  /**\n   * A sampling decision, refer to {@link SamplingDecision} for details.\n   */\n  decision: SamplingDecision;\n  /**\n   * The list of attributes returned by SamplingResult MUST be immutable.\n   * Caller may call {@link Sampler}.shouldSample any number of times and\n   * can safely cache the returned value.\n   */\n  attributes?: Readonly<SpanAttributes>;\n  /**\n   * A {@link TraceState} that will be associated with the {@link Span} through\n   * the new {@link SpanContext}. Samplers SHOULD return the TraceState from\n   * the passed-in {@link Context} if they do not intend to change it. Leaving\n   * the value undefined will also leave the TraceState unchanged.\n   */\n  traceState?: TraceState;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport enum SpanKind {\n  /** Default value. Indicates that the span is used internally. */\n  INTERNAL = 0,\n\n  /**\n   * Indicates that the span covers server-side handling of an RPC or other\n   * remote request.\n   */\n  SERVER = 1,\n\n  /**\n   * Indicates that the span covers the client-side wrapper around an RPC or\n   * other remote request.\n   */\n  CLIENT = 2,\n\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  PRODUCER = 3,\n\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  CONSUMER = 4,\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface SpanStatus {\n  /** The status code of this message. */\n  code: SpanStatusCode;\n  /** A developer-facing error message. */\n  message?: string;\n}\n\n/**\n * An enumeration of status codes.\n *\n * @since 1.0.0\n */\nexport enum SpanStatusCode {\n  /**\n   * The default status.\n   */\n  UNSET = 0,\n  /**\n   * The operation has been validated by an Application developer or\n   * Operator to have completed successfully.\n   */\n  OK = 1,\n  /**\n   * The operation contains an error.\n   */\n  ERROR = 2,\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\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 *\n * @since 1.0.0\n */\nexport const diag = DiagAPI.instance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from './Meter';\nimport type { MeterProvider } from './MeterProvider';\nimport { NOOP_METER } from './NoopMeter';\n\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nexport class NoopMeterProvider implements MeterProvider {\n  getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter {\n    return NOOP_METER;\n  }\n}\n\nexport const NOOP_METER_PROVIDER = new NoopMeterProvider();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from '../metrics/Meter';\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport {\n  getGlobal,\n  registerGlobal,\n  unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'metrics';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nexport class MetricsAPI {\n  private static _instance?: MetricsAPI;\n\n  /** Empty private constructor prevents end users from constructing a new instance of the API */\n  private constructor() {}\n\n  /** Get the singleton instance of the Metrics API */\n  public static getInstance(): MetricsAPI {\n    if (!this._instance) {\n      this._instance = new MetricsAPI();\n    }\n\n    return this._instance;\n  }\n\n  /**\n   * Set the current global meter provider.\n   * Returns true if the meter provider was successfully registered, else false.\n   */\n  public setGlobalMeterProvider(provider: MeterProvider): boolean {\n    return registerGlobal(API_NAME, provider, DiagAPI.instance());\n  }\n\n  /**\n   * Returns the global meter provider.\n   */\n  public getMeterProvider(): MeterProvider {\n    return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n  }\n\n  /**\n   * Returns a meter from the global meter provider.\n   */\n  public getMeter(\n    name: string,\n    version?: string,\n    options?: MeterOptions\n  ): Meter {\n    return this.getMeterProvider().getMeter(name, version, options);\n  }\n\n  /** Remove the global meter provider */\n  public disable(): void {\n    unregisterGlobal(API_NAME, DiagAPI.instance());\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { MetricsAPI } from './api/metrics';\n/**\n * Entrypoint for metrics API\n *\n * @since 1.3.0\n */\nexport const metrics = MetricsAPI.getInstance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport type { TextMapPropagator } from './TextMapPropagator';\n\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator implements TextMapPropagator {\n  /** Noop inject function does nothing */\n  inject(_context: Context, _carrier: unknown): void {}\n  /** Noop extract function does nothing and returns the input context */\n  extract(context: Context, _carrier: unknown): Context {\n    return context;\n  }\n  fields(): string[] {\n    return [];\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\nimport type { Context } from '../context/types';\nimport type { Baggage } from './types';\n\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n\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: Context): Baggage | undefined {\n  return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;\n}\n\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage(): Baggage | undefined {\n  return getBaggage(ContextAPI.getInstance().active());\n}\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: Context, baggage: Baggage): Context {\n  return context.setValue(BAGGAGE_KEY, baggage);\n}\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: Context): Context {\n  return context.deleteValue(BAGGAGE_KEY);\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport {\n  getGlobal,\n  registerGlobal,\n  unregisterGlobal,\n} from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport type {\n  TextMapGetter,\n  TextMapPropagator,\n  TextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n  defaultTextMapGetter,\n  defaultTextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n  getBaggage,\n  getActiveBaggage,\n  setBaggage,\n  deleteBaggage,\n} from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n  private static _instance?: PropagationAPI;\n\n  /** Empty private constructor prevents end users from constructing a new instance of the API */\n  private constructor() {}\n\n  /** Get the singleton instance of the Propagator API */\n  public static getInstance(): PropagationAPI {\n    if (!this._instance) {\n      this._instance = new PropagationAPI();\n    }\n\n    return this._instance;\n  }\n\n  /**\n   * Set the current propagator.\n   *\n   * @returns true if the propagator was successfully registered, else false\n   */\n  public setGlobalPropagator(propagator: TextMapPropagator): boolean {\n    return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n  }\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  public inject<Carrier>(\n    context: Context,\n    carrier: Carrier,\n    setter: TextMapSetter<Carrier> = defaultTextMapSetter\n  ): void {\n    return this._getGlobalPropagator().inject(context, carrier, setter);\n  }\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  public extract<Carrier>(\n    context: Context,\n    carrier: Carrier,\n    getter: TextMapGetter<Carrier> = defaultTextMapGetter\n  ): Context {\n    return this._getGlobalPropagator().extract(context, carrier, getter);\n  }\n\n  /**\n   * Return a list of all fields which may be used by the propagator.\n   */\n  public fields(): string[] {\n    return this._getGlobalPropagator().fields();\n  }\n\n  /** Remove the global propagator */\n  public disable() {\n    unregisterGlobal(API_NAME, DiagAPI.instance());\n  }\n\n  public createBaggage = createBaggage;\n\n  public getBaggage = getBaggage;\n\n  public getActiveBaggage = getActiveBaggage;\n\n  public setBaggage = setBaggage;\n\n  public deleteBaggage = deleteBaggage;\n\n  private _getGlobalPropagator(): TextMapPropagator {\n    return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/**\n * Entrypoint for propagation API\n *\n * @since 1.0.0\n */\nexport const propagation = PropagationAPI.getInstance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n  getGlobal,\n  registerGlobal,\n  unregisterGlobal,\n} from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport {\n  isSpanContextValid,\n  wrapSpanContext,\n} from '../trace/spancontext-utils';\nimport type { Tracer } from '../trace/tracer';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport {\n  deleteSpan,\n  getActiveSpan,\n  getSpan,\n  getSpanContext,\n  setSpan,\n  setSpanContext,\n} from '../trace/context-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'trace';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n  private static _instance?: TraceAPI;\n\n  private _proxyTracerProvider = new ProxyTracerProvider();\n\n  /** Empty private constructor prevents end users from constructing a new instance of the API */\n  private constructor() {}\n\n  /** Get the singleton instance of the Trace API */\n  public static getInstance(): TraceAPI {\n    if (!this._instance) {\n      this._instance = new TraceAPI();\n    }\n\n    return this._instance;\n  }\n\n  /**\n   * Set the current global tracer.\n   *\n   * @returns true if the tracer provider was successfully registered, else false\n   */\n  public setGlobalTracerProvider(provider: TracerProvider): boolean {\n    const success = registerGlobal(\n      API_NAME,\n      this._proxyTracerProvider,\n      DiagAPI.instance()\n    );\n    if (success) {\n      this._proxyTracerProvider.setDelegate(provider);\n    }\n    return success;\n  }\n\n  /**\n   * Returns the global tracer provider.\n   */\n  public getTracerProvider(): TracerProvider {\n    return getGlobal(API_NAME) || this._proxyTracerProvider;\n  }\n\n  /**\n   * Returns a tracer from the global tracer provider.\n   */\n  public getTracer(name: string, version?: string): Tracer {\n    return this.getTracerProvider().getTracer(name, version);\n  }\n\n  /** Remove the global tracer provider */\n  public disable() {\n    unregisterGlobal(API_NAME, DiagAPI.instance());\n    this._proxyTracerProvider = new ProxyTracerProvider();\n  }\n\n  public wrapSpanContext = wrapSpanContext;\n\n  public isSpanContextValid = isSpanContextValid;\n\n  public deleteSpan = deleteSpan;\n\n  public getSpan = getSpan;\n\n  public getActiveSpan = getActiveSpan;\n\n  public getSpanContext = getSpanContext;\n\n  public setSpan = setSpan;\n\n  public setSpanContext = setSpanContext;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n\n/**\n * Entrypoint for trace API\n *\n * @since 1.0.0\n */\nexport const trace = TraceAPI.getInstance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context, TimeInput } from '@opentelemetry/api';\nimport type { AnyValue, AnyValueMap } from './AnyValue';\n\nexport type LogBody = AnyValue;\nexport type LogAttributes = AnyValueMap;\n\nexport enum SeverityNumber {\n  UNSPECIFIED = 0,\n  TRACE = 1,\n  TRACE2 = 2,\n  TRACE3 = 3,\n  TRACE4 = 4,\n  DEBUG = 5,\n  DEBUG2 = 6,\n  DEBUG3 = 7,\n  DEBUG4 = 8,\n  INFO = 9,\n  INFO2 = 10,\n  INFO3 = 11,\n  INFO4 = 12,\n  WARN = 13,\n  WARN2 = 14,\n  WARN3 = 15,\n  WARN4 = 16,\n  ERROR = 17,\n  ERROR2 = 18,\n  ERROR3 = 19,\n  ERROR4 = 20,\n  FATAL = 21,\n  FATAL2 = 22,\n  FATAL3 = 23,\n  FATAL4 = 24,\n}\n\nexport interface LogRecord {\n  /**\n   * The unique identifier for the log record.\n   */\n  eventName?: string;\n\n  /**\n   * The time when the log record occurred as UNIX Epoch time in nanoseconds.\n   */\n  timestamp?: TimeInput;\n\n  /**\n   * Time when the event was observed by the collection system.\n   */\n  observedTimestamp?: TimeInput;\n\n  /**\n   * Numerical value of the severity.\n   */\n  severityNumber?: SeverityNumber;\n\n  /**\n   * The severity text.\n   */\n  severityText?: string;\n\n  /**\n   * A value containing the body of the log record.\n   */\n  body?: LogBody;\n\n  /**\n   * Attributes that define the log record.\n   */\n  attributes?: LogAttributes;\n\n  /**\n   * An exception (or error) associated with the log record.\n   *\n   * @experimental\n   */\n  exception?: unknown;\n\n  /**\n   * The Context associated with the LogRecord.\n   */\n  context?: Context;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Logger } from './types/Logger';\nimport type { LogRecord } from './types/LogRecord';\n\nexport class NoopLogger implements Logger {\n  emit(_logRecord: LogRecord): void {}\n  enabled(): boolean {\n    return false;\n  }\n}\n\nexport const NOOP_LOGGER = new NoopLogger();\n\n/**\n * Create a no-op Logger\n */\nexport function createNoopLogger(): Logger {\n  return NOOP_LOGGER;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LoggerProvider } from '../types/LoggerProvider';\n\nexport const GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs');\n\ntype Get<T> = (version: number) => T;\ntype OtelGlobal = Partial<{\n  [GLOBAL_LOGS_API_KEY]: Get<LoggerProvider>;\n}>;\n\nexport const _global = globalThis as OtelGlobal;\n\n/**\n * Make a function which accepts a version integer and returns the instance of an API if the version\n * is compatible, or a fallback version (usually NOOP) if it is not.\n *\n * @param requiredVersion Backwards compatibility version which is required to return the instance\n * @param instance Instance which should be returned if the required version is compatible\n * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible\n */\nexport function makeGetter<T>(\n  requiredVersion: number,\n  instance: T,\n  fallback: T\n): Get<T> {\n  return (version: number): T =>\n    version === requiredVersion ? instance : fallback;\n}\n\n/**\n * A number which should be incremented each time a backwards incompatible\n * change is made to the API. This number is used when an API package\n * attempts to access the global API to ensure it is getting a compatible\n * version. If the global API is not compatible with the API package\n * attempting to get it, a NOOP API implementation will be returned.\n */\nexport const API_BACKWARDS_COMPATIBILITY_VERSION = 1;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LoggerProvider } from './types/LoggerProvider';\nimport type { Logger } from './types/Logger';\nimport type { LoggerOptions } from './types/LoggerOptions';\nimport { NoopLogger } from './NoopLogger';\n\nexport class NoopLoggerProvider implements LoggerProvider {\n  getLogger(\n    _name: string,\n    _version?: string | undefined,\n    _options?: LoggerOptions | undefined\n  ): Logger {\n    return new NoopLogger();\n  }\n}\n\nexport const NOOP_LOGGER_PROVIDER = new NoopLoggerProvider();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport { NOOP_LOGGER } from './NoopLogger';\nimport type { Logger } from './types/Logger';\nimport type { LoggerOptions } from './types/LoggerOptions';\nimport type { LogRecord } from './types/LogRecord';\nimport type { SeverityNumber } from './types/LogRecord';\n\nexport class ProxyLogger implements Logger {\n  // When a real implementation is provided, this will be it\n  private _delegate?: Logger;\n  private _provider: LoggerDelegator;\n  public readonly name: string;\n  public readonly version?: string | undefined;\n  public readonly options?: LoggerOptions | undefined;\n\n  constructor(\n    provider: LoggerDelegator,\n    name: string,\n    version?: string | undefined,\n    options?: LoggerOptions | undefined\n  ) {\n    this._provider = provider;\n    this.name = name;\n    this.version = version;\n    this.options = options;\n  }\n\n  /**\n   * Emit a log record. This method should only be used by log appenders.\n   *\n   * @param logRecord\n   */\n  emit(logRecord: LogRecord): void {\n    this._getLogger().emit(logRecord);\n  }\n\n  enabled(options?: {\n    context?: Context;\n    severityNumber?: SeverityNumber;\n    eventName?: string;\n  }): boolean {\n    return this._getLogger().enabled(options);\n  }\n\n  /**\n   * Try to get a logger from the proxy logger provider.\n   * If the proxy logger provider has no delegate, return a noop logger.\n   */\n  private _getLogger() {\n    if (this._delegate) {\n      return this._delegate;\n    }\n    const logger = this._provider._getDelegateLogger(\n      this.name,\n      this.version,\n      this.options\n    );\n    if (!logger) {\n      return NOOP_LOGGER;\n    }\n    this._delegate = logger;\n    return this._delegate;\n  }\n}\n\nexport interface LoggerDelegator {\n  _getDelegateLogger(\n    name: string,\n    version?: string,\n    options?: LoggerOptions\n  ): Logger | undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LoggerProvider } from './types/LoggerProvider';\nimport type { Logger } from './types/Logger';\nimport type { LoggerOptions } from './types/LoggerOptions';\nimport { NOOP_LOGGER_PROVIDER } from './NoopLoggerProvider';\nimport { ProxyLogger } from './ProxyLogger';\n\nexport class ProxyLoggerProvider implements LoggerProvider {\n  private _delegate?: LoggerProvider;\n\n  getLogger(\n    name: string,\n    version?: string | undefined,\n    options?: LoggerOptions | undefined\n  ): Logger {\n    return (\n      this._getDelegateLogger(name, version, options) ??\n      new ProxyLogger(this, name, version, options)\n    );\n  }\n\n  /**\n   * Get the delegate logger provider.\n   * Used by tests only.\n   * @internal\n   */\n  _getDelegate(): LoggerProvider {\n    return this._delegate ?? NOOP_LOGGER_PROVIDER;\n  }\n\n  /**\n   * Set the delegate logger provider\n   * @internal\n   */\n  _setDelegate(delegate: LoggerProvider) {\n    this._delegate = delegate;\n  }\n\n  /**\n   * @internal\n   */\n  _getDelegateLogger(\n    name: string,\n    version?: string | undefined,\n    options?: LoggerOptions | undefined\n  ): Logger | undefined {\n    return this._delegate?.getLogger(name, version, options);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n  API_BACKWARDS_COMPATIBILITY_VERSION,\n  GLOBAL_LOGS_API_KEY,\n  _global,\n  makeGetter,\n} from '../internal/global-utils';\nimport type { LoggerProvider } from '../types/LoggerProvider';\nimport { NOOP_LOGGER_PROVIDER } from '../NoopLoggerProvider';\nimport type { Logger } from '../types/Logger';\nimport type { LoggerOptions } from '../types/LoggerOptions';\nimport { ProxyLoggerProvider } from '../ProxyLoggerProvider';\n\nexport class LogsAPI {\n  private static _instance?: LogsAPI;\n\n  private _proxyLoggerProvider = new ProxyLoggerProvider();\n\n  private constructor() {}\n\n  public static getInstance(): LogsAPI {\n    if (!this._instance) {\n      this._instance = new LogsAPI();\n    }\n\n    return this._instance;\n  }\n\n  public setGlobalLoggerProvider(provider: LoggerProvider): LoggerProvider {\n    if (_global[GLOBAL_LOGS_API_KEY]) {\n      return this.getLoggerProvider();\n    }\n\n    _global[GLOBAL_LOGS_API_KEY] = makeGetter<LoggerProvider>(\n      API_BACKWARDS_COMPATIBILITY_VERSION,\n      provider,\n      NOOP_LOGGER_PROVIDER\n    );\n    this._proxyLoggerProvider._setDelegate(provider);\n\n    return provider;\n  }\n\n  /**\n   * Returns the global logger provider.\n   *\n   * @returns LoggerProvider\n   */\n  public getLoggerProvider(): LoggerProvider {\n    return (\n      _global[GLOBAL_LOGS_API_KEY]?.(API_BACKWARDS_COMPATIBILITY_VERSION) ??\n      this._proxyLoggerProvider\n    );\n  }\n\n  /**\n   * Returns a Logger, creating one if one with the given name, version,\n   * schemaUrl, and attributes is not already created.\n   *\n   * Getting a Logger may be expensive, especially when `attributes` are\n   * provided. Reuse Logger instances where possible instead of calling\n   * `getLogger()` on hot paths.\n   *\n   * @param name The name of the logger or instrumentation library.\n   * @param version The version of the logger or instrumentation library.\n   * @param options The options of the logger or instrumentation library.\n   * @returns {@link Logger}\n   */\n  public getLogger(\n    name: string,\n    version?: string,\n    options?: LoggerOptions\n  ): Logger {\n    return this.getLoggerProvider().getLogger(name, version, options);\n  }\n\n  /** Remove the global logger provider */\n  public disable(): void {\n    delete _global[GLOBAL_LOGS_API_KEY];\n    this._proxyLoggerProvider = new ProxyLoggerProvider();\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { Logger } from './types/Logger';\nexport type { LoggerProvider } from './types/LoggerProvider';\nexport { SeverityNumber } from './types/LogRecord';\nexport type { LogAttributes, LogBody, LogRecord } from './types/LogRecord';\nexport type { LoggerOptions } from './types/LoggerOptions';\nexport type { AnyValue, AnyValueMap } from './types/AnyValue';\nexport { createNoopLogger } from './NoopLogger';\n\nimport { LogsAPI } from './api/logs';\nexport const logs = LogsAPI.getInstance();\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport { createContextKey } from '@opentelemetry/api';\n\nconst SUPPRESS_TRACING_KEY = createContextKey(\n  'OpenTelemetry SDK Context Key SUPPRESS_TRACING'\n);\n\nexport function suppressTracing(context: Context): Context {\n  return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\n\nexport function unsuppressTracing(context: Context): Context {\n  return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\n\nexport function isTracingSuppressed(context: Context): boolean {\n  return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { AttributeValue, Attributes } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\n\nexport function sanitizeAttributes(attributes: unknown): Attributes {\n  const out: Attributes = {};\n\n  if (typeof attributes !== 'object' || attributes == null) {\n    return out;\n  }\n\n  for (const key in attributes) {\n    if (!Object.prototype.hasOwnProperty.call(attributes, key)) {\n      continue;\n    }\n    if (!isAttributeKey(key)) {\n      diag.warn(`Invalid attribute key: ${key}`);\n      continue;\n    }\n    const val = (attributes as Record<string, unknown>)[key];\n    if (!isAttributeValue(val)) {\n      diag.warn(`Invalid attribute value set for key: ${key}`);\n      continue;\n    }\n    if (Array.isArray(val)) {\n      out[key] = val.slice();\n    } else {\n      out[key] = val;\n    }\n  }\n\n  return out;\n}\n\nexport function isAttributeKey(key: unknown): key is string {\n  return typeof key === 'string' && key !== '';\n}\n\nexport function isAttributeValue(val: unknown): val is AttributeValue {\n  if (val == null) {\n    return true;\n  }\n\n  if (Array.isArray(val)) {\n    return isHomogeneousAttributeValueArray(val);\n  }\n\n  return isValidPrimitiveAttributeValueType(typeof val);\n}\n\nfunction isHomogeneousAttributeValueArray(arr: unknown[]): boolean {\n  let type: string | undefined;\n\n  for (const element of arr) {\n    // null/undefined elements are allowed\n    if (element == null) continue;\n    const elementType = typeof element;\n\n    if (elementType === type) {\n      continue;\n    }\n\n    if (!type) {\n      if (isValidPrimitiveAttributeValueType(elementType)) {\n        type = elementType;\n        continue;\n      }\n      // encountered an invalid primitive\n      return false;\n    }\n\n    return false;\n  }\n\n  return true;\n}\n\nfunction isValidPrimitiveAttributeValueType(valType: string): boolean {\n  switch (valType) {\n    case 'number':\n    case 'boolean':\n    case 'string':\n      return true;\n  }\n\n  return false;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Exception } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport type { ErrorHandler } from './types';\n\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nexport function loggingErrorHandler(): ErrorHandler {\n  return (ex: Exception) => {\n    diag.error(stringifyException(ex));\n  };\n}\n\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex: Exception | string): string {\n  if (typeof ex === 'string') {\n    return ex;\n  } else {\n    return JSON.stringify(flattenException(ex));\n  }\n}\n\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex: Exception): Record<string, string> {\n  const result = {} as Record<string, string>;\n  let current = ex;\n\n  while (current !== null) {\n    Object.getOwnPropertyNames(current).forEach(propertyName => {\n      if (result[propertyName]) return;\n      const value = current[propertyName as keyof typeof current];\n      if (value) {\n        result[propertyName] = String(value);\n      }\n    });\n    current = Object.getPrototypeOf(current);\n  }\n\n  return result;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Exception } from '@opentelemetry/api';\nimport { loggingErrorHandler } from './logging-error-handler';\nimport type { ErrorHandler } from './types';\n\n/** The global error handler delegate */\nlet delegateHandler = loggingErrorHandler();\n\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nexport function setGlobalErrorHandler(handler: ErrorHandler): void {\n  delegateHandler = handler;\n}\n\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nexport function globalErrorHandler(ex: Exception): void {\n  try {\n    delegateHandler(ex);\n  } catch {} // eslint-disable-line no-empty\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.12.0';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n//----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2\n//----------------------------------------------------------------------------------------------------------\n\n/**\n * ASP.NET Core exception middleware handling result.\n *\n * @example handled\n * @example unhandled\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result' as const;\n\n/**\n * Enum value \"aborted\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling didn't run because the request was aborted.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = \"aborted\" as const;\n\n/**\n * Enum value \"handled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = \"handled\" as const;\n\n/**\n * Enum value \"skipped\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling was skipped because the response had started.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = \"skipped\" as const;\n\n/**\n * Enum value \"unhandled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was not handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = \"unhandled\" as const;\n\n/**\n * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.\n *\n * @example Contoso.MyHandler\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type' as const;\n\n/**\n * Rate limiting policy name.\n *\n * @example fixed\n * @example sliding\n * @example token\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy' as const;\n\n/**\n * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason\n *\n * @example acquired\n * @example request_canceled\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result' as const;\n\n/**\n * Enum value \"acquired\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease was acquired\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = \"acquired\" as const;\n\n/**\n * Enum value \"endpoint_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the endpoint limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = \"endpoint_limiter\" as const;\n\n/**\n * Enum value \"global_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the global limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = \"global_limiter\" as const;\n\n/**\n * Enum value \"request_canceled\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was canceled\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = \"request_canceled\" as const;\n\n/**\n * Flag indicating if request was handled by the application pipeline.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled' as const;\n\n/**\n * A value that indicates whether the matched route is a fallback route.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback' as const;\n\n/**\n * Match result - success or failure\n *\n * @example success\n * @example failure\n */\nexport const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status' as const;\n\n/**\n * Enum value \"failure\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match failed\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = \"failure\" as const;\n\n/**\n * Enum value \"success\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match succeeded\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = \"success\" as const;\n\n/**\n * A value that indicates whether the user is authenticated.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated' as const;\n\n/**\n * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example client.example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries,  for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_ADDRESS = 'client.address' as const;\n\n/**\n * Client port number.\n *\n * @example 65123\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries,  for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_PORT = 'client.port' as const;\n\n/**\n * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 16\n */\nexport const ATTR_CODE_COLUMN_NUMBER = 'code.column.number' as const;\n\n/**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"/usr/local/MyApplication/content_root/app/index.php\"\n */\nexport const ATTR_CODE_FILE_PATH = 'code.file.path' as const;\n\n/**\n * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example com.example.MyHttpService.serveRequest\n * @example GuzzleHttp\\\\Client::transfer\n * @example fopen\n *\n * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.\n * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in\n * `code.stacktrace` without information on arguments.\n *\n * Examples:\n *\n *   - Java method: `com.example.MyHttpService.serveRequest`\n *   - Java anonymous class method: `com.mycompany.Main$1.myMethod`\n *   - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`\n *   - PHP function: `GuzzleHttp\\Client::transfer`\n *   - Go function: `github.com/my/repo/pkg.foo.func5`\n *   - Elixir: `OpenTelemetry.Ctx.new`\n *   - Erlang: `opentelemetry_ctx:new`\n *   - Rust: `playground::my_module::my_cool_func`\n *   - C function: `fopen`\n */\nexport const ATTR_CODE_FUNCTION_NAME = 'code.function.name' as const;\n\n/**\n * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 42\n */\nexport const ATTR_CODE_LINE_NUMBER = 'code.line.number' as const;\n\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_CODE_STACKTRACE = 'code.stacktrace' as const;\n\n/**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.\n *\n * @example a3bf90e006b2\n */\nexport const ATTR_CONTAINER_ID = 'container.id' as const;\n\n/**\n * Name of the image the container was built on.\n *\n * @example gcr.io/opentelemetry/operator\n */\nexport const ATTR_CONTAINER_IMAGE_NAME = 'container.image.name' as const;\n\n/**\n * Repo digests of the container image as provided by the container runtime.\n *\n * @example [\"example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb\", \"internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578\"]\n *\n * @note [Docker](https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.\n */\nexport const ATTR_CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests' as const;\n\n/**\n * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.\n *\n * @example [\"v1.27.1\", \"3.5.7-0\"]\n */\nexport const ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags' as const;\n\n/**\n * The name of a collection (table, container) within the database.\n *\n * @example public.users\n * @example customers\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The collection name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple collections\n * in non-batch operations.\n *\n * For batch operations, if the individual operations are known to have the same\n * collection name then that collection name **SHOULD** be used.\n */\nexport const ATTR_DB_COLLECTION_NAME = 'db.collection.name' as const;\n\n/**\n * The name of the database, fully qualified within the server address and port.\n *\n * @example customers\n * @example test.users\n *\n * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted.\n * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.\n * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.\n */\nexport const ATTR_DB_NAMESPACE = 'db.namespace' as const;\n\n/**\n * The number of database operations included in a batch operation.\n *\n * @example 2\n * @example 3\n * @example 4\n *\n * @note Except for empty batch requests described below, a batch operation contains two\n * or more database operations explicitly submitted as separate operations in a single\n * client call, protocol message, or database command.\n *\n * Requests to batch APIs that contain only one operation **SHOULD** be modeled as single\n * operations, not as batch operations.\n *\n * A database call is not a batch operation solely because one operation accepts\n * multiple operands, such as keys, rows, documents, points, or other data elements,\n * including Redis [`MGET`](https://redis.io/docs/latest/commands/mget/) with\n * multiple keys.\n *\n * In batch APIs that execute the same parameterized operation with parameter sets,\n * each parameter set represents one database operation for determining whether the\n * request is a batch operation. Requests with only one parameter set **SHOULD** be modeled\n * as single operations, not as batch operations.\n *\n * `db.operation.batch.size` **SHOULD** be set to the number of operations in the batch.\n * It **SHOULD NOT** be set for non-batch operations.\n *\n * A request to execute a batch operation with no operations **SHOULD** also be treated\n * as a batch operation, and `db.operation.batch.size` **SHOULD** be set to `0`.\n */\nexport const ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size' as const;\n\n/**\n * The name of the operation or command being executed.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The operation name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple operations\n * in non-batch operations.\n *\n * If spaces can occur in the operation name, multiple consecutive spaces\n * **SHOULD** be normalized to a single space.\n *\n * For batch operations, if the individual operations are known to have the same operation name\n * then that operation name **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_OPERATION_NAME = 'db.operation.name' as const;\n\n/**\n * Low cardinality summary of a database query.\n *\n * @example SELECT wuser_table\n * @example INSERT shipping_details SELECT orders\n * @example get user by id\n *\n * @note The query summary describes a class of database queries and is useful\n * as a grouping key, especially when analyzing telemetry for database\n * calls involving complex queries.\n *\n * Summary may be available to the instrumentation through\n * instrumentation hooks or other means. If it is not available, instrumentations\n * that support query parsing **SHOULD** generate a summary following\n * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query)\n * section.\n *\n * For batch operations, if the individual operations are known to have the same query summary\n * then that query summary **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_QUERY_SUMMARY = 'db.query.summary' as const;\n\n/**\n * The database query being executed.\n *\n * @example SELECT * FROM wuser_table where username = ?\n * @example SET mykey ?\n *\n * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext).\n * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable.\n * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.\n */\nexport const ATTR_DB_QUERY_TEXT = 'db.query.text' as const;\n\n/**\n * Database response status code.\n *\n * @example 102\n * @example ORA-17002\n * @example 08P01\n * @example 404\n *\n * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.\n * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system.\n */\nexport const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code' as const;\n\n/**\n * The name of a stored procedure within the database.\n *\n * @example GetCustomer\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * For batch operations, if the individual operations are known to have the same\n * stored procedure name then that stored procedure name **SHOULD** be used.\n */\nexport const ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name' as const;\n\n/**\n * The database management system (DBMS) product as identified by the client instrumentation.\n *\n * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge.\n */\nexport const ATTR_DB_SYSTEM_NAME = 'db.system.name' as const;\n\n/**\n * Enum value \"mariadb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MariaDB](https://mariadb.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MARIADB = \"mariadb\" as const;\n\n/**\n * Enum value \"microsoft.sql_server\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Microsoft SQL Server](https://www.microsoft.com/sql-server)\n */\nexport const DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = \"microsoft.sql_server\" as const;\n\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MySQL](https://www.mysql.com/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MYSQL = \"mysql\" as const;\n\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [PostgreSQL](https://www.postgresql.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_POSTGRESQL = \"postgresql\" as const;\n\n/**\n * Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).\n *\n * @example staging\n * @example production\n *\n * @note `deployment.environment.name` does not affect the uniqueness constraints defined through\n * the `service.namespace`, `service.name` and `service.instance.id` resource attributes.\n * This implies that resources carrying the following attribute combinations **MUST** be\n * considered to be identifying the same service:\n *\n *   - `service.name=frontend`, `deployment.environment.name=production`\n *   - `service.name=frontend`, `deployment.environment.name=staging`.\n */\nexport const ATTR_DEPLOYMENT_ENVIRONMENT_NAME = 'deployment.environment.name' as const;\n\n/**\n * Enum value \"development\" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}.\n *\n * Development environment\n */\nexport const DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = \"development\" as const;\n\n/**\n * Enum value \"production\" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}.\n *\n * Production environment\n */\nexport const DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = \"production\" as const;\n\n/**\n * Enum value \"staging\" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}.\n *\n * Staging environment\n */\nexport const DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = \"staging\" as const;\n\n/**\n * Enum value \"test\" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}.\n *\n * Testing environment\n */\nexport const DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = \"test\" as const;\n\n/**\n * Name of the garbage collector managed heap generation.\n *\n * @example gen0\n * @example gen1\n * @example gen2\n */\nexport const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation' as const;\n\n/**\n * Enum value \"gen0\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 0\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = \"gen0\" as const;\n\n/**\n * Enum value \"gen1\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 1\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = \"gen1\" as const;\n\n/**\n * Enum value \"gen2\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 2\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = \"gen2\" as const;\n\n/**\n * Enum value \"loh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Large Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = \"loh\" as const;\n\n/**\n * Enum value \"poh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Pinned Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_POH = \"poh\" as const;\n\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * If the recorded error type is a wrapper that is not meaningful for\n * failure classification, instrumentation **MAY** use the type of the inner\n * error instead. For example, in Go, errors created with `fmt.Errorf`\n * using `%w` **MAY** be unwrapped when the wrapper type does not help\n * classify the failure.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n *   - Use a domain-specific attribute\n *   - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type' as const;\n\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_ERROR_TYPE}.\n *\n * A fallback error value to be used when the instrumentation doesn't define a custom value.\n */\nexport const ERROR_TYPE_VALUE_OTHER = \"_OTHER\" as const;\n\n/**\n * Indicates that the exception is escaping the scope of the span.\n *\n * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.\n */\nexport const ATTR_EXCEPTION_ESCAPED = 'exception.escaped' as const;\n\n/**\n * The exception message.\n *\n * @example Division by zero\n * @example Can't convert 'int' object to str implicitly\n *\n * @note > [!WARNING]\n *\n * > This attribute may contain sensitive information.\n */\nexport const ATTR_EXCEPTION_MESSAGE = 'exception.message' as const;\n\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 * @example \"Exception in thread \"main\" java.lang.RuntimeException: Test exception\\\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace' as const;\n\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 * @example java.net.ConnectException\n * @example OSError\n *\n * @note If the recorded exception type is a wrapper that is not meaningful for\n * failure classification, instrumentation **MAY** use the type of the inner\n * exception instead. For example, in Go, errors created with `fmt.Errorf`\n * using `%w` **MAY** be unwrapped when the wrapper type does not help\n * classify the failure.\n */\nexport const ATTR_EXCEPTION_TYPE = 'exception.type' as const;\n\n/**\n * HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"1.2.3.4\", \"1.2.3.5\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * The `User-Agent` header is already captured in the `user_agent.original` attribute.\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n *   - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type`\n *     attribute with value `[\"application/json\"]`.\n *   - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for`\n *     attribute with value `[\"1.2.3.4\", \"1.2.3.5\"]` or `[\"1.2.3.4, 1.2.3.5\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_REQUEST_HEADER = (key: string) => `http.request.header.${key}`;\n\n/**\n * HTTP request method.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @note HTTP request method value **SHOULD** be \"known\" to the instrumentation.\n * By default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods),\n * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html)\n * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1).\n *\n * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.\n *\n * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override\n * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named\n * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods.\n *\n *\n * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property\n * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or\n * `.instrumentation/development.general.http.server`.\n *\n * In either case, this list **MUST** be a full override of the default known methods,\n * it is not a list of known methods in addition to the defaults.\n *\n * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.\n * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.\n * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.\n */\nexport const ATTR_HTTP_REQUEST_METHOD = 'http.request.method' as const;\n\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * Any HTTP method that the instrumentation has no prior knowledge of.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OTHER = \"_OTHER\" as const;\n\n/**\n * Enum value \"CONNECT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * CONNECT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_CONNECT = \"CONNECT\" as const;\n\n/**\n * Enum value \"DELETE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * DELETE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_DELETE = \"DELETE\" as const;\n\n/**\n * Enum value \"GET\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * GET method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_GET = \"GET\" as const;\n\n/**\n * Enum value \"HEAD\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * HEAD method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_HEAD = \"HEAD\" as const;\n\n/**\n * Enum value \"OPTIONS\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * OPTIONS method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OPTIONS = \"OPTIONS\" as const;\n\n/**\n * Enum value \"PATCH\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PATCH method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PATCH = \"PATCH\" as const;\n\n/**\n * Enum value \"POST\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * POST method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_POST = \"POST\" as const;\n\n/**\n * Enum value \"PUT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PUT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PUT = \"PUT\" as const;\n\n/**\n * Enum value \"TRACE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * TRACE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_TRACE = \"TRACE\" as const;\n\n/**\n * Original HTTP method sent by the client in the request line.\n *\n * @example GeT\n * @example ACL\n * @example foo\n */\nexport const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original' as const;\n\n/**\n * The ordinal number of request resending attempt (for any reason, including redirects).\n *\n * @example 3\n *\n * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n */\nexport const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count' as const;\n\n/**\n * HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"abc\", \"def\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n *   - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type`\n *     attribute with value `[\"application/json\"]`.\n *   - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header`\n *     attribute with value `[\"abc\", \"def\"]` or `[\"abc, def\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_RESPONSE_HEADER = (key: string) => `http.response.header.${key}`;\n\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code' as const;\n\n/**\n * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.\n *\n * @example /users/:userID?\n * @example my-controller/my-action/{id?}\n *\n * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\n * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.\n *\n * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that\n * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`.\n *\n * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.\n *\n * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY**\n * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string.\n */\nexport const ATTR_HTTP_ROUTE = 'http.route' as const;\n\n/**\n * Name of the garbage collector action.\n *\n * @example end of minor GC\n * @example end of major GC\n *\n * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n */\nexport const ATTR_JVM_GC_ACTION = 'jvm.gc.action' as const;\n\n/**\n * Name of the garbage collector.\n *\n * @example G1 Young Generation\n * @example G1 Old Generation\n *\n * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n */\nexport const ATTR_JVM_GC_NAME = 'jvm.gc.name' as const;\n\n/**\n * Name of the memory pool.\n *\n * @example G1 Old Gen\n * @example G1 Eden space\n * @example G1 Survivor Space\n *\n * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n */\nexport const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name' as const;\n\n/**\n * The type of memory.\n *\n * @example heap\n * @example non_heap\n */\nexport const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type' as const;\n\n/**\n * Enum value \"heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Heap memory.\n */\nexport const JVM_MEMORY_TYPE_VALUE_HEAP = \"heap\" as const;\n\n/**\n * Enum value \"non_heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Non-heap memory\n */\nexport const JVM_MEMORY_TYPE_VALUE_NON_HEAP = \"non_heap\" as const;\n\n/**\n * Whether the thread is daemon or not.\n */\nexport const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon' as const;\n\n/**\n * State of the thread.\n *\n * @example runnable\n * @example blocked\n */\nexport const ATTR_JVM_THREAD_STATE = 'jvm.thread.state' as const;\n\n/**\n * Enum value \"blocked\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is blocked waiting for a monitor lock is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_BLOCKED = \"blocked\" as const;\n\n/**\n * Enum value \"new\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has not yet started is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_NEW = \"new\" as const;\n\n/**\n * Enum value \"runnable\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread executing in the Java virtual machine is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_RUNNABLE = \"runnable\" as const;\n\n/**\n * Enum value \"terminated\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has exited is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TERMINATED = \"terminated\" as const;\n\n/**\n * Enum value \"timed_waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TIMED_WAITING = \"timed_waiting\" as const;\n\n/**\n * Enum value \"waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting indefinitely for another thread to perform a particular action is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_WAITING = \"waiting\" as const;\n\n/**\n * The name of the cluster.\n *\n * @example opentelemetry-cluster\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace.\n *\n * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d\n *\n * @note K8s doesn't have support for obtaining a cluster ID. If this is ever\n * added, we will recommend collecting the `k8s.cluster.uid` through the\n * official APIs. In the meantime, we are able to use the `uid` of the\n * `kube-system` namespace as a proxy for cluster ID. Read on for the\n * rationale.\n *\n * Every object created in a K8s cluster is assigned a distinct UID. The\n * `kube-system` namespace is used by Kubernetes itself and will exist\n * for the lifetime of the cluster. Using the `uid` of the `kube-system`\n * namespace is a reasonable proxy for the K8s ClusterID as it will only\n * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are\n * UUIDs as standardized by\n * [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).\n * Which states:\n *\n * > If generated according to one of the mechanisms defined in Rec.\n * > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be\n * > different from all other UUIDs generated before 3603 A.D., or is\n * > extremely likely to be different (depending on the mechanism chosen).\n *\n * Therefore, UIDs between clusters should be extremely unlikely to\n * conflict.\n */\nexport const ATTR_K8S_CLUSTER_UID = 'k8s.cluster.uid' as const;\n\n/**\n * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`).\n *\n * @example redis\n */\nexport const ATTR_K8S_CONTAINER_NAME = 'k8s.container.name' as const;\n\n/**\n * Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.\n */\nexport const ATTR_K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count' as const;\n\n/**\n * The cronjob annotation placed on the CronJob, the `<key>` being the annotation name, the value being the annotation value.\n *\n * @example 4\n * @example\n *\n * @note Examples:\n *\n *   - An annotation `retries` with value `4` **SHOULD** be recorded as the\n *     `k8s.cronjob.annotation.retries` attribute with value `\"4\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.cronjob.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_CRONJOB_ANNOTATION = (key: string) => `k8s.cronjob.annotation.${key}`;\n\n/**\n * The label placed on the CronJob, the `<key>` being the label name, the value being the label value.\n *\n * @example weekly\n * @example\n *\n * @note Examples:\n *\n *   - A label `type` with value `weekly` **SHOULD** be recorded as the\n *     `k8s.cronjob.label.type` attribute with value `\"weekly\"`.\n *   - A label `automated` with empty string value **SHOULD** be recorded as\n *     the `k8s.cronjob.label.automated` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_CRONJOB_LABEL = (key: string) => `k8s.cronjob.label.${key}`;\n\n/**\n * The name of the CronJob.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_CRONJOB_NAME = 'k8s.cronjob.name' as const;\n\n/**\n * The UID of the CronJob.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_CRONJOB_UID = 'k8s.cronjob.uid' as const;\n\n/**\n * The annotation placed on the DaemonSet, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 1\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `replicas` with value `1` **SHOULD** be recorded\n *     as the `k8s.daemonset.annotation.replicas` attribute with value `\"1\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.daemonset.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_DAEMONSET_ANNOTATION = (key: string) => `k8s.daemonset.annotation.${key}`;\n\n/**\n * The label placed on the DaemonSet, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example guestbook\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `app` with value `guestbook` **SHOULD** be recorded\n *     as the `k8s.daemonset.label.app` attribute with value `\"guestbook\"`.\n *   - A label `injected` with empty string value **SHOULD** be recorded as\n *     the `k8s.daemonset.label.injected` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_DAEMONSET_LABEL = (key: string) => `k8s.daemonset.label.${key}`;\n\n/**\n * The name of the DaemonSet.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_DAEMONSET_NAME = 'k8s.daemonset.name' as const;\n\n/**\n * The UID of the DaemonSet.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_DAEMONSET_UID = 'k8s.daemonset.uid' as const;\n\n/**\n * The annotation placed on the Deployment, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 1\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `replicas` with value `1` **SHOULD** be recorded\n *     as the `k8s.deployment.annotation.replicas` attribute with value `\"1\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.deployment.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_DEPLOYMENT_ANNOTATION = (key: string) => `k8s.deployment.annotation.${key}`;\n\n/**\n * The label placed on the Deployment, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example guestbook\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `app` with value `guestbook` **SHOULD** be recorded\n *     as the `k8s.deployment.label.app` attribute with value `\"guestbook\"`.\n *   - A label `injected` with empty string value **SHOULD** be recorded as\n *     the `k8s.deployment.label.injected` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_DEPLOYMENT_LABEL = (key: string) => `k8s.deployment.label.${key}`;\n\n/**\n * The name of the Deployment.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name' as const;\n\n/**\n * The UID of the Deployment.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid' as const;\n\n/**\n * The annotation placed on the Job, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 1\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `number` with value `1` **SHOULD** be recorded\n *     as the `k8s.job.annotation.number` attribute with value `\"1\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.job.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_JOB_ANNOTATION = (key: string) => `k8s.job.annotation.${key}`;\n\n/**\n * The label placed on the Job, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example ci\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `jobtype` with value `ci` **SHOULD** be recorded\n *     as the `k8s.job.label.jobtype` attribute with value `\"ci\"`.\n *   - A label `automated` with empty string value **SHOULD** be recorded as\n *     the `k8s.job.label.automated` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_JOB_LABEL = (key: string) => `k8s.job.label.${key}`;\n\n/**\n * The name of the Job.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_JOB_NAME = 'k8s.job.name' as const;\n\n/**\n * The UID of the Job.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_JOB_UID = 'k8s.job.uid' as const;\n\n/**\n * The annotation placed on the Namespace, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 0\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `ttl` with value `0` **SHOULD** be recorded\n *     as the `k8s.namespace.annotation.ttl` attribute with value `\"0\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.namespace.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_NAMESPACE_ANNOTATION = (key: string) => `k8s.namespace.annotation.${key}`;\n\n/**\n * The label placed on the Namespace, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example default\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `kubernetes.io/metadata.name` with value `default` **SHOULD** be recorded\n *     as the `k8s.namespace.label.kubernetes.io/metadata.name` attribute with value `\"default\"`.\n *   - A label `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.namespace.label.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_NAMESPACE_LABEL = (key: string) => `k8s.namespace.label.${key}`;\n\n/**\n * The name of the namespace that the pod is running in.\n *\n * @example default\n */\nexport const ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name' as const;\n\n/**\n * The annotation placed on the Node, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 0\n * @example\n *\n * @note Examples:\n *\n *   - An annotation `node.alpha.kubernetes.io/ttl` with value `0` **SHOULD** be recorded as\n *     the `k8s.node.annotation.node.alpha.kubernetes.io/ttl` attribute with value `\"0\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.node.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_NODE_ANNOTATION = (key: string) => `k8s.node.annotation.${key}`;\n\n/**\n * The label placed on the Node, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example arm64\n * @example\n *\n * @note Examples:\n *\n *   - A label `kubernetes.io/arch` with value `arm64` **SHOULD** be recorded\n *     as the `k8s.node.label.kubernetes.io/arch` attribute with value `\"arm64\"`.\n *   - A label `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.node.label.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_NODE_LABEL = (key: string) => `k8s.node.label.${key}`;\n\n/**\n * The name of the Node.\n *\n * @example node-1\n */\nexport const ATTR_K8S_NODE_NAME = 'k8s.node.name' as const;\n\n/**\n * The UID of the Node.\n *\n * @example 1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2\n */\nexport const ATTR_K8S_NODE_UID = 'k8s.node.uid' as const;\n\n/**\n * The annotation placed on the Pod, the `<key>` being the annotation name, the value being the annotation value.\n *\n * @example true\n * @example x64\n * @example\n *\n * @note Examples:\n *\n *   - An annotation `kubernetes.io/enforce-mountable-secrets` with value `true` **SHOULD** be recorded as\n *     the `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets` attribute with value `\"true\"`.\n *   - An annotation `mycompany.io/arch` with value `x64` **SHOULD** be recorded as\n *     the `k8s.pod.annotation.mycompany.io/arch` attribute with value `\"x64\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.pod.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_POD_ANNOTATION = (key: string) => `k8s.pod.annotation.${key}`;\n\n/**\n * Specifies the hostname of the Pod.\n *\n * @example collector-gateway\n *\n * @note The K8s Pod spec has an optional hostname field, which can be used to specify a hostname.\n * Refer to [K8s docs](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-hostname-and-subdomain-field)\n * for more information about this field.\n *\n * This attribute aligns with the `hostname` field of the\n * [K8s PodSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podspec-v1-core).\n */\nexport const ATTR_K8S_POD_HOSTNAME = 'k8s.pod.hostname' as const;\n\n/**\n * IP address allocated to the Pod.\n *\n * @example 172.18.0.2\n *\n * @note This attribute aligns with the `podIP` field of the\n * [K8s PodStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core).\n */\nexport const ATTR_K8S_POD_IP = 'k8s.pod.ip' as const;\n\n/**\n * The label placed on the Pod, the `<key>` being the label name, the value being the label value.\n *\n * @example my-app\n * @example x64\n * @example\n *\n * @note Examples:\n *\n *   - A label `app` with value `my-app` **SHOULD** be recorded as\n *     the `k8s.pod.label.app` attribute with value `\"my-app\"`.\n *   - A label `mycompany.io/arch` with value `x64` **SHOULD** be recorded as\n *     the `k8s.pod.label.mycompany.io/arch` attribute with value `\"x64\"`.\n *   - A label `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.pod.label.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_POD_LABEL = (key: string) => `k8s.pod.label.${key}`;\n\n/**\n * The name of the Pod.\n *\n * @example opentelemetry-pod-autoconf\n */\nexport const ATTR_K8S_POD_NAME = 'k8s.pod.name' as const;\n\n/**\n * The start timestamp of the Pod.\n *\n * @example 2025-12-04T08:41:03Z\n *\n * @note Date and time at which the object was acknowledged by the Kubelet.\n * This is before the Kubelet pulled the container image(s) for the pod.\n *\n * This attribute aligns with the `startTime` field of the\n * [K8s PodStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core),\n * in ISO 8601 (RFC 3339 compatible) format.\n */\nexport const ATTR_K8S_POD_START_TIME = 'k8s.pod.start_time' as const;\n\n/**\n * The UID of the Pod.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_POD_UID = 'k8s.pod.uid' as const;\n\n/**\n * The annotation placed on the ReplicaSet, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 0\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `replicas` with value `0` **SHOULD** be recorded\n *     as the `k8s.replicaset.annotation.replicas` attribute with value `\"0\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.replicaset.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_REPLICASET_ANNOTATION = (key: string) => `k8s.replicaset.annotation.${key}`;\n\n/**\n * The label placed on the ReplicaSet, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example guestbook\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `app` with value `guestbook` **SHOULD** be recorded\n *     as the `k8s.replicaset.label.app` attribute with value `\"guestbook\"`.\n *   - A label `injected` with empty string value **SHOULD** be recorded as\n *     the `k8s.replicaset.label.injected` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_REPLICASET_LABEL = (key: string) => `k8s.replicaset.label.${key}`;\n\n/**\n * The name of the ReplicaSet.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_REPLICASET_NAME = 'k8s.replicaset.name' as const;\n\n/**\n * The UID of the ReplicaSet.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_REPLICASET_UID = 'k8s.replicaset.uid' as const;\n\n/**\n * The annotation placed on the StatefulSet, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.\n *\n * @example 1\n * @example\n *\n * @note\n * Examples:\n *\n *   - An annotation `replicas` with value `1` **SHOULD** be recorded\n *     as the `k8s.statefulset.annotation.replicas` attribute with value `\"1\"`.\n *   - An annotation `data` with empty string value **SHOULD** be recorded as\n *     the `k8s.statefulset.annotation.data` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_STATEFULSET_ANNOTATION = (key: string) => `k8s.statefulset.annotation.${key}`;\n\n/**\n * The label placed on the StatefulSet, the `<key>` being the label name, the value being the label value, even if the value is empty.\n *\n * @example guestbook\n * @example\n *\n * @note\n * Examples:\n *\n *   - A label `app` with value `guestbook` **SHOULD** be recorded\n *     as the `k8s.statefulset.label.app` attribute with value `\"guestbook\"`.\n *   - A label `injected` with empty string value **SHOULD** be recorded as\n *     the `k8s.statefulset.label.injected` attribute with value `\"\"`.\n */\nexport const ATTR_K8S_STATEFULSET_LABEL = (key: string) => `k8s.statefulset.label.${key}`;\n\n/**\n * The name of the StatefulSet.\n *\n * @example opentelemetry\n */\nexport const ATTR_K8S_STATEFULSET_NAME = 'k8s.statefulset.name' as const;\n\n/**\n * The UID of the StatefulSet.\n *\n * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff\n */\nexport const ATTR_K8S_STATEFULSET_UID = 'k8s.statefulset.uid' as const;\n\n/**\n * Local address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address' as const;\n\n/**\n * Local port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_LOCAL_PORT = 'network.local.port' as const;\n\n/**\n * Peer address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address' as const;\n\n/**\n * Peer port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_PEER_PORT = 'network.peer.port' as const;\n\n/**\n * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent.\n *\n * @example amqp\n * @example http\n * @example mqtt\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name' as const;\n\n/**\n * The actual version of the protocol used for network communication.\n *\n * @example 1.1\n * @example 2\n *\n * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD NOT** be set.\n */\nexport const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version' as const;\n\n/**\n * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n *\n * @example tcp\n * @example udp\n *\n * @note The value **SHOULD** be normalized to lowercase.\n *\n * Consider always setting the transport when setting a port number, since\n * a port number is ambiguous without knowing the transport. For example\n * different processes could be listening on TCP port 12345 and UDP port 12345.\n */\nexport const ATTR_NETWORK_TRANSPORT = 'network.transport' as const;\n\n/**\n * Enum value \"pipe\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Named or anonymous pipe.\n */\nexport const NETWORK_TRANSPORT_VALUE_PIPE = \"pipe\" as const;\n\n/**\n * Enum value \"quic\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * QUIC\n */\nexport const NETWORK_TRANSPORT_VALUE_QUIC = \"quic\" as const;\n\n/**\n * Enum value \"tcp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * TCP\n */\nexport const NETWORK_TRANSPORT_VALUE_TCP = \"tcp\" as const;\n\n/**\n * Enum value \"udp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * UDP\n */\nexport const NETWORK_TRANSPORT_VALUE_UDP = \"udp\" as const;\n\n/**\n * Enum value \"unix\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Unix domain socket\n */\nexport const NETWORK_TRANSPORT_VALUE_UNIX = \"unix\" as const;\n\n/**\n * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent.\n *\n * @example ipv4\n * @example ipv6\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_TYPE = 'network.type' as const;\n\n/**\n * Enum value \"ipv4\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv4\n */\nexport const NETWORK_TYPE_VALUE_IPV4 = \"ipv4\" as const;\n\n/**\n * Enum value \"ipv6\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv6\n */\nexport const NETWORK_TYPE_VALUE_IPV6 = \"ipv6\" as const;\n\n/**\n * Identifies the class / type of event.\n *\n * @example browser.mouse.click\n * @example device.app.lifecycle\n *\n * @note This attribute **SHOULD** be used by non-OTLP exporters when destination does not support `EventName` or equivalent field. This attribute **MAY** be used by applications using existing logging libraries so that it can be used to set the `EventName` field by Collector or SDK components.\n */\nexport const ATTR_OTEL_EVENT_NAME = 'otel.event.name' as const;\n\n/**\n * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).\n *\n * @example io.opentelemetry.contrib.mongodb\n */\nexport const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name' as const;\n\n/**\n * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).\n *\n * @example 1.0.0\n */\nexport const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version' as const;\n\n/**\n * Name of the code, either \"OK\" or \"ERROR\". **MUST NOT** be set if the status code is UNSET.\n */\nexport const ATTR_OTEL_STATUS_CODE = 'otel.status_code' as const;\n\n/**\n * Enum value \"ERROR\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation contains an error.\n */\nexport const OTEL_STATUS_CODE_VALUE_ERROR = \"ERROR\" as const;\n\n/**\n * Enum value \"OK\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation has been validated by an Application developer or Operator to have completed successfully.\n */\nexport const OTEL_STATUS_CODE_VALUE_OK = \"OK\" as const;\n\n/**\n * Description of the Status if it has a value, otherwise not set.\n *\n * @example resource not found\n */\nexport const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description' as const;\n\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address' as const;\n\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port' as const;\n\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const;\n\n/**\n * Logical name of the service.\n *\n * @example shoppingcart\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 the process executable name, e.g. `unknown_service:bash`. If the process executable name is not available, the value **MUST** be set to `unknown_service`.\n * The process executable name is the name of the process executable, the same value as described by the [`process.executable.name`](process.md) resource attribute.\n */\nexport const ATTR_SERVICE_NAME = 'service.name' as const;\n\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\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 */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace' as const;\n\n/**\n * The version string of the service component. The format is not defined by these conventions.\n *\n * @example 2.0.0\n * @example a01dbef8a\n */\nexport const ATTR_SERVICE_VERSION = 'service.version' as const;\n\n/**\n * SignalR HTTP connection closure status.\n *\n * @example app_shutdown\n * @example timeout\n */\nexport const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status' as const;\n\n/**\n * Enum value \"app_shutdown\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed because the app is shutting down.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = \"app_shutdown\" as const;\n\n/**\n * Enum value \"normal_closure\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed normally.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = \"normal_closure\" as const;\n\n/**\n * Enum value \"timeout\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed due to a timeout.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = \"timeout\" as const;\n\n/**\n * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)\n *\n * @example web_sockets\n * @example long_polling\n */\nexport const ATTR_SIGNALR_TRANSPORT = 'signalr.transport' as const;\n\n/**\n * Enum value \"long_polling\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * LongPolling protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = \"long_polling\" as const;\n\n/**\n * Enum value \"server_sent_events\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * ServerSentEvents protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = \"server_sent_events\" as const;\n\n/**\n * Enum value \"web_sockets\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * WebSockets protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = \"web_sockets\" as const;\n\n/**\n * The name of the auto instrumentation agent or distribution, if used.\n *\n * @example parts-unlimited-java\n *\n * @note Official auto instrumentation agents and distributions **SHOULD** set the `telemetry.distro.name` attribute to\n * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`.\n */\nexport const ATTR_TELEMETRY_DISTRO_NAME = 'telemetry.distro.name' as const;\n\n/**\n * The version string of the auto instrumentation agent or distribution, if used.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version' as const;\n\n/**\n * The language of the telemetry SDK.\n */\nexport const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language' as const;\n\n/**\n * Enum value \"cpp\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = \"cpp\" as const;\n\n/**\n * Enum value \"dotnet\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = \"dotnet\" as const;\n\n/**\n * Enum value \"erlang\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = \"erlang\" as const;\n\n/**\n * Enum value \"go\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_GO = \"go\" as const;\n\n/**\n * Enum value \"java\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = \"java\" as const;\n\n/**\n * Enum value \"kotlin\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN = \"kotlin\" as const;\n\n/**\n * Enum value \"nodejs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = \"nodejs\" as const;\n\n/**\n * Enum value \"php\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = \"php\" as const;\n\n/**\n * Enum value \"python\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = \"python\" as const;\n\n/**\n * Enum value \"ruby\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = \"ruby\" as const;\n\n/**\n * Enum value \"rust\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = \"rust\" as const;\n\n/**\n * Enum value \"swift\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = \"swift\" as const;\n\n/**\n * Enum value \"webjs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = \"webjs\" as const;\n\n/**\n * The name of the telemetry SDK as defined above.\n *\n * @example opentelemetry\n *\n * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.\n * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the\n * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point\n * or another suitable identifier depending on the language.\n * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.\n * All custom identifiers **SHOULD** be stable across different versions of an implementation.\n */\nexport const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name' as const;\n\n/**\n * The version string of the telemetry SDK.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version' as const;\n\n/**\n * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component\n *\n * @example SemConv\n */\nexport const ATTR_URL_FRAGMENT = 'url.fragment' as const;\n\n/**\n * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n * @example //localhost\n *\n * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment\n * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.\n *\n * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`.\n * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.\n *\n * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed).\n *\n * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the\n * value `REDACTED`:\n *\n *   - [`X-Amz-Signature`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`X-Amz-Credential`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`X-Amz-Security-Token`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n *   - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `https://www.example.com/path?color=blue&sig=REDACTED`.\n */\nexport const ATTR_URL_FULL = 'url.full' as const;\n\n/**\n * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component\n *\n * @example /search\n *\n * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.\n */\nexport const ATTR_URL_PATH = 'url.path' as const;\n\n/**\n * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component\n *\n * @example q=OpenTelemetry\n *\n * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`:\n *\n *   - [`X-Amz-Signature`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`X-Amz-Credential`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`X-Amz-Security-Token`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)\n *   - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n *   - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `q=OpenTelemetry&sig=REDACTED`.\n */\nexport const ATTR_URL_QUERY = 'url.query' as const;\n\n/**\n * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.\n *\n * @example https\n * @example ftp\n * @example telnet\n */\nexport const ATTR_URL_SCHEME = 'url.scheme' as const;\n\n/**\n * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2\n */\nexport const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original' as const;\n\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VERSION } from '../../version';\nimport {\n  ATTR_TELEMETRY_SDK_NAME,\n  ATTR_TELEMETRY_SDK_LANGUAGE,\n  TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n  ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';\n\n/** Constants describing the SDK in use */\nexport const SDK_INFO = {\n  [ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',\n  [ATTR_PROCESS_RUNTIME_NAME]: 'browser',\n  [ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n  [ATTR_TELEMETRY_SDK_VERSION]: VERSION,\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport {\n  getStringFromEnv,\n  getBooleanFromEnv,\n  getNumberFromEnv,\n  getStringListFromEnv,\n} from './environment';\nexport { _globalThis } from '../../common/globalThis';\nexport { SDK_INFO } from './sdk-info';\n\n/**\n * @deprecated Use performance directly.\n */\nexport const otperformance = performance;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type * as api from '@opentelemetry/api';\nimport { otperformance as performance } from '../platform';\n\nconst NANOSECOND_DIGITS = 9;\nconst NANOSECOND_DIGITS_IN_MILLIS = 6;\nconst MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS);\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n\n/**\n * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).\n * @param epochMillis\n */\nexport function millisToHrTime(epochMillis: number): api.HrTime {\n  const epochSeconds = epochMillis / 1000;\n  // Decimals only.\n  const seconds = Math.trunc(epochSeconds);\n  // Round sub-nanosecond accuracy to nanosecond.\n  const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS);\n  return [seconds, nanos];\n}\n\n/**\n * @deprecated Use `performance.timeOrigin` directly.\n */\nexport function getTimeOrigin(): number {\n  return performance.timeOrigin;\n}\n\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nexport function hrTime(performanceNow?: number): api.HrTime {\n  const timeOrigin = millisToHrTime(performance.timeOrigin);\n  const now = millisToHrTime(\n    typeof performanceNow === 'number' ? performanceNow : performance.now()\n  );\n\n  return addHrTimes(timeOrigin, now);\n}\n\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nexport function timeInputToHrTime(time: api.TimeInput): api.HrTime {\n  // process.hrtime\n  if (isTimeInputHrTime(time)) {\n    return time as api.HrTime;\n  } else if (typeof time === 'number') {\n    // Distinguish between a relative performance.now() value and an absolute\n    // epoch-millisecond timestamp.\n    //\n    // performance.timeOrigin uses a monotonic clock that may be slightly ahead\n    // of Date.now() due to clock adjustments (see MDN docs). This means a\n    // real epoch-ms value (e.g. Date.now()) can land just below\n    // performance.timeOrigin, causing it to be misclassified as a relative\n    // performance.now() reading and doubled when timeOrigin is added.\n    //\n    // A genuine performance.now() value represents elapsed time since the\n    // document/process started, so it is bounded by system uptime. No real\n    // system has been running long enough for performance.now() to reach half\n    // the current epoch time (~1994 in ms terms). We therefore treat any value\n    // below half of performance.timeOrigin as a relative performance.now()\n    // reading, and everything else as an absolute epoch-millisecond timestamp.\n    if (time < performance.timeOrigin / 2) {\n      return hrTime(time);\n    } else {\n      // epoch milliseconds or performance.timeOrigin\n      return millisToHrTime(time);\n    }\n  } else if (time instanceof Date) {\n    return millisToHrTime(time.getTime());\n  } else {\n    throw TypeError('Invalid input type');\n  }\n}\n\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nexport function hrTimeDuration(\n  startTime: api.HrTime,\n  endTime: api.HrTime\n): api.HrTime {\n  let seconds = endTime[0] - startTime[0];\n  let nanos = endTime[1] - startTime[1];\n\n  // overflow\n  if (nanos < 0) {\n    seconds -= 1;\n    // negate\n    nanos += SECOND_TO_NANOSECONDS;\n  }\n\n  return [seconds, nanos];\n}\n\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nexport function hrTimeToTimeStamp(time: api.HrTime): string {\n  const precision = NANOSECOND_DIGITS;\n  const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n  const nanoString = tmp.substring(tmp.length - precision - 1);\n  const date = new Date(time[0] * 1000).toISOString();\n  return date.replace('000Z', nanoString);\n}\n\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nexport function hrTimeToNanoseconds(time: api.HrTime): number {\n  return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\n\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nexport function hrTimeToMicroseconds(time: api.HrTime): number {\n  return time[0] * 1e6 + time[1] / 1e3;\n}\n\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nexport function hrTimeToMilliseconds(time: api.HrTime): number {\n  return time[0] * 1e3 + time[1] / 1e6;\n}\n\n/**\n * Convert hrTime to seconds.\n * @param time\n */\nexport function hrTimeToSeconds(time: api.HrTime): number {\n  return time[0] + time[1] / SECOND_TO_NANOSECONDS;\n}\n/**\n * check if time is HrTime\n * @param value\n */\nexport function isTimeInputHrTime(value: unknown): value is api.HrTime {\n  return (\n    Array.isArray(value) &&\n    value.length === 2 &&\n    typeof value[0] === 'number' &&\n    typeof value[1] === 'number'\n  );\n}\n\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nexport function isTimeInput(\n  value: unknown\n): value is api.HrTime | number | Date {\n  return (\n    isTimeInputHrTime(value) ||\n    typeof value === 'number' ||\n    value instanceof Date\n  );\n}\n\n/**\n * Given 2 HrTime formatted times, return their sum as an HrTime.\n */\nexport function addHrTimes(time1: api.HrTime, time2: api.HrTime): api.HrTime {\n  const out = [time1[0] + time2[0], time1[1] + time2[1]] as api.HrTime;\n\n  // Nanoseconds\n  if (out[1] >= SECOND_TO_NANOSECONDS) {\n    out[1] -= SECOND_TO_NANOSECONDS;\n    out[0] += 1;\n  }\n\n  return out;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ExportResult {\n  code: ExportResultCode;\n  error?: Error;\n}\n\nexport enum ExportResultCode {\n  SUCCESS,\n  FAILED,\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Context,\n  TextMapGetter,\n  TextMapPropagator,\n  TextMapSetter,\n} from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\n\n/** Configuration object for composite propagator */\nexport interface CompositePropagatorConfig {\n  /**\n   * List of propagators to run. Propagators run in the\n   * list order. If a propagator later in the list writes the same context\n   * key as a propagator earlier in the list, the later on will \"win\".\n   */\n  propagators?: TextMapPropagator[];\n}\n\n/** Combines multiple propagators into a single propagator. */\nexport class CompositePropagator implements TextMapPropagator {\n  private readonly _propagators: TextMapPropagator[];\n  private readonly _fields: string[];\n\n  /**\n   * Construct a composite propagator from a list of propagators.\n   *\n   * @param [config] Configuration object for composite propagator\n   */\n  constructor(config: CompositePropagatorConfig = {}) {\n    this._propagators = config.propagators ?? [];\n\n    const fields = new Set<string>();\n    for (const propagator of this._propagators) {\n      // older propagators may not have fields function, null check to be sure\n      const propagatorFields =\n        typeof propagator.fields === 'function' ? propagator.fields() : [];\n      for (const field of propagatorFields) {\n        fields.add(field);\n      }\n    }\n    this._fields = Array.from(fields);\n  }\n\n  /**\n   * Run each of the configured propagators with the given context and carrier.\n   * Propagators are run in the order they are configured, so if multiple\n   * propagators write the same carrier key, the propagator later in the list\n   * will \"win\".\n   *\n   * @param context Context to inject\n   * @param carrier Carrier into which context will be injected\n   */\n  inject(context: Context, carrier: unknown, setter: TextMapSetter): void {\n    for (const propagator of this._propagators) {\n      try {\n        propagator.inject(context, carrier, setter);\n      } catch (err) {\n        diag.warn(\n          `Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`\n        );\n      }\n    }\n  }\n\n  /**\n   * Run each of the configured propagators with the given context and carrier.\n   * Propagators are run in the order they are configured, so if multiple\n   * propagators write the same context key, the propagator later in the list\n   * will \"win\".\n   *\n   * @param context Context to add values to\n   * @param carrier Carrier from which to extract context\n   */\n  extract(context: Context, carrier: unknown, getter: TextMapGetter): Context {\n    return this._propagators.reduce((ctx, propagator) => {\n      try {\n        return propagator.extract(ctx, carrier, getter);\n      } catch (err) {\n        diag.warn(\n          `Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`\n        );\n      }\n      return ctx;\n    }, context);\n  }\n\n  fields(): string[] {\n    // return a new array so our fields cannot be modified\n    return this._fields.slice();\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n\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: string): boolean {\n  return VALID_KEY_REGEX.test(key);\n}\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: string): boolean {\n  return (\n    VALID_VALUE_BASE_REGEX.test(value) &&\n    !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)\n  );\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { TraceState as TraceStateApi } from '@opentelemetry/api';\nimport { validateKey, validateValue } from '../internal/validators';\n\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n\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 */\nexport class TraceState implements TraceStateApi {\n  private _length: number;\n  private _rawTraceState: string;\n  private _internalState: Map<string, string> | undefined;\n\n  constructor(rawTraceState?: string) {\n    this._rawTraceState =\n      typeof rawTraceState === 'string' ? rawTraceState : '';\n    this._length = this._rawTraceState.length;\n  }\n\n  set(key: string, value: string): TraceState {\n    if (!validateKey(key) || !validateValue(value)) {\n      return this;\n    }\n\n    const currState = this._getState();\n    const currValue = currState.get(key);\n    // Get the new length depending if we already have a value or not\n    // - for existing keys we add the difference between the length of the values\n    // - for new keys is the key & value lenght plus\n    //   - +1 for the key/value splitter\n    //   - +1 for the separator if there are other keys\n    let newLength = this._length;\n    if (typeof currValue === 'string') {\n      newLength += value.length - currValue.length;\n    } else {\n      newLength += key.length + value.length + (currState.size > 0 ? 2 : 1);\n    }\n    if (newLength > MAX_TRACE_STATE_LEN) {\n      return this;\n    }\n\n    const newState = new Map(currState);\n    newState.delete(key);\n    newState.set(key, value);\n    return this._fromState(newState, newLength);\n  }\n\n  unset(key: string): TraceState {\n    const currState = this._getState();\n    const currValue = currState.get(key);\n\n    // No need to create a new instance if the key does not exist\n    if (typeof currValue !== 'string') {\n      return this;\n    }\n\n    // Get the new length depending if we already have a value or not\n    // - for existing keys we substract key and value length plus\n    //   - +1 for the key/value splitter\n    //   - +1 for the separator if there are other keys\n    let newLength = this._length - (key.length + currValue.length + 1);\n    if (currState.size > 1) {\n      // remove separator from length if there's no key or only one.\n      newLength = newLength - 1;\n    }\n\n    const newState = new Map(currState);\n    newState.delete(key);\n    return this._fromState(newState, newLength);\n  }\n\n  get(key: string): string | undefined {\n    const currState = this._getState();\n    return currState.get(key);\n  }\n\n  serialize(): string {\n    // Maps put new entries at the end. We prepend the seralized entry\n    // to get the right order according to the spec (updated members go 1st)\n    let serialized = '';\n    let index = 0;\n    for (const entry of this._getState()) {\n      if (index > 0) {\n        serialized = LIST_MEMBERS_SEPARATOR + serialized;\n      }\n      serialized =\n        `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized;\n      index++;\n    }\n    return serialized;\n  }\n\n  private _getState(): Map<string, string> {\n    if (this._internalState) {\n      return this._internalState;\n    }\n\n    // Not parsed yet, lets do it\n    const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR);\n\n    // This Map will have the order reversed\n    const vendorEntries = new Map();\n    let currentLength = 0;\n\n    for (const member of vendorMembers) {\n      const m = member.trim();\n      const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n      if (idx === -1) {\n        continue;\n      }\n\n      const key = m.slice(0, idx);\n      const value = m.slice(idx + 1);\n      if (!validateKey(key) || !validateValue(value)) {\n        continue;\n      }\n\n      // Skip if adding the new member exceeds the length\n      const futureLength =\n        currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0);\n      if (futureLength > MAX_TRACE_STATE_LEN) {\n        continue;\n      }\n\n      // All good, add it\n      vendorEntries.set(key, value);\n      currentLength = futureLength;\n\n      // Check if we reached the max items\n      if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) {\n        break;\n      }\n    }\n\n    // Now we set the length & the Map in the right order\n    this._length = currentLength;\n    this._internalState = new Map(\n      Array.from(vendorEntries.entries()).reverse()\n    );\n    return this._internalState;\n  }\n\n  private _fromState(state: Map<string, string>, length: number): TraceState {\n    const traceState = Object.create(TraceState.prototype) as TraceState;\n    traceState._internalState = state;\n    traceState._length = length;\n    return traceState;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Context,\n  SpanContext,\n  TextMapGetter,\n  TextMapPropagator,\n  TextMapSetter,\n} from '@opentelemetry/api';\nimport { isSpanContextValid, trace, TraceFlags } from '@opentelemetry/api';\nimport { isTracingSuppressed } from './suppress-tracing';\nimport { TraceState } from './TraceState';\n\nexport const TRACE_PARENT_HEADER = 'traceparent';\nexport const TRACE_STATE_HEADER = 'tracestate';\n\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(\n  `^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`\n);\n\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n *     It should be dynamically generated server side to have the server's request trace Id,\n *     a parent span Id that was set on the server's request span,\n *     and the trace flags to indicate the server's sampling decision\n *     (01 = sampled, 00 = not sampled).\n *     for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n *     For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nexport function parseTraceParent(traceParent: string): SpanContext | null {\n  const match = TRACE_PARENT_REGEX.exec(traceParent);\n  if (!match) return null;\n\n  // According to the specification the implementation should be compatible\n  // with future versions. If there are more parts, we only reject it if it's using version 00\n  // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n  if (match[1] === '00' && match[5]) return null;\n\n  return {\n    traceId: match[2],\n    spanId: match[3],\n    traceFlags: parseInt(match[4], 16),\n  };\n}\n\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nexport class W3CTraceContextPropagator implements TextMapPropagator {\n  inject(context: Context, carrier: unknown, setter: TextMapSetter): void {\n    const spanContext = trace.getSpanContext(context);\n    if (\n      !spanContext ||\n      isTracingSuppressed(context) ||\n      !isSpanContextValid(spanContext)\n    )\n      return;\n\n    const traceParent = `${VERSION}-${spanContext.traceId}-${\n      spanContext.spanId\n    }-0${Number(spanContext.traceFlags || TraceFlags.NONE).toString(16)}`;\n\n    setter.set(carrier, TRACE_PARENT_HEADER, traceParent);\n    if (spanContext.traceState) {\n      setter.set(\n        carrier,\n        TRACE_STATE_HEADER,\n        spanContext.traceState.serialize()\n      );\n    }\n  }\n\n  extract(context: Context, carrier: unknown, getter: TextMapGetter): Context {\n    const traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER);\n    if (!traceParentHeader) return context;\n    const traceParent = Array.isArray(traceParentHeader)\n      ? traceParentHeader[0]\n      : traceParentHeader;\n    if (typeof traceParent !== 'string') return context;\n    const spanContext = parseTraceParent(traceParent);\n    if (!spanContext) return context;\n\n    spanContext.isRemote = true;\n\n    const traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER);\n    if (traceStateHeader) {\n      // If more than one `tracestate` header is found, we merge them into a\n      // single header.\n      const state = Array.isArray(traceStateHeader)\n        ? traceStateHeader.join(',')\n        : traceStateHeader;\n      spanContext.traceState = new TraceState(\n        typeof state === 'string' ? state : undefined\n      );\n    }\n    return trace.setSpanContext(context, spanContext);\n  }\n\n  fields(): string[] {\n    return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER];\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Error that is thrown on timeouts.\n */\nexport class TimeoutError extends Error {\n  constructor(message?: string) {\n    super(message);\n\n    // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see:\n    // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n    Object.setPrototypeOf(this, TimeoutError.prototype);\n  }\n}\n\n/**\n * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise\n * rejects, and resolves if the specified promise resolves.\n *\n * <p> NOTE: this operation will continue even after it throws a {@link TimeoutError}.\n *\n * @param promise promise to use with timeout.\n * @param timeout the timeout in milliseconds until the returned promise is rejected.\n */\nexport function callWithTimeout<T>(\n  promise: Promise<T>,\n  timeout: number\n): Promise<T> {\n  let timeoutHandle: ReturnType<typeof setTimeout>;\n\n  const timeoutPromise = new Promise<never>(function timeoutFunction(\n    _resolve,\n    reject\n  ) {\n    timeoutHandle = setTimeout(function timeoutHandler() {\n      reject(new TimeoutError('Operation timed out.'));\n    }, timeout);\n  });\n\n  return Promise.race([promise, timeoutPromise]).then(\n    result => {\n      clearTimeout(timeoutHandle);\n      return result;\n    },\n    reason => {\n      clearTimeout(timeoutHandle);\n      throw reason;\n    }\n  );\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class Deferred<T> {\n  private _promise: Promise<T>;\n  private _resolve!: (val: T) => void;\n  private _reject!: (error: unknown) => void;\n  constructor() {\n    this._promise = new Promise((resolve, reject) => {\n      this._resolve = resolve;\n      this._reject = reject;\n    });\n  }\n\n  get promise() {\n    return this._promise;\n  }\n\n  resolve(val: T) {\n    this._resolve(val);\n  }\n\n  reject(err: unknown) {\n    this._reject(err);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Deferred } from './promise';\n\n/**\n * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.\n */\nexport class BindOnceFuture<\n  R,\n  This = unknown,\n  T extends (this: This, ...args: unknown[]) => R = () => R,\n> {\n  private _isCalled = false;\n  private _deferred = new Deferred<R>();\n  private _callback: T;\n  private _that: This;\n\n  constructor(callback: T, that: This) {\n    this._callback = callback;\n    this._that = that;\n  }\n\n  get isCalled() {\n    return this._isCalled;\n  }\n\n  get promise() {\n    return this._deferred.promise;\n  }\n\n  call(...args: Parameters<T>): Promise<R> {\n    if (!this._isCalled) {\n      this._isCalled = true;\n      try {\n        Promise.resolve(this._callback.call(this._that, ...args)).then(\n          val => this._deferred.resolve(val),\n          err => this._deferred.reject(err)\n        );\n      } catch (err) {\n        this._deferred.reject(err);\n      }\n    }\n    return this._deferred.promise;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n  if (serviceName === undefined) {\n    try {\n      const argv0 = globalThis.process.argv0;\n      serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n    } catch {\n      serviceName = 'unknown_service';\n    }\n  }\n  return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n  serviceName = undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n  return (\n    val !== null &&\n    typeof val === 'object' &&\n    typeof (val as Partial<PromiseLike<R>>).then === 'function'\n  );\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes, AttributeValue } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n  ATTR_SERVICE_NAME,\n  ATTR_TELEMETRY_SDK_LANGUAGE,\n  ATTR_TELEMETRY_SDK_NAME,\n  ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport type {\n  DetectedResource,\n  DetectedResourceAttributes,\n  MaybePromise,\n  RawResourceAttribute,\n  ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n  private _rawAttributes: RawResourceAttribute[];\n  private _asyncAttributesPending = false;\n  private _schemaUrl?: string;\n\n  private _memoizedAttributes?: Attributes;\n\n  static FromAttributeList(\n    attributes: [string, MaybePromise<AttributeValue | undefined>][],\n    options?: ResourceOptions\n  ): Resource {\n    const res = new ResourceImpl({}, options);\n    res._rawAttributes = guardedRawAttributes(attributes);\n    res._asyncAttributesPending =\n      attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n    return res;\n  }\n\n  constructor(\n    /**\n     * A dictionary of attributes with string keys and values that provide\n     * information about the entity as numbers, strings or booleans\n     * TODO: Consider to add check/validation on attributes.\n     */\n    resource: DetectedResource,\n    options?: ResourceOptions\n  ) {\n    const attributes = resource.attributes ?? {};\n    this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n      if (isPromiseLike(v)) {\n        // side-effect\n        this._asyncAttributesPending = true;\n      }\n\n      return [k, v];\n    });\n\n    this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n    this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n  }\n\n  public get asyncAttributesPending(): boolean {\n    return this._asyncAttributesPending;\n  }\n\n  public async waitForAsyncAttributes(): Promise<void> {\n    if (!this.asyncAttributesPending) {\n      return;\n    }\n\n    for (let i = 0; i < this._rawAttributes.length; i++) {\n      const [k, v] = this._rawAttributes[i];\n      this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n    }\n\n    this._asyncAttributesPending = false;\n  }\n\n  public get attributes(): Attributes {\n    if (this.asyncAttributesPending) {\n      diag.error(\n        'Accessing resource attributes before async attributes settled'\n      );\n    }\n\n    if (this._memoizedAttributes) {\n      return this._memoizedAttributes;\n    }\n\n    const attrs: Attributes = {};\n    for (const [k, v] of this._rawAttributes) {\n      if (isPromiseLike(v)) {\n        diag.debug(`Unsettled resource attribute ${k} skipped`);\n        continue;\n      }\n      if (v != null) {\n        attrs[k] ??= v;\n      }\n    }\n\n    // only memoize output if all attributes are settled\n    if (!this._asyncAttributesPending) {\n      this._memoizedAttributes = attrs;\n    }\n\n    return attrs;\n  }\n\n  public getRawAttributes(): RawResourceAttribute[] {\n    return this._rawAttributes;\n  }\n\n  public get schemaUrl(): string | undefined {\n    return this._schemaUrl;\n  }\n\n  public merge(resource: Resource | null): Resource {\n    if (resource == null) return this;\n\n    // Order is important\n    // Spec states incoming attributes override existing attributes\n    const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n    const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n      ? { schemaUrl: mergedSchemaUrl }\n      : undefined;\n\n    return ResourceImpl.FromAttributeList(\n      [...resource.getRawAttributes(), ...this.getRawAttributes()],\n      mergedOptions\n    );\n  }\n}\n\nexport function resourceFromAttributes(\n  attributes: DetectedResourceAttributes,\n  options?: ResourceOptions\n): Resource {\n  return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n  detectedResource: DetectedResource,\n  options?: ResourceOptions\n): Resource {\n  return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n  return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n  return resourceFromAttributes({\n    [ATTR_SERVICE_NAME]: defaultServiceName(),\n    [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n    [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n    [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n  });\n}\n\nfunction guardedRawAttributes(\n  attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n  return attributes.map(([k, v]) => {\n    if (isPromiseLike(v)) {\n      return [\n        k,\n        v.catch(err => {\n          diag.debug(\n            'promise rejection for resource attribute: %s - %s',\n            k,\n            err\n          );\n          return undefined;\n        }),\n      ];\n    }\n    return [k, v];\n  });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n  if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n    return schemaUrl;\n  }\n\n  diag.warn(\n    'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n    schemaUrl\n  );\n\n  return undefined;\n}\n\nfunction mergeSchemaUrl(\n  old: Resource,\n  updating: Resource | null\n): string | undefined {\n  const oldSchemaUrl = old?.schemaUrl;\n  const updatingSchemaUrl = updating?.schemaUrl;\n\n  const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n  const isUpdatingEmpty =\n    updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n  if (isOldEmpty) {\n    return updatingSchemaUrl;\n  }\n\n  if (isUpdatingEmpty) {\n    return oldSchemaUrl;\n  }\n\n  if (oldSchemaUrl === updatingSchemaUrl) {\n    return oldSchemaUrl;\n  }\n\n  diag.warn(\n    'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n    oldSchemaUrl,\n    updatingSchemaUrl\n  );\n\n  return undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * The full URL of the document in which the telemetry was produced.\n *\n * This is distinct from `url.full`, which on browser telemetry describes what\n * the event itself is about: the navigated-to URL on `browser.navigation`, the\n * loaded resource on `browser.resource_timing`, the request target on fetch and\n * XHR spans. `browser.document.url.full` always identifies the page the user\n * was on when the telemetry was produced.\n *\n * @example \"https://example.com/checkout?step=2\"\n */\nexport const ATTR_BROWSER_DOCUMENT_URL_FULL =\n  'browser.document.url.full' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport type {\n  ReadableSpan,\n  Span,\n  SpanProcessor,\n} from '@opentelemetry/sdk-trace';\nimport { ATTR_BROWSER_DOCUMENT_URL_FULL } from './semconv.ts';\nimport type { DocumentProvider } from './types/DocumentProvider.ts';\n\n/**\n * DocumentSpanProcessor is a {@link SpanProcessor} that adds the\n * browser.document.url.full attribute\n */\nexport class DocumentSpanProcessor implements SpanProcessor {\n  private _documentProvider: DocumentProvider;\n\n  constructor(documentProvider: DocumentProvider) {\n    this._documentProvider = documentProvider;\n  }\n\n  /**\n   * Forces to export all finished spans\n   */\n  async forceFlush(): Promise<void> {}\n\n  /**\n   * Called when a {@link Span} is started, if the `span.isRecording()`\n   * returns true. The document URL is captured here, so a span that outlives\n   * a soft navigation keeps the URL of the page it started on.\n   *\n   * TODO: we may need the URL at `onEnd` instead, or both.\n   *\n   * @param span the Span that just started.\n   */\n  onStart(span: Span, _parentContext: Context): void {\n    const documentUrl = this._documentProvider?.getDocumentUrl();\n    if (documentUrl) {\n      span.setAttribute(ATTR_BROWSER_DOCUMENT_URL_FULL, documentUrl);\n    }\n  }\n\n  /**\n   * Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that just ended.\n   */\n  onEnd(_: ReadableSpan): void {\n    // no-op\n  }\n\n  /**\n   * Shuts down the processor. Called when SDK is shut down. This is an\n   * opportunity for processor to do any cleanup required.\n   */\n  async shutdown(): Promise<void> {}\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport type { DocumentProvider } from './types/DocumentProvider.ts';\n\nexport interface LocationDocumentProviderConfig {\n  /**\n   * Hook to redact or normalize the document URL before it is attached to\n   * telemetry. Use it to drop sensitive query parameters or to reduce the\n   * cardinality of the attribute.\n   *\n   * TODO: as discussed during the SIG, long URLs with query parameters\n   * may be out of scope for the document URL or contain sensitive information.\n   * This provides an option to trim the full URL.\n   *\n   * @defaultValue undefined, meaning the URL is reported as-is\n   */\n  sanitizeUrl?: (url: string) => string;\n}\n\n/**\n * LocationDocumentProvider is a {@link DocumentProvider} that reads the\n * current document URL from `location.href` at the time the telemetry is\n * created, so it follows soft navigations without any extra bookkeeping.\n */\nexport class LocationDocumentProvider implements DocumentProvider {\n  private _sanitizeUrl?: (url: string) => string;\n\n  constructor(config: LocationDocumentProviderConfig = {}) {\n    this._sanitizeUrl = config.sanitizeUrl;\n  }\n\n  getDocumentUrl(): string | null {\n    // `location` is absent when the module is evaluated outside a browser,\n    // for instance during server-side rendering.\n    if (typeof location === 'undefined') {\n      return null;\n    }\n\n    const url = location.href;\n    if (!this._sanitizeUrl) {\n      return url;\n    }\n\n    // This runs on every span start and every log emit, so a throwing hook\n    // must not be allowed to break telemetry creation.\n    try {\n      return this._sanitizeUrl(url);\n    } catch (error) {\n      diag.error('sanitizeUrl hook failed', error);\n      return null;\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LogRecordProcessor } from '@opentelemetry/sdk-logs';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace';\nimport { DocumentLogRecordProcessor } from './DocumentLogRecordProcessor.ts';\nimport { DocumentSpanProcessor } from './DocumentSpanProcessor.ts';\nimport type { LocationDocumentProviderConfig } from './LocationDocumentProvider.ts';\nimport { LocationDocumentProvider } from './LocationDocumentProvider.ts';\nimport type { DocumentProvider } from './types/DocumentProvider.ts';\n\nexport function createDocumentSpanProcessor(\n  documentProvider: DocumentProvider,\n): SpanProcessor {\n  return new DocumentSpanProcessor(documentProvider);\n}\n\nexport function createDocumentLogRecordProcessor(\n  documentProvider: DocumentProvider,\n): LogRecordProcessor {\n  return new DocumentLogRecordProcessor(documentProvider);\n}\n\nexport function createLocationDocumentProvider(\n  config?: LocationDocumentProviderConfig,\n): DocumentProvider {\n  return new LocationDocumentProvider(config);\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * A unique id to identify a session.\n *\n * @example \"00112233-4455-6677-8899-aabbccddeeff\"\n */\nexport const ATTR_SESSION_ID = 'session.id' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport type {\n  ReadableSpan,\n  Span,\n  SpanProcessor,\n} from '@opentelemetry/sdk-trace';\nimport { ATTR_SESSION_ID } from './semconv.ts';\nimport type { SessionProvider } from './types/SessionProvider.ts';\n\n/**\n * SessionSpanProcessor is a {@link SpanProcessor} that adds the session.id attribute\n */\nexport class SessionSpanProcessor implements SpanProcessor {\n  private _sessionIdProvider: SessionProvider;\n\n  constructor(sessionIdProvider: SessionProvider) {\n    this._sessionIdProvider = sessionIdProvider;\n  }\n\n  /**\n   * Forces to export all finished spans\n   */\n  async forceFlush(): Promise<void> {}\n\n  /**\n   * Called when a {@link Span} is started, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that just started.\n   */\n  onStart(span: Span, _parentContext: Context): void {\n    const sessionId = this._sessionIdProvider?.getSessionId();\n    if (sessionId) {\n      span.setAttribute(ATTR_SESSION_ID, sessionId);\n    }\n  }\n\n  /**\n   * Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that just ended.\n   */\n  onEnd(_: ReadableSpan): void {\n    // no-op\n  }\n\n  /**\n   * Shuts down the processor. Called when SDK is shut down. This is an\n   * opportunity for processor to do any cleanup required.\n   */\n  async shutdown(): Promise<void> {}\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LogRecordProcessor } from '@opentelemetry/sdk-logs';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace';\nimport { DefaultIdGenerator } from './DefaultIdGenerator.ts';\nimport { LocalStorageSessionStore } from './LocalStorageSessionStore.ts';\nimport { SessionLogRecordProcessor } from './SessionLogRecordProcessor.ts';\nimport type { SessionManagerConfig } from './SessionManager.ts';\nimport { SessionManager } from './SessionManager.ts';\nimport { SessionSpanProcessor } from './SessionSpanProcessor.ts';\nimport type { SessionIdGenerator } from './types/SessionIdGenerator.ts';\nimport type { SessionProvider } from './types/SessionProvider.ts';\nimport type { SessionStore } from './types/SessionStore.ts';\n\nexport function createSessionSpanProcessor(\n  sessionProvider: SessionProvider,\n): SpanProcessor {\n  return new SessionSpanProcessor(sessionProvider);\n}\n\nexport function createSessionLogRecordProcessor(\n  sessionProvider: SessionProvider,\n): LogRecordProcessor {\n  return new SessionLogRecordProcessor(sessionProvider);\n}\n\nexport function createSessionManager(\n  config: SessionManagerConfig,\n): SessionManager {\n  const manager = new SessionManager(config);\n  return manager;\n}\n\nexport function createDefaultSessionIdGenerator(): SessionIdGenerator {\n  return new DefaultIdGenerator();\n}\n\nexport function createLocalStorageSessionStore(): SessionStore {\n  return new LocalStorageSessionStore();\n}\n", "//#region package.json\nvar version = \"0.9.0\";\n//#endregion\nexport { version };\n\n//# sourceMappingURL=package.js.map", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { TracerProvider, MeterProvider } from '@opentelemetry/api';\nimport type { Instrumentation } from './types';\nimport type { LoggerProvider } from '@opentelemetry/api-logs';\n\n/**\n * Enable instrumentations\n * @param instrumentations\n * @param tracerProvider\n * @param meterProvider\n */\nexport function enableInstrumentations(\n  instrumentations: Instrumentation[],\n  tracerProvider?: TracerProvider,\n  meterProvider?: MeterProvider,\n  loggerProvider?: LoggerProvider\n): void {\n  for (let i = 0, j = instrumentations.length; i < j; i++) {\n    const instrumentation = instrumentations[i];\n    if (tracerProvider) {\n      instrumentation.setTracerProvider(tracerProvider);\n    }\n    if (meterProvider) {\n      instrumentation.setMeterProvider(meterProvider);\n    }\n    if (loggerProvider && instrumentation.setLoggerProvider) {\n      instrumentation.setLoggerProvider(loggerProvider);\n    }\n    // instrumentations have been already enabled during creation\n    // so enable only if user prevented that by setting enabled to false\n    // this is to prevent double enabling but when calling register all\n    // instrumentations should be now enabled\n    if (!instrumentation.getConfig().enabled) {\n      instrumentation.enable();\n    }\n  }\n}\n\n/**\n * Disable instrumentations\n * @param instrumentations\n */\nexport function disableInstrumentations(\n  instrumentations: Instrumentation[]\n): void {\n  instrumentations.forEach(instrumentation => instrumentation.disable());\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { trace, metrics } from '@opentelemetry/api';\nimport { logs } from '@opentelemetry/api-logs';\nimport {\n  disableInstrumentations,\n  enableInstrumentations,\n} from './autoLoaderUtils';\nimport type { AutoLoaderOptions } from './types_internal';\n\n/**\n * It will register instrumentations and plugins\n * @param options\n * @return returns function to unload instrumentation and plugins that were\n *   registered\n */\nexport function registerInstrumentations(\n  options: AutoLoaderOptions\n): () => void {\n  const tracerProvider = options.tracerProvider || trace.getTracerProvider();\n  const meterProvider = options.meterProvider || metrics.getMeterProvider();\n  const loggerProvider = options.loggerProvider || logs.getLoggerProvider();\n  const instrumentations = options.instrumentations?.flat() ?? [];\n\n  enableInstrumentations(\n    instrumentations,\n    tracerProvider,\n    meterProvider,\n    loggerProvider\n  );\n\n  return () => {\n    disableInstrumentations(instrumentations);\n  };\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * BSD 2-Clause License\n *\n * Copyright (c) 2013-2019, Forrest L Norvell\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice, this\n *   list of conditions and the following disclaimer.\n *\n * * Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* Modified by OpenTelemetry Authors\n *  - converted to TypeScript\n *  - aligned with style-guide\n */\n\nimport type { ShimWrapped } from './types';\n\n// Default to complaining loudly when things don't go according to plan.\n// eslint-disable-next-line no-console\nlet logger: typeof console.error = console.error.bind(console);\n\n// Sets a property on an object, preserving its enumerability.\n// This function assumes that the property is already writable.\nfunction defineProperty(obj: object, name: PropertyKey, value: unknown): void {\n  const enumerable =\n    !!obj[name as keyof typeof obj] &&\n    Object.prototype.propertyIsEnumerable.call(obj, name);\n\n  Object.defineProperty(obj, name, {\n    configurable: true,\n    enumerable,\n    writable: true,\n    value,\n  });\n}\n\nexport const wrap = <Nodule extends object, FieldName extends keyof Nodule>(\n  nodule: Nodule,\n  name: FieldName,\n  wrapper: (original: Nodule[FieldName], name: FieldName) => Nodule[FieldName]\n): ShimWrapped | undefined => {\n  if (!nodule || !nodule[name]) {\n    logger('no original function ' + String(name) + ' to wrap');\n    return;\n  }\n\n  if (!wrapper) {\n    logger('no wrapper function');\n    logger(new Error().stack);\n    return;\n  }\n\n  const original = nodule[name];\n\n  if (typeof original !== 'function' || typeof wrapper !== 'function') {\n    logger('original object and wrapper must be functions');\n    return;\n  }\n\n  const wrapped = wrapper(original, name) as object;\n\n  defineProperty(wrapped, '__original', original);\n  defineProperty(wrapped, '__unwrap', () => {\n    if (nodule[name] === wrapped) {\n      defineProperty(nodule, name, original);\n    }\n  });\n  defineProperty(wrapped, '__wrapped', true);\n  defineProperty(nodule, name, wrapped);\n  return wrapped as ShimWrapped;\n};\n\nexport const massWrap = <Nodule extends object, FieldName extends keyof Nodule>(\n  nodules: Nodule[],\n  names: FieldName[],\n  wrapper: (original: Nodule[FieldName]) => Nodule[FieldName]\n): void => {\n  if (!nodules) {\n    logger('must provide one or more modules to patch');\n    logger(new Error().stack);\n    return;\n  } else if (!Array.isArray(nodules)) {\n    nodules = [nodules];\n  }\n\n  if (!(names && Array.isArray(names))) {\n    logger('must provide one or more functions to wrap on modules');\n    return;\n  }\n\n  nodules.forEach(nodule => {\n    names.forEach(name => {\n      wrap(nodule, name, wrapper);\n    });\n  });\n};\n\nexport const unwrap = <Nodule extends object>(\n  nodule: Nodule,\n  name: keyof Nodule\n): void => {\n  if (!nodule || !nodule[name]) {\n    logger('no function to unwrap.');\n    logger(new Error().stack);\n    return;\n  }\n\n  const wrapped = nodule[name] as unknown as ShimWrapped;\n\n  if (!wrapped.__unwrap) {\n    logger(\n      'no original to unwrap to -- has ' +\n        String(name) +\n        ' already been unwrapped?'\n    );\n  } else {\n    wrapped.__unwrap();\n    return;\n  }\n};\n\nexport const massUnwrap = <Nodule extends object>(\n  nodules: Nodule[],\n  names: Array<keyof Nodule>\n): void => {\n  if (!nodules) {\n    logger('must provide one or more modules to patch');\n    logger(new Error().stack);\n    return;\n  } else if (!Array.isArray(nodules)) {\n    nodules = [nodules];\n  }\n\n  if (!(names && Array.isArray(names))) {\n    logger('must provide one or more functions to unwrap on modules');\n    return;\n  }\n\n  nodules.forEach(nodule => {\n    names.forEach(name => {\n      unwrap(nodule, name);\n    });\n  });\n};\n\nexport interface ShimmerOptions {\n  logger?: typeof console.error;\n}\n\nexport default function shimmer(options: ShimmerOptions): void {\n  if (options && options.logger) {\n    if (typeof options.logger !== 'function') {\n      logger(\"new logger isn't a function, not replacing\");\n    } else {\n      logger = options.logger;\n    }\n  }\n}\n\nshimmer.wrap = wrap;\nshimmer.massWrap = massWrap;\nshimmer.unwrap = unwrap;\nshimmer.massUnwrap = massUnwrap;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  DiagLogger,\n  Meter,\n  MeterProvider,\n  Tracer,\n  TracerProvider,\n  Span,\n} from '@opentelemetry/api';\nimport { diag, metrics, trace } from '@opentelemetry/api';\nimport type { Logger, LoggerProvider } from '@opentelemetry/api-logs';\nimport { logs } from '@opentelemetry/api-logs';\nimport * as shimmer from './shimmer';\nimport type {\n  InstrumentationModuleDefinition,\n  Instrumentation,\n  InstrumentationConfig,\n  SpanCustomizationHook,\n} from './types';\n\n/**\n * Base abstract internal class for instrumenting node and web plugins\n */\nexport abstract class InstrumentationAbstract<\n  ConfigType extends InstrumentationConfig = InstrumentationConfig,\n> implements Instrumentation<ConfigType>\n{\n  protected _config: ConfigType = {} as ConfigType;\n\n  private _tracer: Tracer;\n  private _meter: Meter;\n  private _logger: Logger;\n  protected _diag: DiagLogger;\n  public readonly instrumentationName: string;\n  public readonly instrumentationVersion: string;\n\n  constructor(\n    instrumentationName: string,\n    instrumentationVersion: string,\n    config: ConfigType\n  ) {\n    this.instrumentationName = instrumentationName;\n    this.instrumentationVersion = instrumentationVersion;\n\n    this.setConfig(config);\n\n    this._diag = diag.createComponentLogger({\n      namespace: instrumentationName,\n    });\n\n    this._tracer = trace.getTracer(instrumentationName, instrumentationVersion);\n    this._meter = metrics.getMeter(instrumentationName, instrumentationVersion);\n    this._logger = logs.getLogger(instrumentationName, instrumentationVersion);\n    this._updateMetricInstruments();\n  }\n\n  /* Api to wrap instrumented method */\n  protected _wrap = shimmer.wrap;\n  /* Api to unwrap instrumented methods */\n  protected _unwrap = shimmer.unwrap;\n  /* Api to mass wrap instrumented method */\n  protected _massWrap = shimmer.massWrap;\n  /* Api to mass unwrap instrumented methods */\n  protected _massUnwrap = shimmer.massUnwrap;\n\n  /* Returns meter */\n  protected get meter(): Meter {\n    return this._meter;\n  }\n\n  /**\n   * Sets MeterProvider to this plugin\n   * @param meterProvider\n   */\n  public setMeterProvider(meterProvider: MeterProvider): void {\n    this._meter = meterProvider.getMeter(\n      this.instrumentationName,\n      this.instrumentationVersion\n    );\n\n    this._updateMetricInstruments();\n  }\n\n  /* Returns logger */\n  protected get logger(): Logger {\n    return this._logger;\n  }\n\n  /**\n   * Sets LoggerProvider to this plugin\n   * @param loggerProvider\n   */\n  public setLoggerProvider(loggerProvider: LoggerProvider): void {\n    this._logger = loggerProvider.getLogger(\n      this.instrumentationName,\n      this.instrumentationVersion\n    );\n  }\n\n  /**\n   * @experimental\n   *\n   * Get module definitions defined by {@link init}.\n   * This can be used for experimental compile-time instrumentation.\n   *\n   * @returns an array of {@link InstrumentationModuleDefinition}\n   */\n  public getModuleDefinitions(): InstrumentationModuleDefinition[] {\n    const initResult = this.init() ?? [];\n    if (!Array.isArray(initResult)) {\n      return [initResult];\n    }\n\n    return initResult;\n  }\n\n  /**\n   * Sets the new metric instruments with the current Meter.\n   */\n  protected _updateMetricInstruments(): void {\n    return;\n  }\n\n  /* Returns InstrumentationConfig */\n  public getConfig(): ConfigType {\n    return this._config;\n  }\n\n  /**\n   * Sets InstrumentationConfig to this plugin\n   * @param config\n   */\n  public setConfig(config: ConfigType): void {\n    // copy config first level properties to ensure they are immutable.\n    // nested properties are not copied, thus are mutable from the outside.\n    this._config = {\n      enabled: true,\n      ...config,\n    };\n  }\n\n  /**\n   * Sets TracerProvider to this plugin\n   * @param tracerProvider\n   */\n  public setTracerProvider(tracerProvider: TracerProvider): void {\n    this._tracer = tracerProvider.getTracer(\n      this.instrumentationName,\n      this.instrumentationVersion\n    );\n  }\n\n  /* Returns tracer */\n  protected get tracer(): Tracer {\n    return this._tracer;\n  }\n\n  /* Enable plugin */\n  public abstract enable(): void;\n\n  /* Disable plugin */\n  public abstract disable(): void;\n\n  /**\n   * Init method in which plugin should define _modules and patches for\n   * methods.\n   */\n  protected abstract init():\n    | InstrumentationModuleDefinition\n    | InstrumentationModuleDefinition[]\n    | void;\n\n  /**\n   * Execute span customization hook, if configured, and log any errors.\n   * Any semantics of the trigger and info are defined by the specific instrumentation.\n   * @param hookHandler The optional hook handler which the user has configured via instrumentation config\n   * @param triggerName The name of the trigger for executing the hook for logging purposes\n   * @param span The span to which the hook should be applied\n   * @param info The info object to be passed to the hook, with useful data the hook may use\n   */\n  protected _runSpanCustomizationHook<SpanCustomizationInfoType>(\n    hookHandler: SpanCustomizationHook<SpanCustomizationInfoType> | undefined,\n    triggerName: string,\n    span: Span,\n    info: SpanCustomizationInfoType\n  ) {\n    if (!hookHandler) {\n      return;\n    }\n\n    try {\n      hookHandler(span, info);\n    } catch (e) {\n      this._diag.error(\n        'Error running span customization hook due to exception in handler',\n        { triggerName },\n        e\n      );\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InstrumentationAbstract } from '../../instrumentation';\nimport type * as types from '../../types';\nimport type { InstrumentationConfig } from '../../types';\n\n/**\n * Base abstract class for instrumenting web plugins\n */\nexport abstract class InstrumentationBase<\n    ConfigType extends InstrumentationConfig = InstrumentationConfig,\n  >\n  extends InstrumentationAbstract<ConfigType>\n  implements types.Instrumentation<ConfigType>\n{\n  constructor(\n    instrumentationName: string,\n    instrumentationVersion: string,\n    config: ConfigType\n  ) {\n    super(instrumentationName, instrumentationVersion, config);\n\n    if (this._config.enabled) {\n      this.enable();\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ShimWrapped } from './types';\n\n/**\n * function to execute patched function and being able to catch errors\n * @param execute - function to be executed\n * @param onFinish - callback to run when execute finishes\n */\nexport function safeExecuteInTheMiddle<T>(\n  execute: () => T,\n  onFinish: (e: Error | undefined, result: T | undefined) => void,\n  preventThrowingError?: boolean\n): T {\n  let error: Error | undefined;\n  let result: T | undefined;\n  try {\n    result = execute();\n  } catch (e) {\n    error = e;\n  } finally {\n    onFinish(error, result);\n    if (error && !preventThrowingError) {\n      // eslint-disable-next-line no-unsafe-finally\n      throw error;\n    }\n    // eslint-disable-next-line no-unsafe-finally\n    return result as T;\n  }\n}\n\n/**\n * Async function to execute patched function and being able to catch errors\n * @param execute - function to be executed\n * @param onFinish - callback to run when execute finishes\n */\nexport async function safeExecuteInTheMiddleAsync<T>(\n  execute: () => T,\n  onFinish: (\n    e: Error | undefined,\n    result: T | undefined\n  ) => Promise<void> | void,\n  preventThrowingError?: boolean\n): Promise<T> {\n  let error: Error | undefined;\n  let result: T | undefined;\n  try {\n    result = await execute();\n  } catch (e) {\n    error = e;\n  } finally {\n    await onFinish(error, result);\n    if (error && !preventThrowingError) {\n      // eslint-disable-next-line no-unsafe-finally\n      throw error;\n    }\n    // eslint-disable-next-line no-unsafe-finally\n    return result as T;\n  }\n}\n/**\n * Checks if certain function has been already wrapped\n * @param func\n */\nexport function isWrapped(func: unknown): func is ShimWrapped {\n  return (\n    typeof func === 'function' &&\n    typeof (func as ShimWrapped).__original === 'function' &&\n    typeof (func as ShimWrapped).__unwrap === 'function' &&\n    (func as ShimWrapped).__wrapped === true\n  );\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport type { AnyValueMap, LogRecord } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport {\n  InstrumentationBase,\n  safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n  ATTR_EXCEPTION_MESSAGE,\n  ATTR_EXCEPTION_STACKTRACE,\n  ATTR_EXCEPTION_TYPE,\n} from '@opentelemetry/semantic-conventions';\nimport { version } from '../../package.json' with { type: 'json' };\nimport type { ErrorsInstrumentationConfig } from './types.ts';\n\nconst EXCEPTION_EVENT_NAME = 'exception';\n\nexport class ErrorsInstrumentation extends InstrumentationBase<ErrorsInstrumentationConfig> {\n  // Use `declare` to prevent JS class field initializers from running after\n  // super(), which would reset values set by the enable() call that\n  // InstrumentationBase makes during its constructor.\n  declare private _isEnabled: boolean;\n  declare private _onErrorHandler?: (\n    event: ErrorEvent | PromiseRejectionEvent,\n  ) => void;\n\n  constructor(config: ErrorsInstrumentationConfig = {}) {\n    super('@opentelemetry/browser-instrumentation/errors', version, config);\n  }\n\n  protected override init() {\n    return [];\n  }\n\n  override enable(): void {\n    if (this._isEnabled) {\n      return;\n    }\n    this._isEnabled = true;\n\n    this._onErrorHandler = (event) => this._onError(event);\n    window.addEventListener('error', this._onErrorHandler);\n    window.addEventListener('unhandledrejection', this._onErrorHandler);\n  }\n\n  override disable(): void {\n    if (!this._isEnabled) {\n      return;\n    }\n    this._isEnabled = false;\n\n    if (this._onErrorHandler) {\n      window.removeEventListener('error', this._onErrorHandler);\n      window.removeEventListener('unhandledrejection', this._onErrorHandler);\n      this._onErrorHandler = undefined;\n    }\n  }\n\n  private _onError(event: ErrorEvent | PromiseRejectionEvent): void {\n    const isRejection = 'reason' in event;\n    let error: Error | string | null | undefined = isRejection\n      ? event.reason\n      : event.error;\n\n    // Cross-origin scripts deliver an ErrorEvent with `event.error` null but\n    // a populated `event.message` (the canonical \"Script error.\" sanitized\n    // message). Treat that message as a string error so these events still\n    // surface as an exception log instead of being silently dropped.\n    // PromiseRejectionEvent has no analogous message field, so it stays a\n    // no-op.\n    if (\n      error == null &&\n      !isRejection &&\n      typeof event.message === 'string' &&\n      event.message.length > 0\n    ) {\n      error = event.message;\n    }\n\n    if (error == null) {\n      // Emit a diag debug message so the drop is observable. Anything that\n      // lands here had no usable signal (ErrorEvent with no error and no\n      // message, or PromiseRejectionEvent rejected with null/undefined). Pass\n      // the raw value too so the reader can tell null from undefined when\n      // investigating a missing capture.\n      this._diag.debug(\n        isRejection\n          ? 'ignored unhandledrejection event with no reason'\n          : 'ignored error event with no error and no message',\n        error,\n      );\n      return;\n    }\n\n    // Capture as a const so the type narrowing survives into the closure below.\n    const capturedError = error;\n\n    // This runs inside a global error listener, so an escaping throw would\n    // re-trigger the listener and loop. Both attribute extraction (a rejection\n    // can carry a value whose `stack` getter throws) and emit (a broken\n    // LogRecordProcessor) can throw, so contain the whole path.\n    safeExecuteInTheMiddle(\n      () => {\n        let errorAttributes: AnyValueMap;\n        if (typeof capturedError === 'string') {\n          errorAttributes = { [ATTR_EXCEPTION_MESSAGE]: capturedError };\n        } else {\n          errorAttributes = {\n            [ATTR_EXCEPTION_TYPE]: capturedError.name,\n            [ATTR_EXCEPTION_MESSAGE]: capturedError.message,\n            [ATTR_EXCEPTION_STACKTRACE]: capturedError.stack,\n          };\n        }\n\n        const customAttributes = this._applyCustomAttributes(capturedError);\n\n        const logRecord: LogRecord = {\n          eventName: EXCEPTION_EVENT_NAME,\n          severityNumber: SeverityNumber.ERROR,\n          attributes: { ...errorAttributes, ...customAttributes },\n        };\n\n        this.logger.emit(logRecord);\n      },\n      (err) => {\n        if (err) {\n          this._diag.error('failed to record exception', err);\n        }\n      },\n      true,\n    );\n  }\n\n  private _applyCustomAttributes(error: Error | string): Attributes {\n    const hook = this.getConfig().applyCustomAttributes;\n    if (!hook) {\n      return {};\n    }\n    let result: Attributes = {};\n    safeExecuteInTheMiddle(\n      () => {\n        result = hook(error);\n      },\n      (err) => {\n        if (err) {\n          this._diag.error('applyCustomAttributes hook failed', err);\n        }\n      },\n      true,\n    );\n    return result;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context, Span } from '@opentelemetry/api';\nimport { ROOT_CONTEXT, trace } from '@opentelemetry/api';\n\ntype StoredRecord<TData> = TData & { ctx: Context };\n\nconst MAX_CAPACITY = 1000;\n\n/**\n * Base class for sharing OTel span context between two instrumentations that\n * observe the same events from different angles.\n *\n * The producing instrumentation calls `register()` when a span ends; the\n * consuming instrumentation calls `getContext()` to retrieve the span context\n * associated with the event it is processing.\n *\n * @typeParam TData - Registration payload. Must include enough info to derive a `key` string\n *   which will be used as the primary index, plus any implementation-specific fields needed to\n *   disambiguate concurrent operations (e.g. timing windows for network spans).\n * @typeParam TLookup - The object the consuming instrumentation passes to\n *   `getContext` and `unregister` (e.g. a `PerformanceResourceTiming` entry).\n */\nexport abstract class ContextRegistry<TData, TLookup> {\n  protected _recordsByKey = new Map<string, StoredRecord<TData>[]>();\n  private _recordsList: StoredRecord<TData>[] = [];\n\n  /** Store the span context for the given data, key is resolved by getDataKey(). */\n  register(span: Span, data: TData): void {\n    const ctx = trace.setSpan(ROOT_CONTEXT, span);\n    const key = this.getDataKey(data);\n    const list = this._recordsByKey.get(key) ?? [];\n    const record = { ...data, ctx };\n\n    // Set record into the map for faster lookup and in the\n    // list to track the size\n    list.push(record);\n    this._recordsByKey.set(key, list);\n    this._recordsList.push(record);\n\n    // If capacity is exceeded remove the oldest (1st in the array)\n    if (this._recordsList.length > MAX_CAPACITY) {\n      const oldestRecord = this._recordsList.shift();\n      if (oldestRecord) {\n        const oldestKey = this.getDataKey(oldestRecord);\n        const oldestCtx = oldestRecord.ctx;\n        this.removeByKey(oldestKey, oldestCtx);\n      }\n    }\n  }\n\n  /**\n   * Remove the record that matches `lookup`. If no matching record exists this\n   * is a no-op. Deletes the key entirely once all records under it are removed.\n   */\n  unregister(lookup: TLookup): void {\n    const key = this.getLookupKey(lookup);\n    const ctx = this.getContext(lookup);\n    if (ctx === undefined) {\n      return;\n    }\n\n    // Remove from the lookup map and from the global list\n    // to keep size up to date\n    this.removeByKey(key, ctx);\n    const index = this._recordsList.findIndex((r) => {\n      const k = this.getDataKey(r);\n      return key === k && ctx === r.ctx;\n    });\n    if (index > -1) {\n      this._recordsList.splice(index, 1);\n    }\n  }\n\n  /**\n   * Remove a record from the records sub-list of the given key\n   */\n  private removeByKey(key: string, ctx: Context): void {\n    const list = this._recordsByKey.get(key);\n    if (!list) {\n      return;\n    }\n\n    const filtered = list.filter((r) => r.ctx !== ctx);\n    if (filtered.length === 0) {\n      this._recordsByKey.delete(key);\n    } else {\n      this._recordsByKey.set(key, filtered);\n    }\n  }\n\n  /**\n   * Return the size number of records stored in the registry\n   */\n  size(): number {\n    return this._recordsList.length;\n  }\n\n  /** Return the index key for the given data object. */\n  abstract getDataKey(data: TData): string;\n\n  /** Return the index key for the given lookup object. */\n  abstract getLookupKey(lookup: TLookup): string;\n\n  /**\n   * Return the OTel context for the record that matches `lookup`, or\n   * `undefined` if no match is found.\n   */\n  abstract getContext(lookup: TLookup): Context | undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport { ContextRegistry } from './ContextRegistry.ts';\n\nexport interface NetworkSpanData {\n  key: string;\n  startPerfNow: number;\n  endPerfNow: number;\n}\n\nexport class NetworkContextRegistry extends ContextRegistry<\n  NetworkSpanData,\n  PerformanceResourceTiming\n> {\n  getDataKey(data: NetworkSpanData): string {\n    return data.key;\n  }\n\n  getLookupKey(entry: PerformanceResourceTiming): string {\n    return entry.name;\n  }\n\n  getContext(entry: PerformanceResourceTiming): Context | undefined {\n    const key = this.getLookupKey(entry);\n    const list = this._recordsByKey.get(key);\n    return list?.find(\n      (r) =>\n        entry.fetchStart >= r.startPerfNow && entry.responseEnd <= r.endPerfNow,\n    )?.ctx;\n  }\n}\n\nlet _instance: NetworkContextRegistry | undefined;\n\nexport function getNetworkContextRegistry(): NetworkContextRegistry {\n  if (!_instance) {\n    _instance = new NetworkContextRegistry();\n  }\n\n  return _instance;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nconst DIAG_LOGGER = diag.createComponentLogger({\n  namespace: '@opentelemetry/browser-instrumentation/utils/request',\n});\n\nfunction isDocument(value: unknown): value is Document {\n  return typeof Document !== 'undefined' && value instanceof Document;\n}\n\n/**\n * Helper function to determine payload content length for fetch requests\n *\n * The fetch API is kinda messy: there are a couple of ways the body can be passed in.\n *\n * In all cases, the body param can be some variation of ReadableStream,\n * and ReadableStreams can only be read once! We want to avoid consuming the body here,\n * because that would mean that the body never gets sent with the actual fetch request.\n *\n * Either the first arg is a Request object, which can be cloned\n *   so we can clone that object and read the body of the clone\n *   without disturbing the original argument\n *   However, reading the body here can only be done async; the body() method returns a promise\n *   this means this entire function has to return a promise\n *\n * OR the first arg is a url/string\n *   in which case the second arg has type RequestInit\n *   RequestInit is NOT cloneable, but RequestInit.body is writable\n *   so we can chain it into ReadableStream.pipeThrough()\n *\n *   ReadableStream.pipeThrough() lets us process a stream and returns a new stream\n *   So we can measure the body length as it passes through the pipe, but need to attach\n *   the new stream to the original request\n *   so that the browser still has access to the body.\n */\nexport async function getFetchBodyLength(\n  ...args: Parameters<typeof fetch>\n): Promise<number | undefined> {\n  if (args[0] instanceof URL || typeof args[0] === 'string') {\n    const requestInit = args[1];\n    if (!requestInit?.body) {\n      return undefined;\n    }\n    if (requestInit.body instanceof ReadableStream) {\n      const { body, length } = _getBodyNonDestructively(requestInit.body);\n      requestInit.body = body;\n\n      return await length;\n    } else {\n      return getXHRBodyLength(requestInit.body);\n    }\n  } else {\n    const info = args[0];\n    // Request.body has limited availability. ref: https://developer.mozilla.org/en-US/docs/Web/API/Request/body\n    // Accessing it here triggers a eslint error from the baseline plugin\n    /* eslint-disable baseline-js/use-baseline */\n    if (!info?.body) {\n      return undefined;\n    }\n    /* eslint-enable baseline-js/use-baseline */\n\n    const text = await info.clone().text();\n    return getByteLength(text);\n  }\n}\n\n// This function returns the body right away piped to a transform stream\n// if available. The length is returned as a promise because the original\n// fetch logic has to consume the body to get the final value.\nfunction _getBodyNonDestructively(body: ReadableStream): {\n  body: ReadableStream;\n  length: Promise<number | undefined>;\n} {\n  // can't read a ReadableStream without destroying it\n  // but we CAN pipe it through and return a new ReadableStream\n\n  // some (older) platforms don't expose the pipeThrough method and in that scenario, we're out of luck;\n  //   there's no way to read the stream without consuming it.\n  if (!body.pipeThrough) {\n    DIAG_LOGGER.warn('Platform has ReadableStream but not pipeThrough!');\n    return {\n      body,\n      length: Promise.resolve(undefined),\n    };\n  }\n\n  let length = 0;\n  let resolveLength: (l: number | undefined) => void;\n  const lengthPromise = new Promise<number | undefined>((resolve) => {\n    resolveLength = resolve;\n  });\n\n  const bodyReader = (body as ReadableStream<Uint8Array>).getReader();\n  const bodyWrapper = new ReadableStream<Uint8Array>({\n    async pull(controller) {\n      const { value, done } = await bodyReader.read();\n\n      length += value?.byteLength || 0;\n      if (done) {\n        controller.close();\n        bodyReader.releaseLock();\n        resolveLength(length);\n        return;\n      }\n      controller.enqueue(value);\n    },\n    cancel(reason) {\n      resolveLength(undefined);\n      bodyReader.cancel(reason);\n    },\n  });\n\n  return {\n    body: bodyWrapper,\n    length: lengthPromise,\n  };\n}\n\n/**\n * Helper function to determine payload content length for XHR requests\n */\nexport function getXHRBodyLength(\n  body: Document | XMLHttpRequestBodyInit,\n): number | undefined {\n  if (isDocument(body)) {\n    return new XMLSerializer().serializeToString(body).length;\n  }\n\n  // XMLHttpRequestBodyInit expands to the following:\n  if (typeof body === 'string') {\n    return getByteLength(body);\n  }\n\n  if (body instanceof Blob) {\n    return body.size;\n  }\n\n  if (body instanceof FormData) {\n    return getFormDataSize(body);\n  }\n\n  if (body instanceof URLSearchParams) {\n    return getByteLength(body.toString());\n  }\n\n  // ArrayBuffer | ArrayBufferView\n  if (body.byteLength !== undefined) {\n    return body.byteLength;\n  }\n\n  DIAG_LOGGER.warn('unknown body type');\n  return undefined;\n}\n\nconst TEXT_ENCODER = new TextEncoder();\nfunction getByteLength(s: string): number {\n  return TEXT_ENCODER.encode(s).byteLength;\n}\n\nfunction getFormDataSize(formData: FormData): number {\n  let size = 0;\n  for (const [key, value] of formData.entries()) {\n    size += key.length;\n    if (value instanceof Blob) {\n      size += value.size;\n    } else {\n      size += value.length;\n    }\n  }\n  return size;\n}\n\nconst DEFAULT_KNOWN_METHODS = {\n  CONNECT: true,\n  DELETE: true,\n  GET: true,\n  HEAD: true,\n  OPTIONS: true,\n  PATCH: true,\n  POST: true,\n  PUT: true,\n  TRACE: true,\n  // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/\n  QUERY: true,\n};\n/**\n * Normalize an HTTP request method string per `http.request.method` spec\n * https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-client-span\n */\nexport function normalizeHttpRequestMethod(method: string): string {\n  const methUpper = method.toUpperCase();\n  if (Object.hasOwn(DEFAULT_KNOWN_METHODS, methUpper)) {\n    return methUpper;\n  }\n  return '_OTHER';\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nconst SENSITIVE_PARAMS = [\n  'password',\n  'passwd',\n  'secret',\n  'api_key',\n  'apikey',\n  'auth',\n  'authorization',\n  'token',\n  'access_token',\n  'refresh_token',\n  'jwt',\n  'session',\n  'sessionid',\n  'key',\n  'private_key',\n  'client_secret',\n  'client_id',\n  'signature',\n  'hash',\n];\n\n/**\n * Default URL sanitization function that redacts credentials and sensitive query parameters.\n * This is the default implementation used when no custom sanitizeUrl callback is provided.\n *\n * @param url - The URL to sanitize\n * @returns The sanitized URL with credentials and sensitive parameters redacted\n */\nexport function defaultSanitizeUrl(url: string): string {\n  try {\n    const urlObj = new URL(url);\n    if (urlObj.username || urlObj.password) {\n      urlObj.username = 'REDACTED';\n      urlObj.password = 'REDACTED';\n    }\n    for (const param of SENSITIVE_PARAMS) {\n      if (urlObj.searchParams.has(param)) {\n        urlObj.searchParams.set(param, 'REDACTED');\n      }\n    }\n    return urlObj.toString();\n  } catch {\n    let sanitized = url.replace(/\\/\\/[^:/@]+:[^/@]+@/, '//REDACTED:REDACTED@');\n    for (const param of SENSITIVE_PARAMS) {\n      const regex = new RegExp(`([?&]${param}(?:%3D|=))[^&]*`, 'gi');\n      sanitized = sanitized.replace(regex, '$1REDACTED');\n    }\n    return sanitized;\n  }\n}\n\n/**\n * Parses a URL, resolving relative URLs against document.baseURI (or location.href)\n * @param url\n */\nexport function parseUrl(url: string): URL {\n  return new URL(url, document?.baseURI || location?.href);\n}\n\n/**\n * Tells if the given URL matches any of the string|RegExp provided in the list\n * @param url\n * @param urlsToMatch\n */\nexport function matchesUrl(\n  url: string,\n  urlsToMatch?: Array<string | RegExp>,\n): boolean {\n  if (!urlsToMatch) {\n    return false;\n  }\n\n  for (const urlToMatch of urlsToMatch) {\n    if (typeof urlToMatch === 'string') {\n      if (url === urlToMatch) {\n        return true;\n      }\n    } else if (url.match(urlToMatch)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nconst HTTP_PORT_FROM_PROTOCOL: { [key: string]: string } = {\n  'https:': '443',\n  'http:': '80',\n};\n/**\n * Extracts the server port from the given URL object\n */\nexport function serverPortFromUrl(url: URL): number | undefined {\n  const serverPort = Number(url.port || HTTP_PORT_FROM_PROTOCOL[url.protocol]);\n  // Guard with `if (serverPort)` because `Number('') === 0`.\n  if (serverPort && !Number.isNaN(serverPort)) {\n    return serverPort;\n  } else {\n    return undefined;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n *\n * @example 3495\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HTTP_REQUEST_BODY_SIZE = 'http.request.body.size' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes, Context, Span } from '@opentelemetry/api';\nimport {\n  context,\n  propagation,\n  SpanKind,\n  SpanStatusCode,\n  trace,\n} from '@opentelemetry/api';\nimport {\n  InstrumentationBase,\n  safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n  ATTR_ERROR_TYPE,\n  ATTR_HTTP_REQUEST_METHOD,\n  ATTR_HTTP_REQUEST_METHOD_ORIGINAL,\n  ATTR_HTTP_RESPONSE_STATUS_CODE,\n  ATTR_SERVER_ADDRESS,\n  ATTR_SERVER_PORT,\n  ATTR_URL_FULL,\n} from '@opentelemetry/semantic-conventions';\nimport { version } from '../../package.json' with { type: 'json' };\nimport { getNetworkContextRegistry } from '../utils/NetworkContextRegistry.ts';\nimport {\n  getFetchBodyLength,\n  normalizeHttpRequestMethod,\n} from '../utils/request.ts';\nimport { matchesUrl, parseUrl, serverPortFromUrl } from '../utils/url.ts';\nimport { ATTR_HTTP_REQUEST_BODY_SIZE } from './semconv.ts';\nimport type {\n  FetchError,\n  FetchInstrumentationConfig,\n  FetchResponse,\n} from './types.ts';\n\nconst hasBrowserPerformanceAPI = typeof PerformanceObserver !== 'undefined';\n\nexport class FetchInstrumentation extends InstrumentationBase<FetchInstrumentationConfig> {\n  // Note: Intentionally *not* using `_enabled` as the field name to avoid\n  // any possible confusion with the `_enabled` field used on the *Node.js*\n  // InstrumentationBase class.\n  // Also not initializing the fields to `false` because the base class\n  // constructor already call `enable` modifying their values and it will\n  // set the instrumentations in a base state (enabled, patched but with flags set to false)\n  declare private _isEnabled: boolean;\n  declare private _isFetchPatched: boolean;\n\n  // To keep track of the resources\n  private _spanResources: Map<Span, PerformanceResourceTiming> = new Map();\n\n  constructor(config: FetchInstrumentationConfig = {}) {\n    super('@opentelemetry/browser-instrumentation/fetch', version, config);\n  }\n\n  protected override init() {\n    return [];\n  }\n\n  override enable(): void {\n    if (!hasBrowserPerformanceAPI) {\n      this._diag.warn(\n        'this instrumentation is intended for web usage only, it does not instrument server-side fetch()',\n      );\n      return;\n    }\n\n    if (this._isEnabled) {\n      return;\n    }\n\n    if (this._isFetchPatched) {\n      this._diag.debug('fetch constructor already patched');\n      this._isEnabled = true;\n      return;\n    }\n\n    try {\n      // `_wrap` throws if a third-party script has locked globalThis.fetch via\n      // Object.defineProperty(window, 'fetch', { writable: false, ... }).\n      this._wrap(globalThis, 'fetch', this._patchConstructor());\n      this._isFetchPatched = true;\n      this._isEnabled = true;\n    } catch (err) {\n      this._diag.warn(\n        'Failed to patch globalThis.fetch; instrumentation will not be enabled. ' +\n          'Another script may have locked globalThis.fetch via Object.defineProperty.',\n        err,\n      );\n    }\n  }\n\n  override disable(): void {\n    if (!hasBrowserPerformanceAPI) {\n      return;\n    }\n\n    if (!this._isEnabled) {\n      return;\n    }\n    this._isEnabled = false;\n  }\n\n  /**\n   * Patches the constructor of fetch\n   */\n  private _patchConstructor(): (original: typeof fetch) => typeof fetch {\n    return (original) => {\n      const instrumentation = this;\n\n      return function patchConstructor(\n        this: typeof globalThis,\n        ...args: Parameters<typeof fetch>\n      ): Promise<Response> {\n        if (!instrumentation._isEnabled) {\n          return original.apply(this, args);\n        }\n\n        // Reference to the Span in case there is an exception after creating it (wil not end)\n        // It will be used to keep the Map only with the Spans that will be ended\n        let trucatedSpan: Span | undefined;\n        try {\n          const instrConfig = instrumentation.getConfig();\n          const url = parseUrl(\n            args[0] instanceof Request ? args[0].url : String(args[0]),\n          ).href;\n\n          const shouldIgnoreUrl = matchesUrl(url, instrConfig.ignoreUrls);\n          if (shouldIgnoreUrl) {\n            return original.apply(this, args);\n          }\n\n          // Per the Fetch spec, when fetch() is called with a Request object\n          // and a separate init object, the init properties override the\n          // Request's properties. Merge them into a new Request so that\n          // downstream consumers (hooks, header injection, the actual fetch\n          // call) see the correct final values.\n          // See: https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#parameters\n          let options: Request | RequestInit;\n          if (args[0] instanceof Request) {\n            options = args[1] != null ? new Request(args[0], args[1]) : args[0];\n          } else {\n            options = args[1] || {};\n          }\n\n          const createdSpan = instrumentation._createSpan(url, options);\n          trucatedSpan = createdSpan;\n          if (instrConfig.measureRequestSize) {\n            getFetchBodyLength(...args)\n              .then((bodyLength) => {\n                if (typeof bodyLength === 'number') {\n                  createdSpan.setAttribute(\n                    ATTR_HTTP_REQUEST_BODY_SIZE,\n                    bodyLength,\n                  );\n                }\n              })\n              .catch((error) => {\n                instrumentation._diag.warn('getFetchBodyLength', error);\n              });\n          }\n\n          function endSpanOnError(span: Span, error: FetchError) {\n            instrumentation._applyAttributesAfterFetch(span, options, error);\n            instrumentation._endSpan(span, {\n              status: error.status,\n              error: error.name || error.message,\n              aborted: error.name === 'AbortError',\n            });\n          }\n\n          function endSpanOnSuccess(span: Span, response: Response) {\n            instrumentation._applyAttributesAfterFetch(span, options, response);\n            instrumentation._endSpan(span, response);\n          }\n\n          function onSuccess(span: Span, response: Response): Response {\n            try {\n              // Clone the response and eagerly consume the clone to detect\n              // when the body transfer completes.  The original response is\n              // returned to the caller untouched so that it passes internal\n              // brand-checks required by APIs such as\n              // WebAssembly.compileStreaming.\n              // It consumes the entire body even if the user cancels reading it\n              // from the original response. But it does work with `AbortController.abort()`\n              // because it aborts the underlying fetch cancelling the original and clone streams\n              // ref: https://github.com/open-telemetry/opentelemetry-js/pull/6521\n              const resClone = response.clone();\n              const body = resClone.body;\n              if (body) {\n                const reader = body.getReader();\n\n                const read = (): void => {\n                  reader.read().then(\n                    ({ done }) => {\n                      try {\n                        if (done) {\n                          endSpanOnSuccess(span, response);\n                        } else {\n                          read();\n                        }\n                      } catch (e) {\n                        instrumentation._diag.error(\n                          'Failed to finalize span after body read',\n                          e,\n                        );\n                        instrumentation._endSpan(span, {\n                          status: response.status,\n                        });\n                      }\n                    },\n                    (error) => {\n                      try {\n                        endSpanOnError(span, {\n                          name: error?.name,\n                          message: error?.message,\n                          status: response.status,\n                        });\n                      } catch (e) {\n                        instrumentation._diag.error(\n                          'Failed to end span after body read rejected',\n                          e,\n                        );\n                        instrumentation._endSpan(span, {\n                          status: response.status,\n                        });\n                      }\n                    },\n                  );\n                };\n                read();\n              } else {\n                // some older browsers don't have .body implemented\n                endSpanOnSuccess(span, response);\n              }\n            } catch (error) {\n              instrumentation._diag.error(\n                'Failed to read fetch response body',\n                error,\n              );\n              instrumentation._endSpan(span, { status: response.status });\n            }\n            return response;\n          }\n\n          function onError(span: Span, error: FetchError): never {\n            try {\n              endSpanOnError(span, error);\n            } catch (e: unknown) {\n              // endSpanOnError failed — fall back to ending the span directly.\n              // No `status`: no response was ever received for this request.\n              instrumentation._diag.error(\n                'Failed to end span on fetch error',\n                e,\n              );\n              instrumentation._endSpan(span, {});\n            }\n            throw error;\n          }\n\n          const fetchContext = trace.setSpan(context.active(), createdSpan);\n          return context.with(fetchContext, () => {\n            instrumentation._spanResources.set(createdSpan, {\n              name: url,\n              fetchStart: performance.now(),\n            } as PerformanceResourceTiming);\n\n            // Call request hook before injection so hooks cannot tamper with propagation headers.\n            // Also, this means the hook will see `options.headers` in the same type as passed in,\n            // rather than as a `Headers` instance set by `_addHeaders()`.\n            instrumentation._callRequestHook(createdSpan, options);\n            options = instrumentation._addHeaders(options, url, fetchContext);\n\n            return original\n              .apply(\n                globalThis,\n                options instanceof Request ? [options] : [url, options],\n              )\n              .then(\n                onSuccess.bind(globalThis, createdSpan),\n                onError.bind(globalThis, createdSpan),\n              );\n          });\n        } catch (e: unknown) {\n          instrumentation._diag.error('Failed to instrument fetch request', e);\n        }\n        // Remove the span if it was created and stored before the exception\n        if (trucatedSpan) {\n          instrumentation._spanResources.delete(trucatedSpan);\n        }\n        return original.apply(this, args);\n      };\n    };\n  }\n\n  /**\n   * Creates a new span\n   */\n  private _createSpan(\n    url: string,\n    options: Partial<Request | RequestInit> = {},\n  ): Span {\n    const attributes = {} as Attributes;\n    const parsedUrl = parseUrl(url);\n    const origMethod = options.method;\n    const normMethod = normalizeHttpRequestMethod(options.method || 'GET');\n    const serverPort = serverPortFromUrl(parsedUrl);\n    const name = normMethod;\n    const { sanitizeUrl } = this.getConfig();\n\n    attributes[ATTR_HTTP_REQUEST_METHOD] = normMethod;\n    attributes[ATTR_URL_FULL] = sanitizeUrl ? sanitizeUrl(url) : url;\n    attributes[ATTR_SERVER_ADDRESS] = parsedUrl.hostname;\n    if (serverPort) {\n      attributes[ATTR_SERVER_PORT] = serverPort;\n    }\n    if (origMethod && origMethod !== normMethod) {\n      attributes[ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = origMethod;\n    }\n\n    return this.tracer.startSpan(name, {\n      kind: SpanKind.CLIENT,\n      attributes,\n    });\n  }\n\n  /**\n   * Finish span, add attributes, etc.\n   */\n  private _endSpan(span: Span, response: FetchResponse) {\n    if (response.status !== undefined) {\n      span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, response.status);\n    }\n\n    // https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#status\n    // 1xx/2xx/3xx MUST be left unset UNLESS there was another error (e.g. a\n    // network error receiving the response body)\n    if (!response.aborted) {\n      const isErrorStatus =\n        response.status === undefined ||\n        response.status >= 400 ||\n        response.error !== undefined;\n      if (isErrorStatus) {\n        span.setStatus({ code: SpanStatusCode.ERROR });\n        const errorType =\n          response.error ??\n          (response.status !== undefined ? String(response.status) : undefined);\n        if (typeof errorType === 'string') {\n          span.setAttribute(ATTR_ERROR_TYPE, errorType);\n        }\n      }\n    }\n\n    span.end();\n\n    // Register the resource context for other instrumentations\n    const resource = this._spanResources.get(span);\n    if (resource) {\n      this._spanResources.delete(span);\n      getNetworkContextRegistry().register(span, {\n        key: resource.name,\n        startPerfNow: resource.fetchStart,\n        endPerfNow: performance.now(),\n      });\n    }\n  }\n\n  private _applyAttributesAfterFetch(\n    span: Span,\n    request: Request | RequestInit,\n    result: Response | FetchError,\n  ) {\n    const applyCustomAttributesOnSpan =\n      this.getConfig().applyCustomAttributesOnSpan;\n    if (applyCustomAttributesOnSpan) {\n      safeExecuteInTheMiddle(\n        () => applyCustomAttributesOnSpan(span, request, result),\n        (error) => {\n          if (!error) {\n            return;\n          }\n          this._diag.error('applyCustomAttributesOnSpan', error);\n        },\n        true,\n      );\n    }\n  }\n\n  /**\n   * Calls the request hook if defined\n   */\n  private _callRequestHook(span: Span, request: Request | RequestInit) {\n    const requestHook = this.getConfig().requestHook;\n\n    if (requestHook) {\n      safeExecuteInTheMiddle(\n        () => requestHook(span, request),\n        (error) => {\n          if (error) {\n            this._diag.error('requestHook', error);\n          }\n        },\n        true,\n      );\n    }\n  }\n\n  /**\n   * Add headers for the request and the given context if apply.\n   * Returns the options to send, a copy when the caller passed an init object.\n   */\n  private _addHeaders(\n    options: Request | RequestInit,\n    url: string,\n    ctx: Context,\n  ): Request | RequestInit {\n    // Propagate only if in request goes to same origin or is in the allow list\n    const urlsToPropagate = this.getConfig().propagateTraceHeaderCorsUrls;\n    const urlOrigin = parseUrl(url).origin;\n    const sameOrigin = location.origin === urlOrigin;\n    const shouldPropagate = sameOrigin || matchesUrl(url, urlsToPropagate);\n\n    if (shouldPropagate) {\n      if (options instanceof Request) {\n        // This mutates `Request.headers` in-place, because it is read-only\n        // (per https://developer.mozilla.org/en-US/docs/Web/API/Request/headers),\n        // so we cannot (easily) replace it.\n        propagation.inject(ctx, options.headers, {\n          set: (h, k, v) => h.set(k, typeof v === 'string' ? v : String(v)),\n        });\n      } else {\n        // Otherwise, create a new Headers and a new init to avoid mutating\n        // the caller's possibly re-used init and headers.\n        const headers = new Headers(options.headers);\n        propagation.inject(ctx, headers, {\n          set: (h, k, v) => h.set(k, typeof v === 'string' ? v : String(v)),\n        });\n        return { ...options, headers };\n      }\n    } else {\n      const headers: Partial<Record<string, unknown>> = {};\n      propagation.inject(ctx, headers);\n      if (Object.keys(headers).length > 0) {\n        this._diag.debug('headers inject skipped due to CORS policy');\n      }\n    }\n    return options;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.\n *\n * @example 3495\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HTTP_REQUEST_BODY_SIZE = 'http.request.body.size' as const;\n", "import { version } from \"../package.js\";\nimport { getNetworkContextRegistry } from \"../utils/NetworkContextRegistry.js\";\nimport { getXHRBodyLength, normalizeHttpRequestMethod } from \"../utils/request.js\";\nimport { matchesUrl, parseUrl, serverPortFromUrl } from \"../utils/url.js\";\nimport { ATTR_HTTP_REQUEST_BODY_SIZE } from \"./semconv.js\";\nimport { SpanKind, SpanStatusCode, context, propagation, trace } from \"@opentelemetry/api\";\nimport { InstrumentationBase, safeExecuteInTheMiddle } from \"@opentelemetry/instrumentation\";\nimport { ATTR_ERROR_TYPE, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL } from \"@opentelemetry/semantic-conventions\";\n//#region src/xhr/instrumentation.ts\nvar XhrInstrumentation = class extends InstrumentationBase {\n\t_xhrSpanMap = /* @__PURE__ */ new WeakMap();\n\tconstructor(config = {}) {\n\t\tsuper(\"@opentelemetry/browser-instrumentation/xhr\", version, config);\n\t}\n\tinit() {\n\t\treturn [];\n\t}\n\tenable() {\n\t\tif (this._isEnabled) return;\n\t\tif (this._isXhrPatched) {\n\t\t\tthis._diag.debug(\"XMLHttpRequest prototype already patched\");\n\t\t\tthis._isEnabled = true;\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis._wrap(XMLHttpRequest.prototype, \"open\", this._patchOpen());\n\t\t} catch (err) {\n\t\t\tthis._diag.warn(\"Failed to patch XMLHttpRequest.prototype.open; instrumentation will not be enabled. Another script may have locked XMLHttpRequest.prototype.open via Object.defineProperty.\", err);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis._wrap(XMLHttpRequest.prototype, \"send\", this._patchSend());\n\t\t\tthis._isXhrPatched = true;\n\t\t\tthis._isEnabled = true;\n\t\t} catch (err) {\n\t\t\tthis._unwrap(XMLHttpRequest.prototype, \"open\");\n\t\t\tthis._diag.warn(\"Failed to patch XMLHttpRequest.prototype.send; instrumentation will not be enabled. Another script may have locked XMLHttpRequest.prototype.send via Object.defineProperty.\", err);\n\t\t}\n\t}\n\tdisable() {\n\t\tif (!this._isEnabled) return;\n\t\tthis._isEnabled = false;\n\t}\n\t/**\n\t* Patches the \"open\" method of XmlHttpRequest\n\t*/\n\t_patchOpen() {\n\t\treturn (original) => {\n\t\t\tconst instrumentation = this;\n\t\t\treturn function patchedOpen(...args) {\n\t\t\t\tif (!instrumentation._isEnabled) return original.apply(this, args);\n\t\t\t\ttry {\n// Corridora: finish the previous XHR before open replaces its record.\n\t\t\t\t\tif (instrumentation._xhrSpanMap.get(this)?.span) {\n\t\t\t\t\t\tinstrumentation._endSpan(this, this.readyState === 4 ? (this.status === 0 ? \"error\" : \"load\") : \"abort\");\n\t\t\t\t\t}\n\t\t\t\t\tconst method = args[0];\n\t\t\t\t\tconst urlArgument = typeof args[1] === \"string\" ? args[1] : args[1].toString();\n\t\t\t\t\tconst url = parseUrl(urlArgument);\n\t\t\t\t\tif (matchesUrl(url.href, instrumentation.getConfig().ignoreUrls)) return original.apply(this, args);\n\t\t\t\t\tinstrumentation._xhrSpanMap.set(this, {\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t\turl\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\tinstrumentation._diag.error(\"Failed to instrument XmlHttpRequest.open\", e);\n\t\t\t\t}\n\t\t\t\treturn original.apply(this, args);\n\t\t\t};\n\t\t};\n\t}\n\t/**\n\t* Patches the \"open\" method of XmlHttpRequest\n\t*/\n\t_patchSend() {\n\t\treturn (original) => {\n\t\t\tconst instrumentation = this;\n\t\t\treturn function patchedSend(...args) {\n\t\t\t\tif (!instrumentation._isEnabled) return original.apply(this, args);\n\t\t\t\tconst xhrRecord = instrumentation._xhrSpanMap.get(this);\n\t\t\t\tif (xhrRecord) try {\n\t\t\t\t\tconst { method, url } = xhrRecord;\n\t\t\t\t\tconst span = instrumentation._createSpan(url, method);\n\t\t\t\t\txhrRecord.span = span;\n\t\t\t\t\txhrRecord.start = performance.now();\n\t\t\t\t\tif (instrumentation.getConfig().measureRequestSize && args?.[0]) {\n\t\t\t\t\t\tconst bodyLength = getXHRBodyLength(args[0]);\n\t\t\t\t\t\tif (bodyLength) span.setAttribute(ATTR_HTTP_REQUEST_BODY_SIZE, bodyLength);\n\t\t\t\t\t}\n\t\t\t\t\tconst onAbort = () => instrumentation._endSpan(this, \"abort\");\n\t\t\t\t\tconst onError = () => instrumentation._endSpan(this, \"error\");\n\t\t\t\t\tconst onTimeout = () => instrumentation._endSpan(this, \"timeout\");\n\t\t\t\t\tconst onLoad = () => instrumentation._endSpan(this, \"load\");\n\t\t\t\t\txhrRecord.listeners = {\n\t\t\t\t\t\tabort: onAbort,\n\t\t\t\t\t\terror: onError,\n\t\t\t\t\t\ttimeout: onTimeout,\n\t\t\t\t\t\tload: onLoad\n\t\t\t\t\t};\n\t\t\t\t\tconst xhrContext = trace.setSpan(context.active(), span);\n\t\t\t\t\tcontext.with(xhrContext, () => {\n\t\t\t\t\t\tthis.addEventListener(\"abort\", onAbort);\n\t\t\t\t\t\tthis.addEventListener(\"error\", onError);\n\t\t\t\t\t\tthis.addEventListener(\"timeout\", onTimeout);\n\t\t\t\t\t\tthis.addEventListener(\"load\", onLoad);\n\t\t\t\t\t\tinstrumentation._addHeaders(this, url, xhrContext);\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\tinstrumentation._diag.error(\"Failed to instrument fetch request\", e);\n\t\t\t\t\tinstrumentation._xhrSpanMap.delete(this);\n\t\t\t\t}\n\t\t\t\treturn original.apply(this, args);\n\t\t\t};\n\t\t};\n\t}\n\t/**\n\t* Creates a new span when method \"send\" is called\n\t*/\n\t_createSpan(url, method) {\n\t\tconst origMethod = method;\n\t\tconst normMethod = normalizeHttpRequestMethod(method);\n\t\tconst attributes = {};\n\t\tconst { sanitizeUrl } = this.getConfig();\n\t\tattributes[ATTR_HTTP_REQUEST_METHOD] = normMethod;\n\t\tif (normMethod !== origMethod) attributes[ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = origMethod;\n\t\tattributes[ATTR_URL_FULL] = sanitizeUrl ? sanitizeUrl(url.href) : url.href;\n\t\tattributes[ATTR_SERVER_ADDRESS] = url.hostname;\n\t\tconst serverPort = serverPortFromUrl(url);\n\t\tif (serverPort) attributes[ATTR_SERVER_PORT] = serverPort;\n\t\treturn this.tracer.startSpan(normMethod, {\n\t\t\tkind: SpanKind.CLIENT,\n\t\t\tattributes\n\t\t});\n\t}\n\t/**\n\t* Finish span, add attributes, network events etc.\n\t*/\n\t_endSpan(xhr, eventName) {\n\t\tconst xhrRecord = this._xhrSpanMap.get(xhr);\n\t\tif (xhrRecord?.listeners) for (const k of Object.keys(xhrRecord.listeners)) xhr.removeEventListener(k, xhrRecord.listeners[k]);\n\t\tif (xhrRecord?.span) {\n\t\t\tconst { span, url, start } = xhrRecord;\n\t\t\tif (eventName === \"load\") span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, xhr.status);\n\t\t\tif (eventName !== \"abort\") {\n\t\t\t\tif (xhr.status >= 400 || eventName === \"error\" || eventName === \"timeout\") {\n\t\t\t\t\tspan.setStatus({ code: SpanStatusCode.ERROR });\n\t\t\t\t\tconst errorType = xhr.status >= 400 ? String(xhr.status) : eventName === \"error\" ? \"Error\" : \"TimeoutError\";\n\t\t\t\t\tspan.setAttribute(ATTR_ERROR_TYPE, errorType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._xhrSpanMap.delete(xhr);\n\t\t\tthis._applyAttributesAfterSend(span, xhr);\n\t\t\tspan.end();\n\t\t\tgetNetworkContextRegistry().register(span, {\n\t\t\t\tkey: url.href,\n\t\t\t\tstartPerfNow: Number(start),\n\t\t\t\tendPerfNow: performance.now()\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Runs the user provided `applyCustomAttributesOnSpan` function\n\t*/\n\t_applyAttributesAfterSend(span, xhr) {\n\t\tconst applyCustomAttributesOnSpan = this.getConfig().applyCustomAttributesOnSpan;\n\t\tif (applyCustomAttributesOnSpan) safeExecuteInTheMiddle(() => applyCustomAttributesOnSpan(span, xhr), (error) => {\n\t\t\tif (!error) return;\n\t\t\tthis._diag.error(\"applyCustomAttributesOnSpan\", error);\n\t\t}, true);\n\t}\n\t/**\n\t* Adds custom headers to XMLHttpRequest\n\t*/\n\t_addHeaders(xhr, url, ctx) {\n\t\tconst urlsToPropagate = this.getConfig().propagateTraceHeaderCorsUrls;\n\t\tif (location.origin === url.origin || matchesUrl(url.href, urlsToPropagate)) propagation.inject(ctx, xhr, { set: (x, k, v) => {\n\t\t\tx.setRequestHeader(k, typeof v === \"string\" ? v : String(v));\n\t\t} });\n\t\telse {\n\t\t\tconst headers = {};\n\t\t\tpropagation.inject(ctx, headers, { set: (h, k, v) => {\n\t\t\t\th[k] = v;\n\t\t\t} });\n\t\t\tif (Object.keys(headers).length > 0) this._diag.debug(\"headers inject skipped due to CORS policy\");\n\t\t}\n\t}\n};\n//#endregion\nexport { XhrInstrumentation };\n\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\nexport const BROWSER_NAVIGATION_EVENT_NAME = 'browser.navigation';\n\n/**\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_URL_FULL = 'url.full';\n\n/**\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT =\n  'browser.navigation.same_document';\n\n/**\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_NAVIGATION_HASH_CHANGE =\n  'browser.navigation.hash_change';\n\n/**\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_NAVIGATION_TYPE = 'browser.navigation.type';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Determines if navigation between two URLs represents a hash change.\n * A hash change is true if the URLs are the same except for the hash part,\n * AND the hash is being added or changed (not removed).\n *\n * @param fromUrl - The source URL\n * @param toUrl - The destination URL\n * @returns true if this represents a hash change navigation\n */\nexport function isHashChange(fromUrl: string, toUrl: string): boolean {\n  try {\n    const a = new URL(fromUrl, window.location.origin);\n    const b = new URL(toUrl, window.location.origin);\n    const sameBase =\n      a.origin === b.origin &&\n      a.pathname === b.pathname &&\n      a.search === b.search;\n    const toHasHash = b.hash !== '';\n    const hashesAreDifferent = a.hash !== b.hash;\n\n    return sameBase && hashesAreDifferent && toHasHash;\n  } catch {\n    const fromBase = fromUrl.split('#')[0];\n    const toBase = toUrl.split('#')[0];\n    const fromHash = fromUrl.split('#')[1] ?? '';\n    const toHash = toUrl.split('#')[1] ?? '';\n\n    const sameBase = fromBase === toBase;\n    const hashesAreDifferent = fromHash !== toHash;\n    const notRemovingHash = toHash !== '';\n\n    return sameBase && hashesAreDifferent && notRemovingHash;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LogRecord } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport {\n  InstrumentationBase,\n  safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport { version } from '../../package.json' with { type: 'json' };\nimport {\n  ATTR_BROWSER_NAVIGATION_HASH_CHANGE,\n  ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT,\n  ATTR_BROWSER_NAVIGATION_TYPE,\n  ATTR_URL_FULL,\n  BROWSER_NAVIGATION_EVENT_NAME,\n} from './semconv.ts';\nimport type {\n  NavigationInstrumentationConfig,\n  NavigationType,\n} from './types.ts';\nimport { isHashChange } from './utils.ts';\n\ntype ChangeState =\n  | 'pushState'\n  | 'replaceState'\n  | 'popstate'\n  | 'currententrychange';\n\ninterface NavigationApiEntry {\n  url?: string;\n}\n\ninterface NavigationApiTarget {\n  currentEntry?: NavigationApiEntry;\n}\n\ninterface NavigationApiEvent extends Event {\n  navigationType?: NavigationType;\n  target: NavigationApiTarget & EventTarget;\n}\n\ninterface NavigationApi {\n  addEventListener(\n    type: 'currententrychange',\n    listener: (event: NavigationApiEvent) => void,\n  ): void;\n  removeEventListener(\n    type: 'currententrychange',\n    listener: (event: NavigationApiEvent) => void,\n  ): void;\n}\n\nexport class NavigationInstrumentation extends InstrumentationBase<NavigationInstrumentationConfig> {\n  // Use `declare` to prevent JS class field initializers from running after\n  // super(), which would reset values set by the enable() call that\n  // InstrumentationBase makes during its constructor.\n  declare private _isEnabled: boolean;\n  declare private _isHistoryPatched: boolean;\n  declare private _hasProcessedInitialLoad: boolean;\n  declare private _lastUrl: string;\n  declare private _onDOMContentLoaded?: () => void;\n  declare private _onPopState?: (event: PopStateEvent) => void;\n  declare private _onCurrentEntryChange?: (event: NavigationApiEvent) => void;\n\n  constructor(config: NavigationInstrumentationConfig = {}) {\n    super('@opentelemetry/browser-instrumentation/navigation', version, config);\n    this._lastUrl = location.href;\n  }\n\n  protected override init() {\n    return [];\n  }\n\n  override enable(): void {\n    if (this._isEnabled) {\n      return;\n    }\n    this._isEnabled = true;\n\n    const navigationApi = this._getNavigationApi();\n\n    // Only patch history API if Navigation API is not being used.\n    if (!navigationApi && !this._isHistoryPatched) {\n      this._patchHistoryApi();\n      this._isHistoryPatched = true;\n    }\n\n    this._waitForPageLoad();\n\n    if (navigationApi) {\n      this._onCurrentEntryChange = (event) => {\n        this._onSoftNavigation('currententrychange', event);\n      };\n      navigationApi.addEventListener(\n        'currententrychange',\n        this._onCurrentEntryChange,\n      );\n    } else {\n      this._onPopState = () => {\n        this._onSoftNavigation('popstate');\n      };\n      window.addEventListener('popstate', this._onPopState);\n    }\n  }\n\n  override disable(): void {\n    if (!this._isEnabled) {\n      return;\n    }\n    this._isEnabled = false;\n\n    if (this._onDOMContentLoaded) {\n      document.removeEventListener(\n        'DOMContentLoaded',\n        this._onDOMContentLoaded,\n      );\n      this._onDOMContentLoaded = undefined;\n    }\n    if (this._onPopState) {\n      window.removeEventListener('popstate', this._onPopState);\n      this._onPopState = undefined;\n    }\n    if (this._onCurrentEntryChange) {\n      const navigationApi = this._getNavigationApi();\n      navigationApi?.removeEventListener(\n        'currententrychange',\n        this._onCurrentEntryChange,\n      );\n      this._onCurrentEntryChange = undefined;\n    }\n    // Reset the initial-load flag so it can be processed again if re-enabled.\n    this._hasProcessedInitialLoad = false;\n  }\n\n  private _getNavigationApi(): NavigationApi | undefined {\n    const cfg = this.getConfig();\n    if (!cfg.useNavigationApiIfAvailable) {\n      return undefined;\n    }\n    return (window as unknown as { navigation?: NavigationApi }).navigation;\n  }\n\n  private _onHardNavigation(): void {\n    const cfg = this.getConfig();\n    const logRecord: LogRecord = {\n      eventName: BROWSER_NAVIGATION_EVENT_NAME,\n      severityNumber: SeverityNumber.INFO,\n      attributes: {\n        [ATTR_URL_FULL]: cfg.sanitizeUrl\n          ? cfg.sanitizeUrl(document.documentURI)\n          : document.documentURI,\n        [ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT]: false,\n        [ATTR_BROWSER_NAVIGATION_HASH_CHANGE]: false,\n      },\n    };\n    this._applyCustomLogRecordData(logRecord);\n    this.logger.emit(logRecord);\n  }\n\n  private _onSoftNavigation(\n    changeState: ChangeState,\n    navigationEvent?: NavigationApiEvent,\n  ): void {\n    const referrerUrl = this._lastUrl;\n    const currentUrl =\n      changeState === 'currententrychange' &&\n      navigationEvent?.target?.currentEntry?.url\n        ? navigationEvent.target.currentEntry.url\n        : location.href;\n\n    if (referrerUrl === currentUrl) {\n      return;\n    }\n\n    const navType = this._mapChangeStateToType(changeState, navigationEvent);\n    const sameDocument = this._determineSameDocument(referrerUrl, currentUrl);\n    const hashChange = isHashChange(referrerUrl, currentUrl);\n    const cfg = this.getConfig();\n\n    const logRecord: LogRecord = {\n      eventName: BROWSER_NAVIGATION_EVENT_NAME,\n      severityNumber: SeverityNumber.INFO,\n      attributes: {\n        [ATTR_URL_FULL]: cfg.sanitizeUrl\n          ? cfg.sanitizeUrl(currentUrl)\n          : currentUrl,\n        [ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT]: sameDocument,\n        [ATTR_BROWSER_NAVIGATION_HASH_CHANGE]: hashChange,\n        ...(navType ? { [ATTR_BROWSER_NAVIGATION_TYPE]: navType } : {}),\n      },\n    };\n    this._applyCustomLogRecordData(logRecord);\n    this.logger.emit(logRecord);\n\n    this._lastUrl = currentUrl;\n  }\n\n  private _waitForPageLoad(): void {\n    if (document.readyState === 'complete' && !this._hasProcessedInitialLoad) {\n      this._hasProcessedInitialLoad = true;\n      this._onHardNavigation();\n      return;\n    }\n\n    this._onDOMContentLoaded = () => {\n      if (!this._hasProcessedInitialLoad) {\n        this._hasProcessedInitialLoad = true;\n        this._onHardNavigation();\n      }\n    };\n    document.addEventListener('DOMContentLoaded', this._onDOMContentLoaded);\n  }\n\n  private _patchHistoryApi(): void {\n    this._wrap(\n      history,\n      'replaceState',\n      this._patchHistoryMethod('replaceState'),\n    );\n    this._wrap(history, 'pushState', this._patchHistoryMethod('pushState'));\n  }\n\n  private _patchHistoryMethod(changeState: 'pushState' | 'replaceState') {\n    const plugin = this;\n    return (original: History['pushState' | 'replaceState']) => {\n      return function patchedHistoryMethod(\n        this: History,\n        ...args: Parameters<History['pushState' | 'replaceState']>\n      ) {\n        if (!plugin._isEnabled) {\n          return original.apply(this, args);\n        }\n        const result = original.apply(this, args);\n        if (location.href !== plugin._lastUrl) {\n          plugin._onSoftNavigation(changeState);\n        }\n        return result;\n      };\n    };\n  }\n\n  private _applyCustomLogRecordData(logRecord: LogRecord): void {\n    const cfg = this.getConfig();\n    const hook = cfg.applyCustomLogRecordData;\n    if (!hook) {\n      return;\n    }\n    safeExecuteInTheMiddle(\n      () => hook(logRecord),\n      (error) => {\n        if (error) {\n          this._diag.error('applyCustomLogRecordData hook failed', error);\n        }\n      },\n      true,\n    );\n  }\n\n  private _determineSameDocument(fromUrl: string, toUrl: string): boolean {\n    try {\n      const fromURL = new URL(fromUrl);\n      const toURL = new URL(toUrl);\n      return fromURL.origin === toURL.origin;\n    } catch {\n      // Fallback: assume same document for relative URLs or parsing errors.\n      // In SPAs, route changes via pushState/replaceState are same-document.\n      return true;\n    }\n  }\n\n  private _mapChangeStateToType(\n    changeState: ChangeState,\n    navigationEvent?: NavigationApiEvent,\n  ): NavigationType | undefined {\n    if (changeState === 'currententrychange') {\n      const navType = navigationEvent?.navigationType;\n      switch (navType) {\n        case 'traverse':\n          return 'traverse';\n        case 'replace':\n          return 'replace';\n        case 'reload':\n          return 'reload';\n        default:\n          // Default to 'push' for programmatic navigations (history.pushState,\n          // link clicks) when no explicit type info is available.\n          return 'push';\n      }\n    }\n\n    switch (changeState) {\n      case 'pushState':\n        return 'push';\n      case 'replaceState':\n        return 'replace';\n      case 'popstate':\n        return 'traverse';\n      default:\n        return undefined;\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nconst IDLE_DEADLINE_MS = 50;\n\n// requestIdleCallback is not yet Baseline (not supported in Safari).\n// Feature-detect here so we can shim it below for unsupported browsers.\n// eslint-disable-next-line baseline-js/use-baseline\nconst supportsIdleCallback = typeof window.requestIdleCallback === 'function';\n\nexport interface IdleCallbackHandle {\n  id: number;\n  native: boolean;\n}\n\n/**\n * Schedules a callback during idle time, using the native requestIdleCallback\n * when available. Falls back to setTimeout with a synthetic IdleDeadline that\n * reports ~50ms of available time (per the W3C spec recommendation).\n */\nexport function requestIdleCallbackShim(\n  callback: IdleRequestCallback,\n  options?: IdleRequestOptions,\n): IdleCallbackHandle {\n  if (supportsIdleCallback) {\n    // requestIdleCallback is not yet Baseline (not supported in Safari).\n    // eslint-disable-next-line baseline-js/use-baseline\n    const id = window.requestIdleCallback(callback, options);\n    return { id, native: true };\n  }\n\n  const id = window.setTimeout(() => {\n    const start = performance.now();\n    callback({\n      didTimeout: false,\n      timeRemaining: () =>\n        Math.max(0, IDLE_DEADLINE_MS - (performance.now() - start)),\n    });\n  }, 1);\n  return { id, native: false };\n}\n\n/**\n * Cancels a previously scheduled idle callback.\n */\nexport function cancelIdleCallbackShim(handle: IdleCallbackHandle): void {\n  if (handle.native) {\n    // eslint-disable-next-line baseline-js/use-baseline\n    window.cancelIdleCallback(handle.id);\n  } else {\n    clearTimeout(handle.id);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Event name for resource timing\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const RESOURCE_TIMING_EVENT_NAME = 'browser.resource_timing';\n\n// Resource timing attributes\n\n/**\n * The URL of the resource\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_URL = 'url.full';\n\n/**\n * The type of resource (script, stylesheet, img, xmlhttprequest, fetch, etc.)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_INITIATOR_TYPE =\n  'browser.resource_timing.initiator_type';\n\n/**\n * Total duration of the resource load (in milliseconds)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_DURATION = 'browser.resource_timing.duration';\n\n/**\n * Start time of the resource fetch (relative to navigation start)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_FETCH_START = 'browser.resource_timing.fetch_start';\n\n/**\n * Domain lookup start time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_DOMAIN_LOOKUP_START =\n  'browser.resource_timing.domain_lookup_start';\n\n/**\n * Domain lookup end time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_DOMAIN_LOOKUP_END =\n  'browser.resource_timing.domain_lookup_end';\n\n/**\n * Connection start time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_CONNECT_START =\n  'browser.resource_timing.connect_start';\n\n/**\n * Connection end time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_CONNECT_END = 'browser.resource_timing.connect_end';\n\n/**\n * Secure connection start time (HTTPS)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_SECURE_CONNECTION_START =\n  'browser.resource_timing.secure_connection_start';\n\n/**\n * Request start time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_REQUEST_START =\n  'browser.resource_timing.request_start';\n\n/**\n * Response start time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_RESPONSE_START =\n  'browser.resource_timing.response_start';\n\n/**\n * Response end time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_RESPONSE_END =\n  'browser.resource_timing.response_end';\n\n/**\n * Transfer size in bytes (including headers)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_TRANSFER_SIZE =\n  'browser.resource_timing.transfer_size';\n\n/**\n * Encoded body size in bytes (compressed)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_ENCODED_BODY_SIZE =\n  'browser.resource_timing.encoded_body_size';\n\n/**\n * Decoded body size in bytes (uncompressed)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_DECODED_BODY_SIZE =\n  'browser.resource_timing.decoded_body_size';\n\n/**\n * Redirect start time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_REDIRECT_START =\n  'browser.resource_timing.redirect_start';\n\n/**\n * Redirect end time\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_REDIRECT_END =\n  'browser.resource_timing.redirect_end';\n\n/**\n * Worker start time (for Service Worker interception)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_WORKER_START =\n  'browser.resource_timing.worker_start';\n\n/**\n * Next hop protocol (h2, h3, http/1.1, etc.)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_NEXT_HOP_PROTOCOL =\n  'browser.resource_timing.next_hop_protocol';\n\n/**\n * Render blocking status (blocking, non-blocking)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_RESOURCE_RENDER_BLOCKING_STATUS =\n  'browser.resource_timing.render_blocking_status';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { LogRecord } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport { getNetworkContextRegistry } from '#utils';\nimport { version } from '../../package.json' with { type: 'json' };\nimport { matchesUrl } from '../utils/url.ts';\nimport type { IdleCallbackHandle } from './idle-callback-shim.ts';\nimport {\n  cancelIdleCallbackShim,\n  requestIdleCallbackShim,\n} from './idle-callback-shim.ts';\nimport {\n  ATTR_RESOURCE_CONNECT_END,\n  ATTR_RESOURCE_CONNECT_START,\n  ATTR_RESOURCE_DECODED_BODY_SIZE,\n  ATTR_RESOURCE_DOMAIN_LOOKUP_END,\n  ATTR_RESOURCE_DOMAIN_LOOKUP_START,\n  ATTR_RESOURCE_DURATION,\n  ATTR_RESOURCE_ENCODED_BODY_SIZE,\n  ATTR_RESOURCE_FETCH_START,\n  ATTR_RESOURCE_INITIATOR_TYPE,\n  ATTR_RESOURCE_NEXT_HOP_PROTOCOL,\n  ATTR_RESOURCE_REDIRECT_END,\n  ATTR_RESOURCE_REDIRECT_START,\n  ATTR_RESOURCE_RENDER_BLOCKING_STATUS,\n  ATTR_RESOURCE_REQUEST_START,\n  ATTR_RESOURCE_RESPONSE_END,\n  ATTR_RESOURCE_RESPONSE_START,\n  ATTR_RESOURCE_SECURE_CONNECTION_START,\n  ATTR_RESOURCE_TRANSFER_SIZE,\n  ATTR_RESOURCE_URL,\n  ATTR_RESOURCE_WORKER_START,\n  RESOURCE_TIMING_EVENT_NAME,\n} from './semconv.ts';\nimport type { ResourceTimingInstrumentationConfig } from './types.ts';\n\nconst DEFAULT_BATCH_SIZE = 50;\nconst DEFAULT_FORCE_PROCESSING_AFTER = 1000;\nconst DEFAULT_MAX_PROCESSING_TIME = 50;\nconst DEFAULT_MAX_QUEUE_SIZE = 1000;\n\nconst MIN_BATCH_SIZE = 1;\nconst MIN_FORCE_PROCESSING_AFTER = 0;\nconst MIN_PROCESSING_TIME = 0;\nconst MIN_QUEUE_SIZE = 1;\n\n/**\n * OpenTelemetry instrumentation for resource timing for browser applications.\n *\n * This instrumentation captures resource timing data using PerformanceObserver\n * and batches emissions to avoid overwhelming the main thread. It uses\n * requestIdleCallback when available (with fallback for Safari) to ensure\n * processing happens during idle periods.\n */\nexport class ResourceTimingInstrumentation extends InstrumentationBase<ResourceTimingInstrumentationConfig> {\n  private _observer?: PerformanceObserver;\n  private _pendingEntries: PerformanceResourceTiming[] = [];\n  private _idleHandle?: IdleCallbackHandle;\n\n  // Use `declare` to prevent JS class field initializers from running after\n  // super(), which would reset values set by the enable() call that\n  // InstrumentationBase makes during its constructor.\n  declare private _isEnabled: boolean;\n  declare private _loadHandler: (() => void) | undefined;\n  declare private _visibilityChangeHandler: (() => void) | undefined;\n\n  constructor(config: ResourceTimingInstrumentationConfig = {}) {\n    super(\n      '@opentelemetry/browser-instrumentation/resource-timing',\n      version,\n      config,\n    );\n  }\n\n  protected override init() {\n    return [];\n  }\n\n  override enable(): void {\n    if (this._isEnabled) {\n      return;\n    }\n\n    if (!('PerformanceObserver' in window)) {\n      this._diag.debug(\n        'PerformanceObserver is not supported, resource timings will not be collected',\n      );\n      return;\n    }\n\n    this._isEnabled = true;\n\n    if (document.readyState === 'complete') {\n      this._setupObserver();\n    } else {\n      this._loadHandler = () => this._setupObserver();\n      window.addEventListener('load', this._loadHandler, { once: true });\n    }\n\n    this._visibilityChangeHandler = () => {\n      if (document.hidden) {\n        this._flush();\n      }\n    };\n    document.addEventListener(\n      'visibilitychange',\n      this._visibilityChangeHandler,\n    );\n  }\n\n  override disable(): void {\n    this._isEnabled = false;\n    this._flush();\n    this._observer?.disconnect();\n    this._observer = undefined;\n    if (this._loadHandler) {\n      window.removeEventListener('load', this._loadHandler);\n      this._loadHandler = undefined;\n    }\n    if (this._visibilityChangeHandler) {\n      document.removeEventListener(\n        'visibilitychange',\n        this._visibilityChangeHandler,\n      );\n      this._visibilityChangeHandler = undefined;\n    }\n  }\n\n  private _setupObserver(): void {\n    if (!this._isEnabled) {\n      return;\n    }\n\n    const observer = new PerformanceObserver((list) => {\n      if (!this._isEnabled) {\n        return;\n      }\n\n      const maxQueueSize = Math.max(\n        this._config.maxQueueSize ?? DEFAULT_MAX_QUEUE_SIZE,\n        MIN_QUEUE_SIZE,\n      );\n      const entries = list.getEntries() as PerformanceResourceTiming[];\n      const initiatorTypes = this._config.initiatorTypes;\n\n      for (const entry of entries) {\n        if (\n          initiatorTypes !== undefined &&\n          !initiatorTypes.includes(entry.initiatorType)\n        ) {\n          continue;\n        }\n\n        const shouldIgnoreUrl = matchesUrl(entry.name, this._config.ignoreUrls);\n        if (shouldIgnoreUrl) {\n          continue;\n        }\n\n        if (this._pendingEntries.length >= maxQueueSize) {\n          this._flush();\n        }\n        this._pendingEntries.push(entry);\n      }\n\n      if (this._pendingEntries.length > 0) {\n        this._scheduleProcessing();\n      }\n    });\n\n    this._observer = observer;\n\n    try {\n      observer.observe({ type: 'resource', buffered: true });\n    } catch (e) {\n      this._diag.error('Failed to start resource PerformanceObserver', e);\n      this._observer = undefined;\n    }\n  }\n\n  private _scheduleProcessing(): void {\n    if (this._idleHandle !== undefined) {\n      return;\n    }\n\n    const timeout = Math.max(\n      this._config.forceProcessingAfter ?? DEFAULT_FORCE_PROCESSING_AFTER,\n      MIN_FORCE_PROCESSING_AFTER,\n    );\n    this._idleHandle = requestIdleCallbackShim(\n      (deadline) => this._processChunk(deadline),\n      { timeout },\n    );\n  }\n\n  private _processChunk(deadline: IdleDeadline): void {\n    this._idleHandle = undefined;\n    if (!this._isEnabled || this._pendingEntries.length === 0) {\n      return;\n    }\n\n    const maxTime = Math.max(\n      this._config.maxProcessingTime ?? DEFAULT_MAX_PROCESSING_TIME,\n      MIN_PROCESSING_TIME,\n    );\n    const batchSize = Math.max(\n      this._config.batchSize ?? DEFAULT_BATCH_SIZE,\n      MIN_BATCH_SIZE,\n    );\n    const startTime = performance.now();\n\n    let cursor = 0;\n    try {\n      for (let i = 0; i < batchSize; i++) {\n        const entry = this._pendingEntries[cursor];\n        if (entry === undefined) {\n          break;\n        }\n\n        const elapsed = performance.now() - startTime;\n        // timeRemaining() is not Baseline widely available (no Safari support),\n        // compatibility is handled by idle-callback-shim.ts.\n        // A run forced by the timeout has 0 time remaining, only maxTime applies.\n        // eslint-disable-next-line baseline-js/use-baseline\n        const noIdleTime = !deadline.didTimeout && deadline.timeRemaining() < 1;\n        if (elapsed >= maxTime || noIdleTime) {\n          break;\n        }\n\n        cursor++;\n        this._emitResource(entry);\n      }\n    } finally {\n      this._pendingEntries.splice(0, cursor);\n      if (this._pendingEntries.length > 0) {\n        this._scheduleProcessing();\n      }\n    }\n  }\n\n  private _emitResource(entry: PerformanceResourceTiming): void {\n    try {\n      const record: LogRecord = {\n        eventName: RESOURCE_TIMING_EVENT_NAME,\n        severityNumber: SeverityNumber.INFO,\n        attributes: {\n          [ATTR_RESOURCE_URL]: entry.name,\n          [ATTR_RESOURCE_INITIATOR_TYPE]: entry.initiatorType,\n          [ATTR_RESOURCE_DURATION]: entry.duration,\n          [ATTR_RESOURCE_FETCH_START]: entry.fetchStart,\n          [ATTR_RESOURCE_DOMAIN_LOOKUP_START]: entry.domainLookupStart,\n          [ATTR_RESOURCE_DOMAIN_LOOKUP_END]: entry.domainLookupEnd,\n          [ATTR_RESOURCE_CONNECT_START]: entry.connectStart,\n          [ATTR_RESOURCE_CONNECT_END]: entry.connectEnd,\n          [ATTR_RESOURCE_SECURE_CONNECTION_START]: entry.secureConnectionStart,\n          [ATTR_RESOURCE_REQUEST_START]: entry.requestStart,\n          [ATTR_RESOURCE_RESPONSE_START]: entry.responseStart,\n          [ATTR_RESOURCE_RESPONSE_END]: entry.responseEnd,\n          [ATTR_RESOURCE_TRANSFER_SIZE]: entry.transferSize,\n          [ATTR_RESOURCE_ENCODED_BODY_SIZE]: entry.encodedBodySize,\n          [ATTR_RESOURCE_DECODED_BODY_SIZE]: entry.decodedBodySize,\n          [ATTR_RESOURCE_REDIRECT_START]: entry.redirectStart,\n          [ATTR_RESOURCE_REDIRECT_END]: entry.redirectEnd,\n          [ATTR_RESOURCE_WORKER_START]: entry.workerStart,\n          [ATTR_RESOURCE_NEXT_HOP_PROTOCOL]: entry.nextHopProtocol,\n          // @ts-expect-error renderBlockingStatus is only available in Chromium as of March 2026\n          [ATTR_RESOURCE_RENDER_BLOCKING_STATUS]: entry.renderBlockingStatus,\n        },\n      };\n      const registry = getNetworkContextRegistry();\n      const ctx = registry.getContext(entry);\n      // Attach the context to the LogRecord and remove it from the registry\n      if (ctx) {\n        record.context = ctx;\n        registry.unregister(entry);\n      }\n      this.logger.emit(record);\n    } catch (error) {\n      this._diag.error(\n        `Failed to emit resource timing entry for \"${entry.name}\"`,\n        error,\n      );\n    }\n  }\n\n  private _flush(): void {\n    this._cancelScheduledProcessing();\n\n    for (const entry of this._pendingEntries) {\n      this._emitResource(entry);\n    }\n    this._pendingEntries = [];\n  }\n\n  private _cancelScheduledProcessing(): void {\n    if (this._idleHandle !== undefined) {\n      cancelIdleCallbackShim(this._idleHandle);\n      this._idleHandle = undefined;\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type {\n  IAnyValue,\n  IInstrumentationScope,\n  IKeyValue,\n  Resource,\n} from './internal-types';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport type { Resource as ISdkResource } from '@opentelemetry/resources';\nimport type { Encoder } from './utils';\nimport type { LogAttributes } from '@opentelemetry/api-logs';\n\nexport function createResource(\n  resource: ISdkResource,\n  encoder: Encoder\n): Resource {\n  const result: Resource = {\n    attributes: toAttributes(resource.attributes, encoder),\n    droppedAttributesCount: 0,\n  };\n\n  const schemaUrl = resource.schemaUrl;\n  if (schemaUrl && schemaUrl !== '') result.schemaUrl = schemaUrl;\n\n  return result;\n}\n\nexport function createInstrumentationScope(\n  scope: InstrumentationScope & {\n    attributes?: LogAttributes;\n    droppedAttributesCount?: number;\n  },\n  encoder: Encoder\n): IInstrumentationScope {\n  const result: IInstrumentationScope = {\n    name: scope.name,\n    version: scope.version,\n  };\n\n  if (scope.attributes && Object.keys(scope.attributes).length > 0) {\n    result.attributes = toAttributes(scope.attributes, encoder);\n    result.droppedAttributesCount = scope.droppedAttributesCount ?? 0;\n  }\n\n  return result;\n}\n\nexport function toAttributes(\n  attributes: LogAttributes,\n  encoder: Encoder\n): IKeyValue[] {\n  return Object.keys(attributes).map(key =>\n    toKeyValue(key, attributes[key], encoder)\n  );\n}\n\nexport function toKeyValue(\n  key: string,\n  value: unknown,\n  encoder: Encoder\n): IKeyValue {\n  return {\n    key: key,\n    value: toAnyValue(value, encoder),\n  };\n}\n\nexport function toAnyValue(value: unknown, encoder: Encoder): IAnyValue {\n  const t = typeof value;\n  if (t === 'string') return { stringValue: value as string };\n  if (t === 'number') {\n    if (!Number.isInteger(value)) return { doubleValue: value as number };\n    return { intValue: value as number };\n  }\n  if (t === 'boolean') return { boolValue: value as boolean };\n  if (value instanceof Uint8Array)\n    return { bytesValue: encoder.encodeUint8Array(value) };\n  if (Array.isArray(value)) {\n    const values: IAnyValue[] = new Array(value.length);\n    for (let i = 0; i < value.length; i++) {\n      values[i] = toAnyValue(value[i], encoder);\n    }\n    return { arrayValue: { values } };\n  }\n  if (t === 'object' && value != null) {\n    const keys = Object.keys(value);\n    const values: IKeyValue[] = new Array(keys.length);\n    for (let i = 0; i < keys.length; i++) {\n      values[i] = {\n        key: keys[i],\n        value: toAnyValue((value as Record<string, unknown>)[keys[i]], encoder),\n      };\n    }\n    return { kvlistValue: { values } };\n  }\n\n  return {};\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ReadableLogRecord } from '@opentelemetry/sdk-logs';\nimport type {\n  ESeverityNumber,\n  IExportLogsServiceRequest,\n  ILogRecord,\n  IResourceLogs,\n} from './internal-types';\nimport type { Resource } from '@opentelemetry/resources';\nimport type { Encoder } from '../common/utils';\nimport {\n  createInstrumentationScope,\n  createResource,\n  toAnyValue,\n  toAttributes,\n} from '../common/internal';\nimport type { SeverityNumber } from '@opentelemetry/api-logs';\n\nexport function createExportLogsServiceRequest(\n  logRecords: ReadableLogRecord[],\n  encoder: Encoder\n): IExportLogsServiceRequest {\n  return {\n    resourceLogs: logRecordsToResourceLogs(logRecords, encoder),\n  };\n}\n\nfunction createResourceMap(\n  logRecords: ReadableLogRecord[]\n): Map<\n  Resource,\n  Map<ReadableLogRecord['instrumentationScope'], ReadableLogRecord[]>\n> {\n  const resourceMap: Map<\n    Resource,\n    Map<ReadableLogRecord['instrumentationScope'], ReadableLogRecord[]>\n  > = new Map();\n\n  for (const record of logRecords) {\n    const { resource, instrumentationScope } = record;\n\n    let ismMap = resourceMap.get(resource);\n    if (!ismMap) {\n      ismMap = new Map();\n      resourceMap.set(resource, ismMap);\n    }\n\n    let records = ismMap.get(instrumentationScope);\n    if (!records) {\n      records = [];\n      ismMap.set(instrumentationScope, records);\n    }\n    records.push(record);\n  }\n  return resourceMap;\n}\n\nfunction logRecordsToResourceLogs(\n  logRecords: ReadableLogRecord[],\n  encoder: Encoder\n): IResourceLogs[] {\n  const resourceMap = createResourceMap(logRecords);\n  return Array.from(resourceMap, ([resource, ismMap]) => {\n    const processedResource = createResource(resource, encoder);\n    return {\n      resource: processedResource,\n      scopeLogs: Array.from(ismMap, ([, scopeLogs]) => {\n        return {\n          scope: createInstrumentationScope(\n            scopeLogs[0].instrumentationScope,\n            encoder\n          ),\n          logRecords: scopeLogs.map(log => toLogRecord(log, encoder)),\n          schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl,\n        };\n      }),\n      schemaUrl: processedResource.schemaUrl,\n    };\n  });\n}\n\nfunction toLogRecord(log: ReadableLogRecord, encoder: Encoder): ILogRecord {\n  return {\n    timeUnixNano: encoder.encodeHrTime(log.hrTime),\n    observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved),\n    severityNumber: toSeverityNumber(log.severityNumber),\n    severityText: log.severityText,\n    body: toAnyValue(log.body, encoder),\n    eventName: log.eventName,\n    attributes: toAttributes(log.attributes, encoder),\n    droppedAttributesCount: log.droppedAttributesCount,\n    flags: log.spanContext?.traceFlags,\n    traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId),\n    spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId),\n  };\n}\n\nfunction toSeverityNumber(\n  severityNumber: SeverityNumber | undefined\n): ESeverityNumber | undefined {\n  return severityNumber as number | undefined as ESeverityNumber | undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Fixed64, LongBits } from './internal-types';\nimport type { HrTime } from '@opentelemetry/api';\nimport { hrTimeToNanoseconds } from '@opentelemetry/core';\nimport { hexToBinary } from './hex-to-binary';\n\nexport function hrTimeToNanos(hrTime: HrTime): bigint {\n  const NANOSECONDS = BigInt(1_000_000_000);\n  return (\n    BigInt(Math.trunc(hrTime[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime[1]))\n  );\n}\n\nexport function toLongBits(value: bigint): LongBits {\n  const low = Number(BigInt.asUintN(32, value));\n  const high = Number(BigInt.asUintN(32, value >> BigInt(32)));\n  return { low, high };\n}\n\nexport function encodeAsLongBits(hrTime: HrTime): LongBits {\n  const nanos = hrTimeToNanos(hrTime);\n  return toLongBits(nanos);\n}\n\nexport function encodeAsString(hrTime: HrTime): string {\n  const nanos = hrTimeToNanos(hrTime);\n  return nanos.toString();\n}\n\nconst encodeTimestamp =\n  typeof BigInt !== 'undefined' ? encodeAsString : hrTimeToNanoseconds;\n\nexport type HrTimeEncodeFunction = (hrTime: HrTime) => Fixed64;\nexport type SpanContextEncodeFunction = (\n  spanContext: string\n) => string | Uint8Array;\nexport type OptionalSpanContextEncodeFunction = (\n  spanContext: string | undefined\n) => string | Uint8Array | undefined;\nexport type Uint8ArrayEncodeFunction = (\n  value: Uint8Array\n) => string | Uint8Array;\n\nexport interface Encoder {\n  encodeHrTime: HrTimeEncodeFunction;\n  encodeSpanContext: SpanContextEncodeFunction;\n  encodeOptionalSpanContext: OptionalSpanContextEncodeFunction;\n  encodeUint8Array: Uint8ArrayEncodeFunction;\n}\n\nfunction identity<T>(value: T): T {\n  return value;\n}\n\nfunction optionalHexToBinary(str: string | undefined): Uint8Array | undefined {\n  if (str === undefined) return undefined;\n  return hexToBinary(str);\n}\n\n/**\n * Encoder for protobuf format.\n * Uses { high, low } timestamps and binary for span/trace IDs, leaves Uint8Array attributes as-is.\n */\nexport const PROTOBUF_ENCODER: Encoder = {\n  encodeHrTime: encodeAsLongBits,\n  encodeSpanContext: hexToBinary,\n  encodeOptionalSpanContext: optionalHexToBinary,\n  encodeUint8Array: identity,\n};\n\n/**\n * Encoder for JSON format.\n * Uses string timestamps, hex for span/trace IDs, and base64 for Uint8Array.\n */\nexport const JSON_ENCODER: Encoder = {\n  encodeHrTime: encodeTimestamp,\n  encodeSpanContext: identity,\n  encodeOptionalSpanContext: identity,\n  encodeUint8Array: (bytes: Uint8Array): string => {\n    if (typeof Buffer !== 'undefined') {\n      return Buffer.from(bytes).toString('base64');\n    }\n\n    // implementation note: not using spread operator and passing to\n    // btoa to avoid stack overflow on large Uint8Arrays\n    const chars = new Array(bytes.length);\n    for (let i = 0; i < bytes.length; i++) {\n      chars[i] = String.fromCharCode(bytes[i]);\n    }\n    return btoa(chars.join(''));\n  },\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { ISerializer } from '../../i-serializer';\nimport type { ReadableLogRecord } from '@opentelemetry/sdk-logs';\nimport { createExportLogsServiceRequest } from '../internal';\nimport type { IExportLogsServiceResponse } from '../export-response';\nimport { JSON_ENCODER } from '../../common/utils';\nimport { diag } from '@opentelemetry/api';\n\n/**\n * @experimental this serializer may receive breaking changes in minor versions, pin this package's version when using this constant\n */\nexport const JsonLogsSerializer: ISerializer<\n  ReadableLogRecord[],\n  IExportLogsServiceResponse\n> = {\n  serializeRequest: (arg: ReadableLogRecord[]) => {\n    const request = createExportLogsServiceRequest(arg, JSON_ENCODER);\n    const encoder = new TextEncoder();\n    return encoder.encode(JSON.stringify(request));\n  },\n  deserializeResponse: (arg: Uint8Array) => {\n    if (arg.length === 0) {\n      return {};\n    }\n    const decoder = new TextDecoder();\n    try {\n      return JSON.parse(decoder.decode(arg)) as IExportLogsServiceResponse;\n    } catch (err) {\n      diag.warn(\n        `Failed to parse logs export response: ${err.message}. Returning empty response`\n      );\n      return {};\n    }\n  },\n};\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Link } from '@opentelemetry/api';\nimport type { Resource } from '@opentelemetry/resources';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace';\nimport type { Encoder } from '../common/utils';\nimport {\n  createInstrumentationScope,\n  createResource,\n  toAttributes,\n} from '../common/internal';\nimport type {\n  EStatusCode,\n  IEvent,\n  IExportTraceServiceRequest,\n  ILink,\n  IResourceSpans,\n  IScopeSpans,\n  ISpan,\n} from './internal-types';\n\n// Span flags constants matching the OTLP specification\nconst SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x100;\nconst SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x200;\n\n/**\n * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags\n * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec.\n */\nfunction buildSpanFlagsFrom(traceFlags: number, isRemote?: boolean): number {\n  // low 8 bits are W3C TraceFlags (e.g., sampled)\n  let flags = (traceFlags & 0xff) | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK;\n  if (isRemote) {\n    flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK;\n  }\n  return flags;\n}\n\nexport function sdkSpanToOtlpSpan(span: ReadableSpan, encoder: Encoder): ISpan {\n  const ctx = span.spanContext();\n  const status = span.status;\n  const parentSpanId = span.parentSpanContext?.spanId\n    ? encoder.encodeSpanContext(span.parentSpanContext?.spanId)\n    : undefined;\n  return {\n    traceId: encoder.encodeSpanContext(ctx.traceId),\n    spanId: encoder.encodeSpanContext(ctx.spanId),\n    parentSpanId: parentSpanId,\n    traceState: ctx.traceState?.serialize(),\n    name: span.name,\n    // Span kind is offset by 1 because the API does not define a value for unset\n    kind: span.kind == null ? 0 : span.kind + 1,\n    startTimeUnixNano: encoder.encodeHrTime(span.startTime),\n    endTimeUnixNano: encoder.encodeHrTime(span.endTime),\n    attributes: toAttributes(span.attributes, encoder),\n    droppedAttributesCount: span.droppedAttributesCount,\n    events: span.events.map(event => toOtlpSpanEvent(event, encoder)),\n    droppedEventsCount: span.droppedEventsCount,\n    status: {\n      // API and proto enums share the same values\n      code: status.code as unknown as EStatusCode,\n      message: status.message,\n    },\n    links: span.links.map(link => toOtlpLink(link, encoder)),\n    droppedLinksCount: span.droppedLinksCount,\n    flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote),\n  };\n}\n\nexport function toOtlpLink(link: Link, encoder: Encoder): ILink {\n  return {\n    attributes: link.attributes ? toAttributes(link.attributes, encoder) : [],\n    spanId: encoder.encodeSpanContext(link.context.spanId),\n    traceId: encoder.encodeSpanContext(link.context.traceId),\n    traceState: link.context.traceState?.serialize(),\n    droppedAttributesCount: link.droppedAttributesCount || 0,\n    flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote),\n  };\n}\n\nexport function toOtlpSpanEvent(\n  timedEvent: TimedEvent,\n  encoder: Encoder\n): IEvent {\n  return {\n    attributes: timedEvent.attributes\n      ? toAttributes(timedEvent.attributes, encoder)\n      : [],\n    name: timedEvent.name,\n    timeUnixNano: encoder.encodeHrTime(timedEvent.time),\n    droppedAttributesCount: timedEvent.droppedAttributesCount || 0,\n  };\n}\n\nexport function createExportTraceServiceRequest(\n  spans: ReadableSpan[],\n  encoder: Encoder\n): IExportTraceServiceRequest {\n  return {\n    resourceSpans: spanRecordsToResourceSpans(spans, encoder),\n  };\n}\n\nfunction createResourceMap(readableSpans: ReadableSpan[]) {\n  const resourceMap: Map<Resource, Map<string, ReadableSpan[]>> = new Map();\n  for (const record of readableSpans) {\n    let ilsMap = resourceMap.get(record.resource);\n\n    if (!ilsMap) {\n      ilsMap = new Map();\n      resourceMap.set(record.resource, ilsMap);\n    }\n\n    // TODO this is duplicated in basic tracer. Consolidate on a common helper in core\n    const instrumentationScopeKey = `${record.instrumentationScope.name}@${\n      record.instrumentationScope.version || ''\n    }:${record.instrumentationScope.schemaUrl || ''}`;\n    let records = ilsMap.get(instrumentationScopeKey);\n\n    if (!records) {\n      records = [];\n      ilsMap.set(instrumentationScopeKey, records);\n    }\n\n    records.push(record);\n  }\n\n  return resourceMap;\n}\n\nfunction spanRecordsToResourceSpans(\n  readableSpans: ReadableSpan[],\n  encoder: Encoder\n): IResourceSpans[] {\n  const resourceMap = createResourceMap(readableSpans);\n  const out: IResourceSpans[] = [];\n\n  const entryIterator = resourceMap.entries();\n  let entry = entryIterator.next();\n  while (!entry.done) {\n    const [resource, ilmMap] = entry.value;\n    const scopeResourceSpans: IScopeSpans[] = [];\n    const ilmIterator = ilmMap.values();\n    let ilmEntry = ilmIterator.next();\n    while (!ilmEntry.done) {\n      const scopeSpans = ilmEntry.value;\n      if (scopeSpans.length > 0) {\n        const spans = scopeSpans.map(readableSpan =>\n          sdkSpanToOtlpSpan(readableSpan, encoder)\n        );\n\n        scopeResourceSpans.push({\n          scope: createInstrumentationScope(\n            scopeSpans[0].instrumentationScope,\n            encoder\n          ),\n          spans: spans,\n          schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl,\n        });\n      }\n      ilmEntry = ilmIterator.next();\n    }\n    const processedResource = createResource(resource, encoder);\n    const transformedSpans: IResourceSpans = {\n      resource: processedResource,\n      scopeSpans: scopeResourceSpans,\n      schemaUrl: processedResource.schemaUrl,\n    };\n\n    out.push(transformedSpans);\n    entry = entryIterator.next();\n  }\n\n  return out;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { ISerializer } from '../../i-serializer';\nimport type { ReadableSpan } from '@opentelemetry/sdk-trace';\nimport type { IExportTraceServiceResponse } from '../export-response';\nimport { createExportTraceServiceRequest } from '../internal';\nimport { JSON_ENCODER } from '../../common/utils';\nimport { diag } from '@opentelemetry/api';\n\nexport const JsonTraceSerializer: ISerializer<\n  ReadableSpan[],\n  IExportTraceServiceResponse\n> = {\n  serializeRequest: (arg: ReadableSpan[]) => {\n    const request = createExportTraceServiceRequest(arg, JSON_ENCODER);\n    const encoder = new TextEncoder();\n    return encoder.encode(JSON.stringify(request));\n  },\n  deserializeResponse: (arg: Uint8Array) => {\n    if (arg.length === 0) {\n      return {};\n    }\n    const decoder = new TextDecoder();\n    try {\n      return JSON.parse(decoder.decode(arg)) as IExportTraceServiceResponse;\n    } catch (err) {\n      diag.warn(\n        `Failed to parse trace export response: ${err.message}. Returning empty response`\n      );\n      return {};\n    }\n  },\n};\n", "import { ExportResultCode, type ExportResult } from \"@opentelemetry/core\";\nimport type { CaptureEpoch } from \"../consent-epoch.ts\";\n\ninterface ExportOptions<T> {\n  url: string;\n  headers: Record<string, string>;\n  serializer: { serializeRequest(records: T[]): Uint8Array | undefined };\n  epoch: CaptureEpoch;\n  fetch?: typeof globalThis.fetch;\n  timeoutMillis?: number;\n  retryDelayMillis?: number;\n}\n\ninterface PendingExport {\n  cancel(): void;\n  done: Promise<void>;\n}\n\nconst RETRYABLE_STATUS = new Set([429, 502, 503, 504]);\nconst MAX_KEEPALIVE_BYTES = 60 * 1024;\nlet pendingKeepaliveBytes = 0;\nlet pendingKeepaliveRequests = 0;\n\n/** An OTLP dispatch and every retry belong permanently to their original consent epoch. */\nexport class ConsentHttpExporter<T> {\n  private readonly options: ExportOptions<T>;\n  private readonly fetch: typeof globalThis.fetch;\n  private readonly pending = new Set<PendingExport>();\n  private accepting = true;\n  private discarded = false;\n\n  constructor(options: ExportOptions<T>) {\n    this.options = options;\n    // Capture transport before this runtime wraps fetch. Never instrument our own exports.\n    const fetch = options.fetch ?? globalThis.fetch;\n    const original = (fetch as typeof fetch & { __original?: typeof fetch }).__original;\n    this.fetch = (typeof original === \"function\" ? original : fetch).bind(globalThis);\n  }\n\n  export(records: T[], callback: (result: ExportResult) => void): void {\n    if (!this.accepting || !this.allowed()) {\n      callback({ code: ExportResultCode.SUCCESS });\n      return;\n    }\n    let data: Uint8Array | undefined;\n    try {\n      data = this.options.serializer.serializeRequest(records);\n    } catch (error) {\n      callback({ code: ExportResultCode.FAILED, error: asError(error) });\n      return;\n    }\n    if (!data) {\n      callback({ code: ExportResultCode.SUCCESS });\n      return;\n    }\n    this.send(data, callback);\n  }\n\n  async forceFlush(): Promise<void> {\n    await Promise.all([...this.pending].map((operation) => operation.done));\n  }\n\n  async shutdown(): Promise<void> {\n    this.accepting = false;\n    await this.forceFlush();\n  }\n\n  discard(): Promise<void> {\n    this.accepting = false;\n    this.discarded = true;\n    // Cancellation closes retries and aborts requests synchronously, before returning a promise.\n    for (const operation of [...this.pending]) operation.cancel();\n    return this.forceFlush();\n  }\n\n  private allowed(): boolean {\n    return !this.discarded && this.options.epoch.isActive();\n  }\n\n  private send(data: Uint8Array, callback: (result: ExportResult) => void): void {\n    const timeoutMillis = this.options.timeoutMillis ?? 8000;\n    const deadline = Date.now() + timeoutMillis;\n    let finished = false;\n    let controller: AbortController | undefined;\n    let retryTimer: ReturnType<typeof setTimeout> | undefined;\n    let resolveDone!: () => void;\n    const operation: PendingExport = {\n      done: new Promise<void>((resolve) => {\n        resolveDone = resolve;\n      }),\n      cancel: () => complete({ code: ExportResultCode.SUCCESS }),\n    };\n    const complete = (result: ExportResult) => {\n      if (finished) return;\n      finished = true;\n      if (retryTimer !== undefined) clearTimeout(retryTimer);\n      if (timeout !== undefined) clearTimeout(timeout);\n      controller?.abort();\n      this.pending.delete(operation);\n      resolveDone();\n      callback(result);\n    };\n    this.pending.add(operation);\n    const timeout = setTimeout(\n      () => complete({ code: ExportResultCode.FAILED, error: new Error(\"RUM export timed out\") }),\n      timeoutMillis,\n    );\n\n    const retry = (attempt: number, response?: Response, error?: unknown) => {\n      if (finished) return;\n      if (!this.allowed()) return complete({ code: ExportResultCode.SUCCESS });\n      const fallback = (this.options.retryDelayMillis ?? 1000) * 1.5 ** attempt;\n      const delay = retryAfter(response?.headers.get(\"retry-after\")) ?? Math.min(fallback, 5000);\n      if (attempt >= 5 || delay >= deadline - Date.now()) {\n        return complete({\n          code: ExportResultCode.FAILED,\n          error: error ? asError(error) : new Error(`RUM export failed (${response?.status})`),\n        });\n      }\n      retryTimer = setTimeout(() => void dispatch(attempt + 1), delay);\n    };\n    const dispatch = async (attempt: number): Promise<void> => {\n      if (finished) return;\n      // This check is at the network boundary, including the callback of every delayed retry.\n      if (!this.allowed()) return complete({ code: ExportResultCode.SUCCESS });\n      controller = new AbortController();\n      const keepalive =\n        pendingKeepaliveBytes + data.byteLength <= MAX_KEEPALIVE_BYTES &&\n        pendingKeepaliveRequests < 9;\n      if (keepalive) {\n        pendingKeepaliveBytes += data.byteLength;\n        pendingKeepaliveRequests++;\n      }\n      try {\n        const response = await this.fetch(this.options.url, {\n          method: \"POST\",\n          headers: {\n            ...this.options.headers,\n            \"Content-Type\": \"application/json\",\n          },\n          body: data as Uint8Array<ArrayBuffer>,\n          signal: controller.signal,\n          credentials: \"omit\",\n          keepalive,\n          mode: \"cors\",\n        });\n        if (finished) return;\n        if (!this.allowed()) return complete({ code: ExportResultCode.SUCCESS });\n        if (response.status >= 200 && response.status < 300) {\n          complete({ code: ExportResultCode.SUCCESS });\n        } else if (RETRYABLE_STATUS.has(response.status)) {\n          retry(attempt, response);\n        } else {\n          complete({\n            code: ExportResultCode.FAILED,\n            error: new Error(`RUM export failed (${response.status})`),\n          });\n        }\n      } catch (error) {\n        if (finished) return;\n        if (!this.allowed()) return complete({ code: ExportResultCode.SUCCESS });\n        if (error instanceof TypeError) retry(attempt, undefined, error);\n        else complete({ code: ExportResultCode.FAILED, error: asError(error) });\n      } finally {\n        if (keepalive) {\n          pendingKeepaliveBytes -= data.byteLength;\n          pendingKeepaliveRequests--;\n        }\n      }\n    };\n    void dispatch(0);\n  }\n}\n\nfunction asError(error: unknown): Error {\n  return error instanceof Error ? error : new Error(\"RUM transport failed\");\n}\n\nfunction retryAfter(value: string | null | undefined): number | undefined {\n  if (value == null) return undefined;\n  if (/^\\d+$/.test(value)) return Number(value) * 1000;\n  const date = Date.parse(value);\n  return Number.isFinite(date) ? Math.max(0, date - Date.now()) : undefined;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\nimport type { AnyValue, LogAttributes } from '@opentelemetry/api-logs';\nimport type { LogRecordLimits } from '../types';\n\n/**\n * Validates if a value is a valid AnyValue for Log Attributes according to OpenTelemetry spec.\n * Log Attributes support a superset of standard Attributes and must support:\n * - Scalar values: string, boolean, signed 64-bit integer, or double precision floating point\n * - Byte arrays (Uint8Array)\n * - Arrays of any values (heterogeneous arrays allowed)\n * - Maps from string to any value (nested objects)\n * - Empty values (null/undefined)\n *\n * @param val - The value to validate\n * @returns true if the value is a valid AnyValue, false otherwise\n */\nexport function isLogAttributeValue(val: unknown): val is AnyValue {\n  return isLogAttributeValueInternal(val, new WeakSet());\n}\n\nfunction isLogAttributeValueInternal(\n  val: unknown,\n  visited: WeakSet<object>\n): val is AnyValue {\n  // null and undefined are explicitly allowed\n  if (val == null) {\n    return true;\n  }\n\n  // Scalar values\n  if (\n    typeof val === 'string' ||\n    typeof val === 'number' ||\n    typeof val === 'boolean'\n  ) {\n    return true;\n  }\n\n  // Byte arrays\n  if (val instanceof Uint8Array) {\n    return true;\n  }\n\n  // For objects and arrays, check for circular references\n  if (typeof val === 'object') {\n    if (visited.has(val as object)) {\n      // Circular reference detected - reject it\n      return false;\n    }\n    visited.add(val as object);\n\n    // Arrays (can contain any AnyValue, including heterogeneous)\n    if (Array.isArray(val)) {\n      for (const item of val) {\n        if (!isLogAttributeValueInternal(item, visited)) {\n          return false;\n        }\n      }\n      return true;\n    }\n\n    // Only accept plain objects (not built-in objects like Date, RegExp, Error, etc.)\n    // Check if it's a plain object by verifying its constructor is Object or it has no constructor\n    const obj = val as Record<string, unknown>;\n    if (obj.constructor !== Object && obj.constructor !== undefined) {\n      return false;\n    }\n\n    // Objects/Maps (including empty objects)\n    // All object properties must be valid AnyValues\n    for (const key in obj) {\n      if (\n        Object.prototype.hasOwnProperty.call(obj, key) &&\n        !isLogAttributeValueInternal(obj[key], visited)\n      ) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  return false;\n}\n\nexport const enum AddAttributeDecision {\n  DROP_INVALID = 0,\n  DROP_LIMIT_REACHED = 1,\n  ADD_NEW = 2,\n  ADD_OVERWRITE_EXISTING = 3,\n}\n\nexport function addAttribute(\n  attributes: LogAttributes,\n  limits: Readonly<Required<LogRecordLimits>>,\n  currentAttributesCount: number,\n  key: string,\n  value?: AnyValue\n): AddAttributeDecision {\n  if (key.length === 0) {\n    diag.warn(`Invalid attribute key: ${key}`);\n    return AddAttributeDecision.DROP_INVALID;\n  }\n  if (!isLogAttributeValue(value)) {\n    diag.warn(`Invalid attribute value set for key: ${key}`);\n    return AddAttributeDecision.DROP_INVALID;\n  }\n  const isNewKey = !Object.prototype.hasOwnProperty.call(attributes, key);\n  if (isNewKey && currentAttributesCount >= limits.attributeCountLimit) {\n    return AddAttributeDecision.DROP_LIMIT_REACHED;\n  }\n\n  attributes[key] = truncateToSize(value, limits.attributeValueLengthLimit);\n  if (isNewKey) {\n    return AddAttributeDecision.ADD_NEW;\n  }\n  return AddAttributeDecision.ADD_OVERWRITE_EXISTING;\n}\n\nfunction truncateToSize(value: AnyValue, limit: number): AnyValue {\n  // Check limit\n  if (limit <= 0) {\n    // Negative values are invalid, so do not truncate\n    diag.warn(`Attribute value limit must be positive, got ${limit}`);\n    return value;\n  }\n\n  // null/undefined - no truncation needed\n  if (value == null) {\n    return value;\n  }\n\n  // String\n  if (typeof value === 'string') {\n    if (value.length <= limit) {\n      return value;\n    }\n    return value.substring(0, limit);\n  }\n\n  // Byte arrays - no truncation needed\n  if (value instanceof Uint8Array) {\n    return value;\n  }\n\n  // Arrays (can contain any AnyValue types)\n  if (Array.isArray(value)) {\n    return value.map(val => truncateToSize(val, limit));\n  }\n\n  // Objects/Maps - recursively truncate nested values\n  if (typeof value === 'object') {\n    const truncatedObj: Record<string, AnyValue> = {};\n    for (const [k, v] of Object.entries(value as Record<string, AnyValue>)) {\n      truncatedObj[k] = truncateToSize(v, limit);\n    }\n    return truncatedObj;\n  }\n\n  // Other types (number, boolean), no need to apply value length limit\n  return value;\n}\n\n/**\n * Normalize attributes for use on the instrumentation scope. Drops invalid attributes and keeps track of\n * how many were dropped.\n *\n * @param limits\n * @param attributes\n */\nexport function normalizeScopeAttributes(\n  limits: Readonly<Required<LogRecordLimits>>,\n  attributes?: LogAttributes\n): {\n  readonly attributes?: LogAttributes;\n  readonly droppedAttributesCount?: number;\n} {\n  if (attributes == null) {\n    return {};\n  }\n\n  const normalizedAttributes: LogAttributes = {};\n  let currentAttributesCount = 0;\n  let droppedAttributesCount = 0;\n\n  for (const [key, value] of Object.entries(attributes)) {\n    const decision = addAttribute(\n      normalizedAttributes,\n      limits,\n      currentAttributesCount,\n      key,\n      value\n    );\n\n    if (decision === AddAttributeDecision.ADD_NEW) {\n      currentAttributesCount += 1;\n    } else if (decision === AddAttributeDecision.DROP_INVALID) {\n      droppedAttributesCount += 1;\n    } else if (decision === AddAttributeDecision.DROP_LIMIT_REACHED) {\n      droppedAttributesCount += 1;\n    } else {\n      // do nothing\n    }\n  }\n\n  return {\n    attributes: currentAttributesCount > 0 ? normalizedAttributes : undefined,\n    droppedAttributesCount,\n  };\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  AnyValue,\n  LogAttributes,\n  LogBody,\n  LogRecord,\n  SeverityNumber,\n} from '@opentelemetry/api-logs';\nimport * as api from '@opentelemetry/api';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport { timeInputToHrTime } from '@opentelemetry/core';\nimport type { Resource } from '@opentelemetry/resources';\nimport {\n  ATTR_EXCEPTION_MESSAGE,\n  ATTR_EXCEPTION_STACKTRACE,\n  ATTR_EXCEPTION_TYPE,\n} from '@opentelemetry/semantic-conventions';\nimport type { ReadableLogRecord } from './export/ReadableLogRecord';\nimport type { LogRecordLimits } from './types';\nimport type { LoggerProviderSharedState } from './internal/LoggerProviderSharedState';\nimport { addAttribute, AddAttributeDecision } from './utils/validation';\n\nexport class LogRecordImpl implements ReadableLogRecord {\n  readonly resource: Resource;\n  readonly instrumentationScope: InstrumentationScope & {\n    attributes?: LogAttributes;\n    droppedAttributesCount?: number;\n  };\n  readonly attributes: LogAttributes = {};\n  private _hrTime: api.HrTime;\n  private _hrTimeObserved: api.HrTime;\n  private _spanContext?: api.SpanContext;\n  private _severityText?: string;\n  private _severityNumber?: SeverityNumber;\n  private _body?: LogBody;\n  private _eventName?: string;\n  private _attributesCount: number = 0;\n  private _droppedAttributesCount: number = 0;\n\n  private _isReadonly: boolean = false;\n  private readonly _logRecordLimits: Required<LogRecordLimits>;\n\n  get hrTime(): api.HrTime {\n    return this._hrTime;\n  }\n  set hrTime(hrTime: api.HrTime) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._hrTime = hrTime;\n  }\n\n  get hrTimeObserved(): api.HrTime {\n    return this._hrTimeObserved;\n  }\n  set hrTimeObserved(hrTimeObserved: api.HrTime) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._hrTimeObserved = hrTimeObserved;\n  }\n\n  get spanContext(): api.SpanContext | undefined {\n    return this._spanContext;\n  }\n  set spanContext(spanContext: api.SpanContext | undefined) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._spanContext = spanContext;\n  }\n\n  set severityText(severityText: string | undefined) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._severityText = severityText;\n  }\n  get severityText(): string | undefined {\n    return this._severityText;\n  }\n\n  set severityNumber(severityNumber: SeverityNumber | undefined) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._severityNumber = severityNumber;\n  }\n  get severityNumber(): SeverityNumber | undefined {\n    return this._severityNumber;\n  }\n\n  set body(body: LogBody | undefined) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._body = body;\n  }\n  get body(): LogBody | undefined {\n    return this._body;\n  }\n\n  get eventName(): string | undefined {\n    return this._eventName;\n  }\n  set eventName(eventName: string | undefined) {\n    if (this._isLogRecordReadonly()) {\n      return;\n    }\n    this._eventName = eventName;\n  }\n\n  get droppedAttributesCount(): number {\n    return this._droppedAttributesCount;\n  }\n\n  constructor(\n    _sharedState: LoggerProviderSharedState,\n    instrumentationScope: InstrumentationScope,\n    logRecord: LogRecord\n  ) {\n    const {\n      timestamp,\n      observedTimestamp,\n      eventName,\n      severityNumber,\n      severityText,\n      body,\n      attributes = {},\n      exception,\n      context,\n    } = logRecord;\n\n    const now = Date.now();\n    this._hrTime = timeInputToHrTime(timestamp ?? now);\n    this._hrTimeObserved = timeInputToHrTime(observedTimestamp ?? now);\n\n    if (context) {\n      const spanContext = api.trace.getSpanContext(context);\n      if (spanContext && api.isSpanContextValid(spanContext)) {\n        this._spanContext = spanContext;\n      }\n    }\n    this.severityNumber = severityNumber;\n    this.severityText = severityText;\n    this.body = body;\n    this.resource = _sharedState.resource;\n    this.instrumentationScope = instrumentationScope;\n    this._logRecordLimits = _sharedState.logRecordLimits;\n    this._eventName = eventName;\n    this.setAttributes(attributes);\n    if (exception != null) {\n      this._setException(exception);\n    }\n  }\n\n  public setAttribute(key: string, value?: AnyValue) {\n    if (this._isLogRecordReadonly()) {\n      return this;\n    }\n\n    const decision = addAttribute(\n      this.attributes,\n      this._logRecordLimits,\n      this._attributesCount,\n      key,\n      value\n    );\n\n    if (decision === AddAttributeDecision.DROP_LIMIT_REACHED) {\n      this._droppedAttributesCount++;\n      if (this._droppedAttributesCount === 1) {\n        // Only warn once per LogRecord to avoid log spam\n        api.diag.warn('Dropping extra attributes.');\n      }\n    } else if (decision === AddAttributeDecision.ADD_NEW) {\n      this._attributesCount++;\n    }\n\n    return this;\n  }\n\n  public setAttributes(attributes: LogAttributes) {\n    for (const [k, v] of Object.entries(attributes)) {\n      this.setAttribute(k, v);\n    }\n    return this;\n  }\n\n  public setBody(body: LogBody) {\n    this.body = body;\n    return this;\n  }\n\n  public setEventName(eventName: string) {\n    this.eventName = eventName;\n    return this;\n  }\n\n  public setSeverityNumber(severityNumber: SeverityNumber) {\n    this.severityNumber = severityNumber;\n    return this;\n  }\n\n  public setSeverityText(severityText: string) {\n    this.severityText = severityText;\n    return this;\n  }\n\n  /**\n   * @internal\n   * A LogRecordProcessor may freely modify logRecord for the duration of the OnEmit call.\n   * If logRecord is needed after OnEmit returns (i.e. for asynchronous processing) only reads are permitted.\n   */\n  _makeReadonly() {\n    this._isReadonly = true;\n  }\n\n  private _setException(exception: unknown): void {\n    let hasMinimumAttributes = false;\n\n    if (typeof exception === 'string' || typeof exception === 'number') {\n      if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_MESSAGE)) {\n        this.setAttribute(ATTR_EXCEPTION_MESSAGE, String(exception));\n      }\n      hasMinimumAttributes = true;\n    } else if (exception && typeof exception === 'object') {\n      const exceptionObj = exception as {\n        code?: string | number;\n        name?: string;\n        message?: string;\n        stack?: string;\n      };\n\n      if (exceptionObj.code) {\n        if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_TYPE)) {\n          this.setAttribute(ATTR_EXCEPTION_TYPE, exceptionObj.code.toString());\n        }\n        hasMinimumAttributes = true;\n      } else if (exceptionObj.name) {\n        if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_TYPE)) {\n          this.setAttribute(ATTR_EXCEPTION_TYPE, exceptionObj.name);\n        }\n        hasMinimumAttributes = true;\n      }\n\n      if (exceptionObj.message) {\n        if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_MESSAGE)) {\n          this.setAttribute(ATTR_EXCEPTION_MESSAGE, exceptionObj.message);\n        }\n        hasMinimumAttributes = true;\n      }\n\n      if (exceptionObj.stack) {\n        if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_STACKTRACE)) {\n          this.setAttribute(ATTR_EXCEPTION_STACKTRACE, exceptionObj.stack);\n        }\n        hasMinimumAttributes = true;\n      }\n    }\n\n    if (!hasMinimumAttributes) {\n      api.diag.warn(`Failed to record an exception ${exception}`);\n    }\n  }\n\n  private _isLogRecordReadonly(): boolean {\n    if (this._isReadonly) {\n      api.diag.warn('Can not execute the operation on emitted log record');\n    }\n    return this._isReadonly;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Logger as ILogger, LogRecord } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport type { Context } from '@opentelemetry/api';\nimport {\n  context,\n  trace,\n  TraceFlags,\n  isSpanContextValid,\n} from '@opentelemetry/api';\n\nimport { LogRecordImpl } from './LogRecordImpl';\nimport type { LoggerProviderSharedState } from './internal/LoggerProviderSharedState';\nimport type { LoggerConfig } from './types';\nimport type { LogInstrumentationScope } from './internal/utils';\n\nexport class Logger implements ILogger {\n  private readonly _instrumentationScope: LogInstrumentationScope;\n  private readonly _sharedState: LoggerProviderSharedState;\n  private readonly _loggerConfig: Required<LoggerConfig>;\n\n  constructor(\n    instrumentationScope: LogInstrumentationScope,\n    sharedState: LoggerProviderSharedState\n  ) {\n    this._instrumentationScope = instrumentationScope;\n    this._sharedState = sharedState;\n    // Cache the logger configuration at construction time\n    // Since we don't support re-configuration, this avoids map lookups\n    // and string allocations on each emit() call\n    this._loggerConfig = this._sharedState.getLoggerConfig(\n      this._instrumentationScope\n    );\n  }\n\n  public emit(logRecord: LogRecord): void {\n    const currentContext = logRecord.context || context.active();\n    if (!this.enabled(logRecord)) {\n      return;\n    }\n\n    /**\n     * If a Logger was obtained with include_trace_context=true,\n     * the LogRecords it emits MUST automatically include the Trace Context from the active Context,\n     * if Context has not been explicitly set.\n     */\n    const logRecordInstance = new LogRecordImpl(\n      this._sharedState,\n      this._instrumentationScope,\n      {\n        context: currentContext,\n        ...logRecord,\n      }\n    );\n    this._sharedState.loggerMetrics.emitLog();\n    /**\n     * the explicitly passed Context,\n     * the current Context, or an empty Context if the Logger was obtained with include_trace_context=false\n     */\n    this._sharedState.activeProcessor.onEmit(logRecordInstance, currentContext);\n    /**\n     * A LogRecordProcessor may freely modify logRecord for the duration of the OnEmit call.\n     * If logRecord is needed after OnEmit returns (i.e. for asynchronous processing) only reads are permitted.\n     */\n    logRecordInstance._makeReadonly();\n  }\n\n  public enabled(options?: {\n    context?: Context;\n    severityNumber?: SeverityNumber;\n    eventName?: string;\n  }): boolean {\n    if (this._sharedState.hasShutdown) {\n      return false;\n    }\n\n    const loggerConfig = this._loggerConfig;\n\n    if (loggerConfig.disabled) {\n      return false;\n    }\n\n    // Severity number given and lower than the min configured\n    const severityNumber = options?.severityNumber;\n    if (\n      typeof severityNumber === 'number' &&\n      severityNumber !== SeverityNumber.UNSPECIFIED &&\n      severityNumber < loggerConfig.minimumSeverity\n    ) {\n      return false;\n    }\n\n    const currentContext = options?.context || context.active();\n    // Trace based: the context (given or the active) has a unsampled Span\n    if (loggerConfig.traceBased) {\n      const spanContext = trace.getSpanContext(currentContext);\n      if (spanContext && isSpanContextValid(spanContext)) {\n        const isSampled =\n          (spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;\n        if (!isSampled) {\n          return false;\n        }\n      }\n    }\n\n    // Lastly check if there is any enabled processor\n    const enabledOpts = {\n      context: currentContext,\n      instrumentationScope: this._instrumentationScope,\n      severityNumber: options?.severityNumber,\n      eventName: options?.eventName,\n    };\n    for (const processor of this._sharedState.processors) {\n      if (!processor.enabled || processor.enabled(enabledOpts)) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport type { Context } from '@opentelemetry/api';\nimport type { LogRecordProcessor } from '../LogRecordProcessor';\nimport type { ReadWriteLogRecord } from '../export/ReadWriteLogRecord';\nimport type { SeverityNumber } from '@opentelemetry/api-logs';\n\nexport class NoopLogRecordProcessor implements LogRecordProcessor {\n  public forceFlush(): Promise<void> {\n    return Promise.resolve();\n  }\n\n  public onEmit(_logRecord: ReadWriteLogRecord, _context: Context): void {}\n\n  public shutdown(): Promise<void> {\n    return Promise.resolve();\n  }\n\n  public enabled(_options: {\n    context: Context;\n    instrumentationScope: InstrumentationScope;\n    severityNumber?: SeverityNumber;\n    eventName?: string;\n  }): boolean {\n    return false;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport { callWithTimeout } from '@opentelemetry/core';\nimport type { Context } from '@opentelemetry/api';\nimport type { LogRecordProcessor } from './LogRecordProcessor';\nimport type { ReadWriteLogRecord } from './export/ReadWriteLogRecord';\nimport type { SeverityNumber } from '@opentelemetry/api-logs';\nimport type { ForceFlushOptions } from './types';\n\n/**\n * Implementation of the {@link LogRecordProcessor} that simply forwards all\n * received events to a list of {@link LogRecordProcessor}s.\n */\nexport class MultiLogRecordProcessor implements LogRecordProcessor {\n  public readonly processors: LogRecordProcessor[];\n  constructor(processors: LogRecordProcessor[]) {\n    this.processors = processors;\n  }\n\n  public async forceFlush(options?: ForceFlushOptions): Promise<void> {\n    const timeout = options?.timeoutMillis ?? 30000;\n    await Promise.all(\n      this.processors.map(processor =>\n        callWithTimeout(processor.forceFlush(), timeout)\n      )\n    );\n  }\n\n  public onEmit(logRecord: ReadWriteLogRecord, context?: Context): void {\n    this.processors.forEach(processors =>\n      processors.onEmit(logRecord, context)\n    );\n  }\n\n  public async shutdown(): Promise<void> {\n    await Promise.all(this.processors.map(processor => processor.shutdown()));\n  }\n\n  public enabled(options: {\n    context: Context;\n    instrumentationScope: InstrumentationScope;\n    severityNumber?: SeverityNumber;\n    eventName?: string;\n  }): boolean {\n    for (const processor of this.processors) {\n      if (!processor.enabled || processor.enabled(options)) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { AnyValue, LogAttributes } from '@opentelemetry/api-logs';\nimport type { InstrumentationScope } from '@opentelemetry/core';\n\nexport type LogInstrumentationScope = InstrumentationScope & {\n  readonly attributes?: LogAttributes;\n  readonly droppedAttributesCount?: number;\n};\n\n/**\n * Normalizes an AnyValue to a JSON-serializable [typeTag, payload] tuple.\n *\n * Using a type tag as the first element guarantees that two values can only\n * produce the same tuple when they have the same type AND the same data,\n * avoiding cross-type collisions such as:\n *   - null vs NaN vs Infinity (all become JSON `null` via JSON.stringify)\n *   - -0 vs 0 (both become JSON `0` via JSON.stringify)\n *   - string \"null\" vs the value null\n *\n * Object keys are sorted so that attribute maps with the same entries but\n * different insertion orders produce the same key.\n */\nfunction normalizeAnyValue(value: AnyValue): [string, unknown] {\n  if (value === undefined) {\n    return ['u', null];\n  }\n  if (value === null) {\n    return ['n', null];\n  }\n\n  const valueType = typeof value;\n  if (valueType === 'string') {\n    return ['s', value];\n  }\n  if (valueType === 'boolean') {\n    return ['b', value];\n  }\n  if (valueType === 'number') {\n    if (Number.isNaN(value)) return ['nan', null];\n    if (value === Infinity) return ['inf', null];\n    if (value === -Infinity) return ['-inf', null];\n    if (Object.is(value, -0)) return ['n0', null];\n    return ['d', value];\n  }\n  if (value instanceof Uint8Array) {\n    return ['bytes', Array.from(value)];\n  }\n  if (Array.isArray(value)) {\n    return ['arr', value.map(normalizeAnyValue)];\n  }\n  // AnyValueMap — sort keys for insertion-order independence\n  return [\n    'map',\n    Object.entries(value)\n      .sort(([a], [b]) => a.localeCompare(b))\n      .map(([k, v]) => [k, normalizeAnyValue(v)]),\n  ];\n}\n\n/**\n * Converting the instrumentation scope object to a unique identifier string.\n * @param scope - The instrumentation scope to convert\n * @returns A unique string identifier for the scope\n */\nexport function getInstrumentationScopeKey(\n  scope: LogInstrumentationScope\n): string {\n  return JSON.stringify([\n    scope.name,\n    scope.version || '',\n    scope.schemaUrl || '',\n    normalizeAnyValue(scope.attributes),\n    // we include the dropped attributes count to avoid collisions between scopes with the same identifying\n    // characteristics, but different dropped counts. While there still can be collisions this is the best we can do if\n    // we want to resolve the same logger without relying on object identity.\n    scope.droppedAttributesCount ?? 0,\n  ]);\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The number of logs submitted to enabled SDK Loggers.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_LOG_CREATED = 'otel.sdk.log.created' as const;\n\n/**\n * The number of log records for which the processing has finished, either successful or failed.\n *\n * @note For successful processing, `error.type` **MUST NOT** be set. For failed processing, `error.type` **MUST** contain the failure cause.\n * For the SDK Simple and Batching Log Record Processor a log record is considered to be processed already when it has been submitted to the exporter,\n * not when the corresponding export call has finished.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_LOG_PROCESSED =\n  'otel.sdk.processor.log.processed' as const;\n\n/**\n * The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold.\n *\n * @note Only applies to Log Record processors which use a queue, e.g. the SDK Batching Log Record Processor.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY =\n  'otel.sdk.processor.log.queue.capacity' as const;\n\n/**\n * The number of log records in the queue of a given instance of an SDK log processor.\n *\n * @note Only applies to log record processors which use a queue, e.g. the SDK Batching Log Record Processor.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_SIZE =\n  'otel.sdk.processor.log.queue.size' as const;\n\n/**\n * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.\n *\n * @example otlp_grpc_span_exporter/0\n * @example custom-name\n *\n * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.\n * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.\n *\n * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.\n * Hereby `otel.component.type` refers to the corresponding attribute value of the component.\n *\n * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.\n * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an\n * instance of the given component type is started.\n *\n * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`\n * as `otel.component.name`, the second one `batching_span_processor/1` and so on.\n * These values will therefore be reused in the case of an application restart.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_NAME = 'otel.component.name' as const;\n\n/**\n * A name identifying the type of the OpenTelemetry component.\n *\n * @example batching_span_processor\n * @example com.example.MySpanExporter\n *\n * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.\n * E.g. for Java the fully qualified classname **SHOULD** be used in this case.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type' as const;\n\n/**\n * Enum value \"batching_log_processor\" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}.\n *\n * The builtin SDK batching log record processor\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const OTEL_COMPONENT_TYPE_VALUE_BATCHING_LOG_PROCESSOR =\n  'batching_log_processor' as const;\n\n/**\n * Enum value \"simple_log_processor\" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}.\n *\n * The builtin SDK simple log record processor\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const OTEL_COMPONENT_TYPE_VALUE_SIMPLE_LOG_PROCESSOR =\n  'simple_log_processor' as const;\n\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n *   - Use a domain-specific attribute\n *   - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Counter, Meter } from '@opentelemetry/api';\nimport { METRIC_OTEL_SDK_LOG_CREATED } from './semconv';\n\n/**\n * Generates `otel.sdk.log.*` metrics.\n * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#log-metrics\n */\nexport class LoggerMetrics {\n  private readonly createdLogs: Counter;\n\n  constructor(meter: Meter) {\n    this.createdLogs = meter.createCounter(METRIC_OTEL_SDK_LOG_CREATED, {\n      unit: '{log_record}',\n      description: 'The number of logs submitted to enabled SDK Loggers.',\n    });\n  }\n\n  emitLog() {\n    this.createdLogs.add(1);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.223.0';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type MeterProvider, createNoopMeter } from '@opentelemetry/api';\nimport type { Logger } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport type { Resource } from '@opentelemetry/resources';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport type { LogRecordProcessor } from '../LogRecordProcessor';\nimport type {\n  LogRecordLimits,\n  LoggerConfig,\n  LoggerConfigurator,\n} from '../types';\nimport { NoopLogRecordProcessor } from '../export/NoopLogRecordProcessor';\nimport { MultiLogRecordProcessor } from '../MultiLogRecordProcessor';\nimport { getInstrumentationScopeKey } from './utils';\nimport { LoggerMetrics } from '../LoggerMetrics';\nimport { VERSION } from '../version';\n\nconst DEFAULT_LOGGER_CONFIG: Required<LoggerConfig> = {\n  disabled: false,\n  minimumSeverity: SeverityNumber.UNSPECIFIED,\n  traceBased: false,\n};\n\n/**\n * Default LoggerConfigurator that returns the default config for all loggers\n */\nexport const DEFAULT_LOGGER_CONFIGURATOR: LoggerConfigurator = () => ({\n  ...DEFAULT_LOGGER_CONFIG,\n});\n\nexport class LoggerProviderSharedState {\n  readonly loggers: Map<string, Logger> = new Map();\n  activeProcessor: LogRecordProcessor;\n  readonly registeredLogRecordProcessors: LogRecordProcessor[] = [];\n  readonly resource: Resource;\n  readonly logRecordLimits: Required<LogRecordLimits>;\n  readonly processors: LogRecordProcessor[];\n  readonly loggerMetrics: LoggerMetrics;\n  hasShutdown = false;\n  private _loggerConfigurator: LoggerConfigurator;\n  private _loggerConfigs: Map<string, Required<LoggerConfig>> = new Map();\n\n  constructor(\n    resource: Resource,\n    logRecordLimits: Required<LogRecordLimits>,\n    processors: LogRecordProcessor[],\n    loggerConfigurator?: LoggerConfigurator,\n    meterProvider?: MeterProvider\n  ) {\n    this.resource = resource;\n    this.logRecordLimits = logRecordLimits;\n    this.processors = processors;\n    if (processors.length > 0) {\n      this.registeredLogRecordProcessors = processors;\n      this.activeProcessor = new MultiLogRecordProcessor(\n        this.registeredLogRecordProcessors\n      );\n    } else {\n      this.activeProcessor = new NoopLogRecordProcessor();\n    }\n\n    this._loggerConfigurator =\n      loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR;\n\n    const meter = meterProvider\n      ? meterProvider.getMeter('@opentelemetry/sdk-logs', VERSION)\n      : createNoopMeter();\n    this.loggerMetrics = new LoggerMetrics(meter);\n  }\n\n  /**\n   * Get the LoggerConfig for a given instrumentation scope.\n   * Uses the LoggerConfigurator function to compute the config on first access\n   * and caches the result.\n   *\n   * @experimental This feature is in development as per the OpenTelemetry specification.\n   */\n  getLoggerConfig(\n    instrumentationScope: InstrumentationScope\n  ): Required<LoggerConfig> {\n    const key = getInstrumentationScopeKey(instrumentationScope);\n\n    // Return cached config if available\n    let config = this._loggerConfigs.get(key);\n    if (config) {\n      return config;\n    }\n\n    // Compute config using the configurator\n    // The configurator always returns a complete config\n    config = this._loggerConfigurator(instrumentationScope);\n\n    // Cache the result\n    this._loggerConfigs.set(key, config);\n\n    return config;\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport type {\n  LoggerProvider as ILoggerProvider,\n  LoggerOptions as ILoggerOptions,\n  Logger as ILogger,\n} from '@opentelemetry/api-logs';\nimport { createNoopLogger } from '@opentelemetry/api-logs';\nimport { defaultResource } from '@opentelemetry/resources';\nimport { BindOnceFuture } from '@opentelemetry/core';\n\nimport type { ForceFlushOptions, LoggerProviderOptions } from './types';\nimport { Logger } from './Logger';\nimport {\n  DEFAULT_LOGGER_CONFIGURATOR,\n  LoggerProviderSharedState,\n} from './internal/LoggerProviderSharedState';\nimport {\n  getInstrumentationScopeKey,\n  type LogInstrumentationScope,\n} from './internal/utils';\nimport { normalizeScopeAttributes } from './utils/validation';\n\nexport const DEFAULT_LOGGER_NAME = 'unknown';\n\nexport class LoggerProvider implements ILoggerProvider {\n  private _shutdownOnce: BindOnceFuture<void>;\n  private readonly _sharedState: LoggerProviderSharedState;\n\n  constructor(config: LoggerProviderOptions = {}) {\n    const mergedConfig = {\n      resource: config.resource ?? defaultResource(),\n      logRecordLimits: {\n        attributeCountLimit: config.logRecordLimits?.attributeCountLimit ?? 128,\n        attributeValueLengthLimit:\n          config.logRecordLimits?.attributeValueLengthLimit ?? Infinity,\n      },\n      loggerConfigurator:\n        config.loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR,\n      processors: config.processors ?? [],\n      meterProvider: config.meterProvider,\n    };\n    this._sharedState = new LoggerProviderSharedState(\n      mergedConfig.resource,\n      mergedConfig.logRecordLimits,\n      mergedConfig.processors,\n      mergedConfig.loggerConfigurator,\n      mergedConfig.meterProvider\n    );\n    this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n  }\n\n  /**\n   * Get a logger with the configuration of the LoggerProvider.\n   */\n  public getLogger(\n    name: string,\n    version?: string,\n    options?: ILoggerOptions\n  ): ILogger {\n    if (this._shutdownOnce.isCalled) {\n      diag.warn('A shutdown LoggerProvider cannot provide a Logger');\n      return createNoopLogger();\n    }\n\n    if (!name) {\n      diag.warn('Logger requested without instrumentation scope name.');\n    }\n    const loggerName = name || DEFAULT_LOGGER_NAME;\n    const instrumentationScope: LogInstrumentationScope = {\n      name: loggerName,\n      version,\n      schemaUrl: options?.schemaUrl,\n      ...normalizeScopeAttributes(\n        this._sharedState.logRecordLimits,\n        options?.attributes\n      ),\n    };\n    const key = getInstrumentationScopeKey(instrumentationScope);\n    if (!this._sharedState.loggers.has(key)) {\n      this._sharedState.loggers.set(\n        key,\n        new Logger(instrumentationScope, this._sharedState)\n      );\n    }\n\n    return this._sharedState.loggers.get(key)!;\n  }\n\n  /**\n   * Notifies all registered LogRecordProcessor to flush any buffered data.\n   *\n   * Returns a promise which is resolved when all flushes are complete.\n   */\n  public forceFlush(options?: ForceFlushOptions): Promise<void> {\n    // do not flush after shutdown\n    if (this._shutdownOnce.isCalled) {\n      diag.warn('invalid attempt to force flush after LoggerProvider shutdown');\n      return this._shutdownOnce.promise;\n    }\n    return this._sharedState.activeProcessor.forceFlush(options);\n  }\n\n  /**\n   * Flush all buffered data and shut down the LoggerProvider and all registered\n   * LogRecordProcessor.\n   *\n   * Returns a promise which is resolved when all flushes are complete.\n   */\n  public shutdown(): Promise<void> {\n    if (this._shutdownOnce.isCalled) {\n      diag.warn('shutdown may only be called once per LoggerProvider');\n      return this._shutdownOnce.promise;\n    }\n    return this._shutdownOnce.call();\n  }\n\n  private _shutdown(): Promise<void> {\n    this._sharedState.hasShutdown = true;\n    return this._sharedState.activeProcessor.shutdown();\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Attributes,\n  Counter,\n  Meter,\n  ObservableCallback,\n  ObservableUpDownCounter,\n} from '@opentelemetry/api';\nimport {\n  ATTR_ERROR_TYPE,\n  ATTR_OTEL_COMPONENT_NAME,\n  ATTR_OTEL_COMPONENT_TYPE,\n  METRIC_OTEL_SDK_PROCESSOR_LOG_PROCESSED,\n  METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY,\n  METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_SIZE,\n} from '../semconv';\n\nconst componentCounter = new Map<string, number>();\n\ninterface QueueConfig {\n  capacity: number;\n  getQueueSize: () => number;\n}\n\nexport class LogRecordProcessorMetrics {\n  private readonly processedLogs: Counter;\n  private readonly queueSize: ObservableUpDownCounter | undefined;\n  private readonly queueSizeCallback: ObservableCallback | undefined;\n\n  private readonly standardAttrs: Attributes;\n  private readonly droppedAttrs: Attributes;\n\n  constructor(componentType: string, meter: Meter, queueConfig?: QueueConfig) {\n    const counter = componentCounter.get(componentType) ?? 0;\n    componentCounter.set(componentType, counter + 1);\n\n    this.standardAttrs = {\n      [ATTR_OTEL_COMPONENT_TYPE]: componentType,\n      [ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}`,\n    };\n\n    this.droppedAttrs = {\n      ...this.standardAttrs,\n      [ATTR_ERROR_TYPE]: 'queue_full',\n    };\n\n    this.processedLogs = meter.createCounter(\n      METRIC_OTEL_SDK_PROCESSOR_LOG_PROCESSED,\n      {\n        unit: '{log_record}',\n        description:\n          'The number of log records for which the processing has finished, either successful or failed.',\n      }\n    );\n\n    if (queueConfig) {\n      const { capacity, getQueueSize } = queueConfig;\n      const queueCapacity = meter.createUpDownCounter(\n        METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY,\n        {\n          unit: '{log_record}',\n          description:\n            'The maximum number of log records the queue of a given instance of an SDK log processor can hold.',\n        }\n      );\n      queueCapacity.add(capacity, this.standardAttrs);\n\n      this.queueSize = meter.createObservableUpDownCounter(\n        METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_SIZE,\n        {\n          unit: '{log_record}',\n          description:\n            'The number of log records in the queue of a given instance of an SDK log processor.',\n        }\n      );\n      this.queueSizeCallback = result =>\n        result.observe(getQueueSize(), this.standardAttrs);\n      this.queueSize.addCallback(this.queueSizeCallback);\n    }\n  }\n\n  dropLogs(count: number) {\n    this.processedLogs.add(count, this.droppedAttrs);\n  }\n\n  finishLogs(count: number, error: Error | undefined) {\n    if (!error) {\n      this.processedLogs.add(count, this.standardAttrs);\n      return;\n    }\n\n    const attrs = {\n      ...this.standardAttrs,\n      [ATTR_ERROR_TYPE]: error.name,\n    };\n    this.processedLogs.add(count, attrs);\n  }\n\n  shutdown() {\n    if (this.queueSize && this.queueSizeCallback) {\n      this.queueSize.removeCallback(this.queueSizeCallback);\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { context, createNoopMeter, diag } from '@opentelemetry/api';\nimport {\n  ExportResultCode,\n  globalErrorHandler,\n  BindOnceFuture,\n  suppressTracing,\n} from '@opentelemetry/core';\n\nimport type { BatchLogRecordProcessorOptions } from '../types';\nimport type { ReadWriteLogRecord } from './ReadWriteLogRecord';\nimport type { LogRecordExporter } from './LogRecordExporter';\nimport type { LogRecordProcessor } from '../LogRecordProcessor';\nimport { LogRecordProcessorMetrics } from './LogRecordProcessorMetrics';\nimport { OTEL_COMPONENT_TYPE_VALUE_BATCHING_LOG_PROCESSOR } from '../semconv';\n\n/**\n * Waits for all pending async resources in the log records to be resolved.\n */\nasync function waitForResources(\n  logRecords: ReadWriteLogRecord[]\n): Promise<void> {\n  const pendingResources: Array<Promise<void>> = [];\n  for (let i = 0, len = logRecords.length; i < len; i++) {\n    const logRecord = logRecords[i];\n    if (\n      logRecord.resource.asyncAttributesPending &&\n      logRecord.resource.waitForAsyncAttributes\n    ) {\n      pendingResources.push(logRecord.resource.waitForAsyncAttributes());\n    }\n  }\n\n  if (pendingResources != null && pendingResources.length > 0) {\n    await Promise.all(pendingResources);\n  }\n}\n\n/**\n * Represents an export operation that handles the entire export workflow.\n */\nclass ExportOperation {\n  private readonly _exportCompleted: Promise<void>;\n  private readonly _exportScheduledPromise: Promise<void>;\n  private readonly _metrics: LogRecordProcessorMetrics;\n  private _exportScheduledResolve!: () => void;\n\n  constructor(\n    exporter: LogRecordExporter,\n    logRecords: ReadWriteLogRecord[],\n    exportTimeoutMillis: number,\n    metrics: LogRecordProcessorMetrics\n  ) {\n    this._exportScheduledPromise = new Promise<void>(resolve => {\n      this._exportScheduledResolve = resolve;\n    });\n    this._exportCompleted = this._executeExport(\n      exporter,\n      logRecords,\n      exportTimeoutMillis\n    );\n    this._metrics = metrics;\n  }\n\n  /** Get the promise that resolves when the export completes */\n  get exportCompleted(): Promise<void> {\n    return this._exportCompleted;\n  }\n\n  /** Get the promise that resolves when exporter.export() has been called */\n  get exportScheduled(): Promise<void> {\n    return this._exportScheduledPromise;\n  }\n\n  private async _executeExport(\n    exporter: LogRecordExporter,\n    logRecords: ReadWriteLogRecord[],\n    exportTimeoutMillis: number\n  ): Promise<void> {\n    try {\n      // Wait for all pending resources before exporting\n      await waitForResources(logRecords);\n\n      // Export with timeout, wrapped in suppressTracing context\n      await context.with(suppressTracing(context.active()), async () => {\n        return this._exportWithTimeout(\n          exporter,\n          logRecords,\n          exportTimeoutMillis\n        );\n      });\n    } catch (e) {\n      // ensure we never reject here, as we may call await after it has already resolved.\n      globalErrorHandler(e);\n      // resolve, as the error may have occurred before export was scheduled\n      this._exportScheduledResolve();\n    }\n  }\n\n  private async _exportWithTimeout(\n    exporter: LogRecordExporter,\n    logRecords: ReadWriteLogRecord[],\n    exportTimeoutMillis: number\n  ): Promise<void> {\n    return new Promise<void>((resolve, reject) => {\n      const timer = setTimeout(() => {\n        reject(new Error('Timeout'));\n      }, exportTimeoutMillis);\n\n      // Call exporter.export() and immediately resolve exportScheduled\n      exporter.export(logRecords, result => {\n        this._metrics.finishLogs(logRecords.length, result.error);\n        clearTimeout(timer);\n        if (result.code === ExportResultCode.SUCCESS) {\n          resolve();\n        } else {\n          reject(\n            result.error ??\n              new Error('BatchLogRecordProcessor: log record export failed')\n          );\n        }\n      });\n\n      // Resolve exportScheduled immediately after calling exporter.export()\n      this._exportScheduledResolve();\n    });\n  }\n}\n\nexport abstract class BatchLogRecordProcessorBase<\n  T extends BatchLogRecordProcessorOptions,\n> implements LogRecordProcessor\n{\n  private readonly _maxExportBatchSize: number;\n  private readonly _maxQueueSize: number;\n  private readonly _scheduledDelayMillis: number;\n  private readonly _exportTimeoutMillis: number;\n  private readonly _exporter: LogRecordExporter;\n  private readonly _metrics: LogRecordProcessorMetrics;\n\n  private _currentExport: ExportOperation | null = null;\n  private _finishedLogRecords: ReadWriteLogRecord[] = [];\n  private _timer: NodeJS.Timeout | number | undefined;\n  private _shutdownOnce: BindOnceFuture<void>;\n  private _flushing: boolean = false;\n\n  constructor(options: T) {\n    this._exporter = options.exporter;\n    this._maxExportBatchSize = options.maxExportBatchSize ?? 512;\n    this._maxQueueSize = options.maxQueueSize ?? 2048;\n    this._scheduledDelayMillis = options.scheduledDelayMillis ?? 1000;\n    this._exportTimeoutMillis = options.exportTimeoutMillis ?? 30000;\n\n    this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n\n    if (this._maxExportBatchSize > this._maxQueueSize) {\n      diag.warn(\n        'BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize'\n      );\n      this._maxExportBatchSize = this._maxQueueSize;\n    }\n\n    const meter = options?.selfObsMeterProvider\n      ? options.selfObsMeterProvider.getMeter('@opentelemetry/sdk-logs')\n      : createNoopMeter();\n\n    this._metrics = new LogRecordProcessorMetrics(\n      OTEL_COMPONENT_TYPE_VALUE_BATCHING_LOG_PROCESSOR,\n      meter,\n      {\n        capacity: this._maxQueueSize,\n        getQueueSize: () => this._finishedLogRecords.length,\n      }\n    );\n  }\n\n  public onEmit(logRecord: ReadWriteLogRecord): void {\n    if (this._shutdownOnce.isCalled) {\n      return;\n    }\n    this._addToBuffer(logRecord);\n  }\n\n  public forceFlush(): Promise<void> {\n    if (this._shutdownOnce.isCalled) {\n      return this._shutdownOnce.promise;\n    }\n    return this._flushAll();\n  }\n\n  /** Add a LogRecord in the buffer. */\n  private _addToBuffer(logRecord: ReadWriteLogRecord) {\n    if (this._finishedLogRecords.length >= this._maxQueueSize) {\n      this._metrics.dropLogs(1);\n      return;\n    }\n    this._finishedLogRecords.push(logRecord);\n    this._maybeStartTimer();\n  }\n\n  public shutdown(): Promise<void> {\n    return this._shutdownOnce.call();\n  }\n\n  private async _shutdown(): Promise<void> {\n    this.onShutdown();\n    await this._flushAll();\n    this._metrics.shutdown();\n    await this._exporter.shutdown();\n  }\n\n  /**\n   * Send all LogRecords to the exporter respecting the batch size limit\n   * This function is used only on forceFlush or shutdown,\n   * for all other cases _exportOneBatch should be used\n   * */\n  private async _flushAll(): Promise<void> {\n    // Guard against concurrent flushes. Concurrent .forceFlush() calls will\n    // return without waiting for the in-progress flush to finish.\n    if (this._flushing) {\n      return;\n    }\n    this._flushing = true;\n\n    // Grab the current set of finished log records, because the spec says:\n    // > ... for which the LogRecordProcessor had already received events prior to the call to ForceFlush ...\n    let toFlush = this._finishedLogRecords;\n    this._finishedLogRecords = [];\n\n    // Clear timer to prevent concurrent exports\n    this._clearTimer();\n\n    // Wait for any in-progress export to complete. Capture the reference\n    // into a local because `_exportOneBatch` may null out `this._currentExport`\n    // from its completion handler while we are awaiting below.\n    const inFlight = this._currentExport;\n    if (inFlight !== null) {\n      // speed up execution for current export\n      await this._exporter.forceFlush();\n      await inFlight.exportCompleted;\n      this._currentExport = null;\n    }\n\n    // Now flush all batches sequentially to avoid race conditions\n    while (toFlush.length > 0) {\n      let batch;\n      if (toFlush.length <= this._maxExportBatchSize) {\n        batch = toFlush;\n        toFlush = [];\n      } else {\n        batch = toFlush.splice(0, this._maxExportBatchSize);\n      }\n\n      const exportOp = new ExportOperation(\n        this._exporter,\n        batch,\n        this._exportTimeoutMillis,\n        this._metrics\n      );\n      this._currentExport = exportOp;\n\n      // await export scheduled, then force flush exporter to speed up export\n      try {\n        await exportOp.exportScheduled;\n        await this._exporter.forceFlush();\n        await exportOp.exportCompleted;\n      } catch (e) {\n        globalErrorHandler(e);\n      } finally {\n        this._currentExport = null;\n      }\n    }\n\n    this._flushing = false;\n    this._maybeStartTimer();\n  }\n\n  /**\n   * Extracts one batch from the buffer.\n   * Returns null if buffer is empty.\n   */\n  private _extractBatch(): ReadWriteLogRecord[] | null {\n    if (this._finishedLogRecords.length === 0) {\n      return null;\n    }\n\n    if (this._finishedLogRecords.length <= this._maxExportBatchSize) {\n      const batch = this._finishedLogRecords;\n      this._finishedLogRecords = [];\n      return batch;\n    } else {\n      return this._finishedLogRecords.splice(0, this._maxExportBatchSize);\n    }\n  }\n\n  private _exportOneBatch(): void {\n    this._clearTimer();\n\n    const logRecords = this._extractBatch();\n    if (logRecords === null) {\n      return;\n    }\n\n    const exportOp = new ExportOperation(\n      this._exporter,\n      logRecords,\n      this._exportTimeoutMillis,\n      this._metrics\n    );\n    this._currentExport = exportOp;\n\n    // Handle completion asynchronously\n    exportOp.exportCompleted\n      .then(() => {\n        this._currentExport = null;\n        this._maybeStartTimer();\n      })\n      .catch(error => {\n        this._currentExport = null;\n        globalErrorHandler(error);\n        this._maybeStartTimer();\n      });\n  }\n\n  private _maybeStartTimer() {\n    if (this._shutdownOnce.isCalled) {\n      return;\n    }\n\n    if (this._flushing) {\n      return;\n    }\n\n    if (this._finishedLogRecords.length === 0) {\n      return;\n    }\n\n    if (this._currentExport !== null) {\n      return;\n    }\n\n    // If batch is full, export immediately\n    if (this._finishedLogRecords.length >= this._maxExportBatchSize) {\n      this._exportOneBatch();\n      return;\n    }\n\n    // If timer is already set, don't set another one\n    if (this._timer !== undefined) {\n      return;\n    }\n\n    // Set timer for scheduled export\n    this._timer = setTimeout(() => {\n      this._timer = undefined;\n      this._exportOneBatch();\n    }, this._scheduledDelayMillis);\n\n    // Unref timer so it doesn't keep process alive\n    if (typeof this._timer !== 'number') {\n      this._timer.unref();\n    }\n  }\n\n  private _clearTimer() {\n    if (this._timer !== undefined) {\n      clearTimeout(this._timer);\n      this._timer = undefined;\n    }\n  }\n\n  protected abstract onShutdown(): void;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { BatchLogRecordProcessorBrowserOptions } from '../../../types';\nimport { BatchLogRecordProcessorBase } from '../../../export/BatchLogRecordProcessorBase';\n\nexport class BatchLogRecordProcessor extends BatchLogRecordProcessorBase<BatchLogRecordProcessorBrowserOptions> {\n  private _visibilityChangeListener?: () => void;\n  private _pageHideListener?: () => void;\n\n  constructor(options: BatchLogRecordProcessorBrowserOptions) {\n    super(options);\n    this._onInit(options);\n  }\n\n  protected onShutdown(): void {\n    if (typeof document === 'undefined') {\n      return;\n    }\n    if (this._visibilityChangeListener) {\n      document.removeEventListener(\n        'visibilitychange',\n        this._visibilityChangeListener\n      );\n    }\n    if (this._pageHideListener) {\n      document.removeEventListener('pagehide', this._pageHideListener);\n    }\n  }\n\n  private _onInit(options: BatchLogRecordProcessorBrowserOptions): void {\n    if (\n      options.disableAutoFlushOnDocumentHide === true ||\n      typeof document === 'undefined'\n    ) {\n      return;\n    }\n    this._visibilityChangeListener = () => {\n      if (document.visibilityState === 'hidden') {\n        void this.forceFlush();\n      }\n    };\n    this._pageHideListener = () => {\n      void this.forceFlush();\n    };\n    document.addEventListener(\n      'visibilitychange',\n      this._visibilityChangeListener\n    );\n\n    // use 'pagehide' event as a fallback for Safari; see https://bugs.webkit.org/show_bug.cgi?id=116769\n    document.addEventListener('pagehide', this._pageHideListener);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Event name definitions\nexport const ExceptionEventName = 'exception';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes, AttributeValue } from '@opentelemetry/api';\nimport type { Resource } from '@opentelemetry/resources';\n\n/**\n * Well-known symbol used by Node.js `util.inspect` (and `console.*`) to\n * render an object via a custom representation. Defined as a global Symbol\n * so it works without importing from `node:util`, keeping this module safe\n * for browser builds (where the symbol is simply never looked up).\n */\nexport const inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n\n/**\n * Collect a Resource's settled attributes without touching the\n * `attributes` getter, which emits diag.error/debug entries when async\n * attribute detectors are still pending. Promise-like (unsettled)\n * entries are silently skipped so logging a Span/Tracer/Provider during\n * startup doesn't recurse through the diag pipeline.\n */\nexport function settledResourceAttributes(resource: Resource): Attributes {\n  const attrs: Attributes = {};\n  for (const [k, v] of resource.getRawAttributes()) {\n    if (typeof (v as Partial<PromiseLike<unknown>>)?.then === 'function') {\n      continue;\n    }\n    if (v != null) {\n      attrs[k] ??= v as AttributeValue;\n    }\n  }\n  return attrs;\n}\n\nexport type InspectFn = (value: unknown, options: unknown) => string;\n\nexport interface InspectStylizeOptions {\n  depth?: number | null;\n  stylize?: (text: string, styleType: string) => string;\n}\n\n/**\n * Build a class-tagged inspect representation. Returns a stub like\n * `[ClassName]` once the recursion budget is exhausted, otherwise returns\n * `ClassName <inspected payload>` so nested fields keep proper coloring,\n * indentation, and depth handling. In environments that don't supply an\n * `inspect` callback (e.g. browsers), falls back to returning the raw\n * payload object.\n */\nexport function formatInspect(\n  className: string,\n  payload: object,\n  depth: number,\n  options: InspectStylizeOptions | undefined,\n  inspect: InspectFn | undefined\n): unknown {\n  if (typeof depth === 'number' && depth < 0) {\n    const tag = `[${className}]`;\n    return options?.stylize ? options.stylize(tag, 'special') : tag;\n  }\n  if (typeof inspect !== 'function' || !options) {\n    return payload;\n  }\n  const childOptions = {\n    ...options,\n    depth: options.depth == null ? options.depth : options.depth - 1,\n  };\n  return `${className} ${inspect(payload, childOptions)}`;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Context,\n  Exception,\n  HrTime,\n  Link,\n  Span as APISpan,\n  SpanOptions as APISpanOptions,\n  Attributes,\n  AttributeValue,\n  SpanContext,\n  SpanKind,\n  SpanStatus,\n  TimeInput,\n} from '@opentelemetry/api';\nimport { diag, SpanStatusCode } from '@opentelemetry/api';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport {\n  addHrTimes,\n  millisToHrTime,\n  hrTime,\n  hrTimeDuration,\n  isAttributeValue,\n  isTimeInput,\n  isTimeInputHrTime,\n  otperformance,\n  sanitizeAttributes,\n} from '@opentelemetry/core';\nimport type { Resource } from '@opentelemetry/resources';\nimport {\n  ATTR_EXCEPTION_MESSAGE,\n  ATTR_EXCEPTION_STACKTRACE,\n  ATTR_EXCEPTION_TYPE,\n} from '@opentelemetry/semantic-conventions';\nimport type { ReadableSpan } from './export/ReadableSpan';\nimport { ExceptionEventName } from './enums';\nimport type { SpanProcessor } from './SpanProcessor';\nimport type { TimedEvent } from './TimedEvent';\nimport type { SpanLimits } from './types';\nimport type { InspectFn, InspectStylizeOptions } from './inspect';\nimport {\n  formatInspect,\n  inspectCustom,\n  settledResourceAttributes,\n} from './inspect';\n\n/**\n * This type provides the properties of @link{ReadableSpan} at the same time\n * of the Span API\n */\nexport type Span = APISpan & ReadableSpan;\n\n// `root` is omitted because it is consumed by Tracer.startSpan() to strip\n// parent context but it has no meaning when constructing a Span directly.\ntype SpanOptions = Omit<APISpanOptions, 'root'> & {\n  resource: Resource;\n  scope: InstrumentationScope;\n  context: Context;\n  spanContext: SpanContext;\n  name: string;\n  // Required here to override optional `kind` from the API's SpanOptions\n  // SpanImpl assigns it unconditionally and ReadableSpan expects it to be set.\n  kind: SpanKind;\n  parentSpanContext?: SpanContext;\n  spanLimits: SpanLimits;\n  spanProcessor: SpanProcessor;\n  recordEndMetrics?: () => void;\n};\n\n/**\n * This class represents a span.\n */\nexport class SpanImpl implements Span {\n  // Below properties are included to implement ReadableSpan for export\n  // purposes but are not intended to be written-to directly.\n  private readonly _spanContext: SpanContext;\n  readonly kind: SpanKind;\n  readonly parentSpanContext?: SpanContext;\n  readonly attributes: Attributes = {};\n  readonly links: Link[] = [];\n  readonly events: TimedEvent[] = [];\n  readonly startTime: HrTime;\n  readonly resource: Resource;\n  readonly instrumentationScope: InstrumentationScope;\n\n  private _droppedAttributesCount = 0;\n  private _droppedEventsCount: number = 0;\n  private _droppedLinksCount: number = 0;\n  private _attributesCount: number = 0;\n\n  name: string;\n  status: SpanStatus = {\n    code: SpanStatusCode.UNSET,\n  };\n  endTime: HrTime = [0, 0];\n  private _ended = false;\n  private _duration: HrTime = [-1, -1];\n  private readonly _spanProcessor: SpanProcessor;\n  private readonly _spanLimits: SpanLimits;\n  private readonly _attributeValueLengthLimit: number;\n  private readonly _recordEndMetrics?: () => void;\n\n  private readonly _performanceStartTime: number;\n  private readonly _performanceOffset: number;\n  private readonly _startTimeProvided: boolean;\n\n  /**\n   * Constructs a new SpanImpl instance.\n   */\n  constructor(opts: SpanOptions) {\n    const now = Date.now();\n\n    this._spanContext = opts.spanContext;\n    this._performanceStartTime = otperformance.now();\n    this._performanceOffset =\n      now - (this._performanceStartTime + otperformance.timeOrigin);\n    this._startTimeProvided = opts.startTime != null;\n    this._spanLimits = opts.spanLimits;\n    this._attributeValueLengthLimit =\n      this._spanLimits.attributeValueLengthLimit ?? 0;\n    this._spanProcessor = opts.spanProcessor;\n\n    this.name = opts.name;\n    this.parentSpanContext = opts.parentSpanContext;\n    this.kind = opts.kind;\n    if (opts.links) {\n      for (const link of opts.links) {\n        this.addLink(link);\n      }\n    }\n    this.startTime = this._getTime(opts.startTime ?? now);\n    this.resource = opts.resource;\n    this.instrumentationScope = opts.scope;\n    this._recordEndMetrics = opts.recordEndMetrics;\n\n    if (opts.attributes != null) {\n      this.setAttributes(opts.attributes);\n    }\n\n    this._spanProcessor.onStart(this, opts.context);\n  }\n\n  spanContext(): SpanContext {\n    return this._spanContext;\n  }\n\n  setAttribute(key: string, value?: AttributeValue): this;\n  setAttribute(key: string, value: unknown): this {\n    if (value == null || this._isSpanEnded()) return this;\n    if (key.length === 0) {\n      diag.warn(`Invalid attribute key: ${key}`);\n      return this;\n    }\n    if (!isAttributeValue(value)) {\n      diag.warn(`Invalid attribute value set for key: ${key}`);\n      return this;\n    }\n\n    const { attributeCountLimit } = this._spanLimits;\n    const isNewKey = !Object.prototype.hasOwnProperty.call(\n      this.attributes,\n      key\n    );\n\n    if (\n      attributeCountLimit !== undefined &&\n      this._attributesCount >= attributeCountLimit &&\n      isNewKey\n    ) {\n      this._droppedAttributesCount++;\n      return this;\n    }\n\n    this.attributes[key] = this._truncateToSize(value);\n    if (isNewKey) {\n      this._attributesCount++;\n    }\n    return this;\n  }\n\n  setAttributes(attributes: Attributes): this {\n    for (const key in attributes) {\n      if (Object.prototype.hasOwnProperty.call(attributes, key)) {\n        this.setAttribute(key, attributes[key]);\n      }\n    }\n    return this;\n  }\n\n  /**\n   *\n   * @param name Span Name\n   * @param [attributesOrStartTime] Span attributes or start time\n   *     if type is {@type TimeInput} and 3rd param is undefined\n   * @param [timeStamp] Specified time stamp for the event\n   */\n  addEvent(\n    name: string,\n    attributesOrStartTime?: Attributes | TimeInput,\n    timeStamp?: TimeInput\n  ): this {\n    if (this._isSpanEnded()) return this;\n\n    const { eventCountLimit } = this._spanLimits;\n\n    if (eventCountLimit === 0) {\n      diag.warn('No events allowed.');\n      this._droppedEventsCount++;\n      return this;\n    }\n\n    if (\n      eventCountLimit !== undefined &&\n      this.events.length >= eventCountLimit\n    ) {\n      if (this._droppedEventsCount === 0) {\n        diag.debug('Dropping extra events.');\n      }\n      this.events.shift();\n      this._droppedEventsCount++;\n    }\n\n    if (isTimeInput(attributesOrStartTime)) {\n      if (!isTimeInput(timeStamp)) {\n        timeStamp = attributesOrStartTime;\n      }\n      attributesOrStartTime = undefined;\n    }\n\n    const sanitized = sanitizeAttributes(attributesOrStartTime);\n    const { attributePerEventCountLimit } = this._spanLimits;\n    const attributes: Attributes = {};\n    let droppedAttributesCount = 0;\n    let eventAttributesCount = 0;\n\n    for (const attr in sanitized) {\n      if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n        continue;\n      }\n      const attrVal = sanitized[attr];\n      if (\n        attributePerEventCountLimit !== undefined &&\n        eventAttributesCount >= attributePerEventCountLimit\n      ) {\n        droppedAttributesCount++;\n        continue;\n      }\n      attributes[attr] = this._truncateToSize(attrVal!);\n      eventAttributesCount++;\n    }\n\n    this.events.push({\n      name,\n      attributes,\n      time: this._getTime(timeStamp),\n      droppedAttributesCount,\n    });\n    return this;\n  }\n\n  addLink(link: Link): this {\n    if (this._isSpanEnded()) return this;\n\n    const { linkCountLimit } = this._spanLimits;\n\n    if (linkCountLimit === 0) {\n      this._droppedLinksCount++;\n      return this;\n    }\n\n    if (linkCountLimit !== undefined && this.links.length >= linkCountLimit) {\n      if (this._droppedLinksCount === 0) {\n        diag.debug('Dropping extra links.');\n      }\n      this.links.shift();\n      this._droppedLinksCount++;\n    }\n\n    const { attributePerLinkCountLimit } = this._spanLimits;\n    const sanitized = sanitizeAttributes(link.attributes);\n    const attributes: Attributes = {};\n    let droppedAttributesCount = 0;\n    let linkAttributesCount = 0;\n\n    for (const attr in sanitized) {\n      if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n        continue;\n      }\n      const attrVal = sanitized[attr];\n      if (\n        attributePerLinkCountLimit !== undefined &&\n        linkAttributesCount >= attributePerLinkCountLimit\n      ) {\n        droppedAttributesCount++;\n        continue;\n      }\n      attributes[attr] = this._truncateToSize(attrVal!);\n      linkAttributesCount++;\n    }\n\n    const processedLink: Link = { context: link.context };\n    if (linkAttributesCount > 0) {\n      processedLink.attributes = attributes;\n    }\n    if (droppedAttributesCount > 0) {\n      processedLink.droppedAttributesCount = droppedAttributesCount;\n    }\n\n    this.links.push(processedLink);\n    return this;\n  }\n\n  addLinks(links: Link[]): this {\n    for (const link of links) {\n      this.addLink(link);\n    }\n    return this;\n  }\n\n  setStatus(status: SpanStatus): this {\n    if (this._isSpanEnded()) return this;\n    if (status.code === SpanStatusCode.UNSET) return this;\n    if (this.status.code === SpanStatusCode.OK) return this;\n\n    const newStatus: SpanStatus = { code: status.code };\n\n    // When using try-catch, the caught \"error\" is of type `any`. When then assigning `any` to `status.message`,\n    // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus()\n    // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or\n    // undefined to avoid an incorrect type causing issues downstream.\n    if (status.code === SpanStatusCode.ERROR) {\n      if (typeof status.message === 'string') {\n        newStatus.message = status.message;\n      } else if (status.message != null) {\n        diag.warn(\n          `Dropping invalid status.message of type '${typeof status.message}', expected 'string'`\n        );\n      }\n    }\n\n    this.status = newStatus;\n    return this;\n  }\n\n  updateName(name: string): this {\n    if (this._isSpanEnded()) return this;\n    this.name = name;\n    return this;\n  }\n\n  end(endTime?: TimeInput): void {\n    if (this._isSpanEnded()) {\n      diag.error(\n        `${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`\n      );\n      return;\n    }\n    this.endTime = this._getTime(endTime);\n    this._duration = hrTimeDuration(this.startTime, this.endTime);\n\n    if (this._duration[0] < 0) {\n      diag.warn(\n        'Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.',\n        this.startTime,\n        this.endTime\n      );\n      this.endTime = this.startTime.slice() as HrTime;\n      this._duration = [0, 0];\n    }\n\n    if (this._droppedEventsCount > 0) {\n      diag.warn(\n        `Dropped ${this._droppedEventsCount} events because eventCountLimit reached`\n      );\n    }\n    if (this._droppedLinksCount > 0) {\n      diag.warn(\n        `Dropped ${this._droppedLinksCount} links because linkCountLimit reached`\n      );\n    }\n    if (this._spanProcessor.onEnding) {\n      this._spanProcessor.onEnding(this);\n    }\n\n    this._recordEndMetrics?.();\n    this._ended = true;\n    this._spanProcessor.onEnd(this);\n  }\n\n  private _getTime(inp?: TimeInput): HrTime {\n    if (typeof inp === 'number' && inp <= otperformance.now()) {\n      // must be a performance timestamp\n      // apply correction and convert to hrtime\n      return hrTime(inp + this._performanceOffset);\n    }\n\n    if (typeof inp === 'number') {\n      return millisToHrTime(inp);\n    }\n\n    if (inp instanceof Date) {\n      return millisToHrTime(inp.getTime());\n    }\n\n    if (isTimeInputHrTime(inp)) {\n      return inp;\n    }\n\n    if (this._startTimeProvided) {\n      // if user provided a time for the start manually\n      // we can't use duration to calculate event/end times\n      return millisToHrTime(Date.now());\n    }\n\n    const msDuration = otperformance.now() - this._performanceStartTime;\n    return addHrTimes(this.startTime, millisToHrTime(msDuration));\n  }\n\n  isRecording(): boolean {\n    return this._ended === false;\n  }\n\n  recordException(exception: Exception, time?: TimeInput): void {\n    const attributes: Attributes = {};\n    if (typeof exception === 'string') {\n      attributes[ATTR_EXCEPTION_MESSAGE] = exception;\n    } else if (exception) {\n      if (exception.code) {\n        attributes[ATTR_EXCEPTION_TYPE] = exception.code.toString();\n      } else if (exception.name) {\n        attributes[ATTR_EXCEPTION_TYPE] = exception.name;\n      }\n      if (exception.message) {\n        attributes[ATTR_EXCEPTION_MESSAGE] = exception.message;\n      }\n      if (exception.stack) {\n        attributes[ATTR_EXCEPTION_STACKTRACE] = exception.stack;\n      }\n    }\n\n    // these are minimum requirements from spec\n    if (attributes[ATTR_EXCEPTION_TYPE] || attributes[ATTR_EXCEPTION_MESSAGE]) {\n      this.addEvent(ExceptionEventName, attributes, time);\n    } else {\n      diag.warn(`Failed to record an exception ${exception}`);\n    }\n  }\n\n  get duration(): HrTime {\n    return this._duration;\n  }\n\n  get ended(): boolean {\n    return this._ended;\n  }\n\n  get droppedAttributesCount(): number {\n    return this._droppedAttributesCount;\n  }\n\n  get droppedEventsCount(): number {\n    return this._droppedEventsCount;\n  }\n\n  get droppedLinksCount(): number {\n    return this._droppedLinksCount;\n  }\n\n  private _isSpanEnded(): boolean {\n    if (this._ended) {\n      const error = new Error(\n        `Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`\n      );\n\n      diag.warn(\n        `Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,\n        error\n      );\n    }\n    return this._ended;\n  }\n\n  // Utility function to truncate given value within size\n  // for value type of string, will truncate to given limit\n  // for type of non-string, will return same value\n  private _truncateToLimitUtil(value: string, limit: number): string {\n    if (value.length <= limit) {\n      return value;\n    }\n    return value.substring(0, limit);\n  }\n\n  /**\n   * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then\n   * return string with truncated to {@code attributeValueLengthLimit} characters\n   *\n   * If the given attribute value is array of strings then\n   * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters\n   *\n   * Otherwise return same Attribute {@code value}\n   *\n   * @param value Attribute value\n   * @returns truncated attribute value if required, otherwise same value\n   */\n  private _truncateToSize(value: AttributeValue): AttributeValue {\n    const limit = this._attributeValueLengthLimit;\n    // Check limit\n    if (limit <= 0) {\n      // Negative values are invalid, so do not truncate\n      diag.warn(`Attribute value limit must be positive, got ${limit}`);\n      return value;\n    }\n\n    // String\n    if (typeof value === 'string') {\n      return this._truncateToLimitUtil(value, limit);\n    }\n\n    // Array of strings\n    if (Array.isArray(value)) {\n      return (value as []).map(val =>\n        typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val\n      );\n    }\n\n    // Other types, no need to apply value length limit\n    return value;\n  }\n\n  [inspectCustom](\n    depth: number,\n    options: InspectStylizeOptions | undefined,\n    inspect: InspectFn | undefined\n  ): unknown {\n    const payload = {\n      name: this.name,\n      kind: this.kind,\n      spanContext: this._spanContext,\n      parentSpanContext: this.parentSpanContext,\n      status: this.status,\n      startTime: this.startTime,\n      endTime: this.endTime,\n      duration: this._duration,\n      ended: this._ended,\n      attributes: this.attributes,\n      events: this.events,\n      links: this.links,\n      droppedAttributesCount: this._droppedAttributesCount,\n      droppedEventsCount: this._droppedEventsCount,\n      droppedLinksCount: this._droppedLinksCount,\n      instrumentationScope: this.instrumentationScope,\n      resource: { attributes: settledResourceAttributes(this.resource) },\n    };\n    return formatInspect('SpanImpl', payload, depth, options, inspect);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Context,\n  Link,\n  Attributes,\n  SpanKind,\n  TraceState,\n} from '@opentelemetry/api';\n\n/**\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nexport enum SamplingDecision {\n  /**\n   * `Span.isRecording() === false`, span will not be recorded and all events\n   * and attributes will be dropped.\n   */\n  NOT_RECORD,\n  /**\n   * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n   * MUST NOT be set.\n   */\n  RECORD,\n  /**\n   * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n   * MUST be set.\n   */\n  RECORD_AND_SAMPLED,\n}\n\n/**\n * A sampling result contains a decision for a {@link Span} and additional\n * attributes the sampler would like to added to the Span.\n */\nexport interface SamplingResult {\n  /**\n   * A sampling decision, refer to {@link SamplingDecision} for details.\n   */\n  decision: SamplingDecision;\n  /**\n   * The list of attributes returned by SamplingResult MUST be immutable.\n   * Caller may call {@link Sampler}.shouldSample any number of times and\n   * can safely cache the returned value.\n   */\n  attributes?: Readonly<Attributes>;\n  /**\n   * A {@link TraceState} that will be associated with the {@link Span} through\n   * the new {@link SpanContext}. Samplers SHOULD return the TraceState from\n   * the passed-in {@link Context} if they do not intend to change it. Leaving\n   * the value undefined will also leave the TraceState unchanged.\n   */\n  traceState?: TraceState;\n}\n\n/**\n * This interface represent a sampler. Sampling is a mechanism to control the\n * noise and overhead introduced by OpenTelemetry by reducing the number of\n * samples of traces collected and sent to the backend.\n */\nexport interface Sampler {\n  /**\n   * Checks whether span needs to be created and tracked.\n   *\n   * @param context Parent Context which may contain a span.\n   * @param traceId of the span to be created. It can be different from the\n   *     traceId in the {@link SpanContext}. Typically in situations when the\n   *     span to be created starts a new trace.\n   * @param spanName of the span to be created.\n   * @param spanKind of the span to be created.\n   * @param attributes Initial set of Attributes for the Span being constructed.\n   * @param links Collection of links that will be associated with the Span to\n   *     be created. Typically useful for batch operations.\n   * @returns a {@link SamplingResult}.\n   */\n  shouldSample(\n    context: Context,\n    traceId: string,\n    spanName: string,\n    spanKind: SpanKind,\n    attributes: Attributes,\n    links: Link[]\n  ): SamplingResult;\n\n  /** Returns the sampler name or short description with the configuration. */\n  toString(): string;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.\n *\n * @example otlp_grpc_span_exporter/0\n * @example custom-name\n *\n * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.\n * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.\n *\n * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.\n * Hereby `otel.component.type` refers to the corresponding attribute value of the component.\n *\n * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.\n * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an\n * instance of the given component type is started.\n *\n * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`\n * as `otel.component.name`, the second one `batching_span_processor/1` and so on.\n * These values will therefore be reused in the case of an application restart.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_NAME = 'otel.component.name' as const;\n\n/**\n * A name identifying the type of the OpenTelemetry component.\n *\n * @example batching_span_processor\n * @example com.example.MySpanExporter\n *\n * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.\n * E.g. for Java the fully qualified classname **SHOULD** be used in this case.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type' as const;\n\n/**\n * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_PARENT_ORIGIN = 'otel.span.parent.origin' as const;\n\n/**\n * The result value of the sampler for this span\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_SAMPLING_RESULT =\n  'otel.span.sampling_result' as const;\n\n/**\n * The number of spans for which the processing has finished, either successful or failed.\n *\n * @note For successful processing, `error.type` **MUST NOT** be set. For failed processing, `error.type` **MUST** contain the failure cause.\n * For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED =\n  'otel.sdk.processor.span.processed' as const;\n\n/**\n * The maximum number of spans the queue of a given instance of an SDK span processor can hold.\n *\n * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY =\n  'otel.sdk.processor.span.queue.capacity' as const;\n\n/**\n * The number of spans in the queue of a given instance of an SDK span processor.\n *\n * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE =\n  'otel.sdk.processor.span.queue.size' as const;\n\n/**\n * The number of created spans with `recording=true` for which the end operation has not been called yet.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_LIVE = 'otel.sdk.span.live' as const;\n\n/**\n * The number of created spans.\n *\n * @note Implementations **MUST** record this metric for all spans, even for non-recording ones.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_STARTED = 'otel.sdk.span.started' as const;\n\n/**\n * Enum value \"batching_span_processor\" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}.\n *\n * The builtin SDK batching span processor\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR =\n  'batching_span_processor' as const;\n\n/**\n * Enum value \"simple_span_processor\" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}.\n *\n * The builtin SDK simple span processor\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR =\n  'simple_span_processor' as const;\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type {\n  Counter,\n  Meter,\n  SpanContext,\n  UpDownCounter,\n} from '@opentelemetry/api';\nimport { SamplingDecision } from './Sampler';\nimport {\n  ATTR_OTEL_SPAN_PARENT_ORIGIN,\n  ATTR_OTEL_SPAN_SAMPLING_RESULT,\n  METRIC_OTEL_SDK_SPAN_LIVE,\n  METRIC_OTEL_SDK_SPAN_STARTED,\n} from './semconv';\n\n/**\n * Generates `otel.sdk.span.*` metrics.\n * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics\n */\nexport class TracerMetrics {\n  private readonly startedSpans: Counter;\n  private readonly liveSpans: UpDownCounter;\n\n  constructor(meter: Meter) {\n    this.startedSpans = meter.createCounter(METRIC_OTEL_SDK_SPAN_STARTED, {\n      unit: '{span}',\n      description: 'The number of created spans.',\n    });\n\n    this.liveSpans = meter.createUpDownCounter(METRIC_OTEL_SDK_SPAN_LIVE, {\n      unit: '{span}',\n      description: 'The number of currently live spans.',\n    });\n  }\n\n  startSpan(\n    parentSpanCtx: SpanContext | undefined,\n    samplingDecision: SamplingDecision\n  ): () => void {\n    const samplingDecisionStr = samplingDecisionToString(samplingDecision);\n    this.startedSpans.add(1, {\n      [ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx),\n      [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n    });\n\n    if (samplingDecision === SamplingDecision.NOT_RECORD) {\n      return () => {};\n    }\n\n    const liveSpanAttributes = {\n      [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n    };\n    this.liveSpans.add(1, liveSpanAttributes);\n    return () => {\n      this.liveSpans.add(-1, liveSpanAttributes);\n    };\n  }\n}\n\nfunction parentOrigin(parentSpanContext: SpanContext | undefined): string {\n  if (!parentSpanContext) {\n    return 'none';\n  }\n  if (parentSpanContext.isRemote) {\n    return 'remote';\n  }\n  return 'local';\n}\n\nfunction samplingDecisionToString(decision: SamplingDecision): string {\n  switch (decision) {\n    case SamplingDecision.RECORD_AND_SAMPLED:\n      return 'RECORD_AND_SAMPLE';\n    case SamplingDecision.RECORD:\n      return 'RECORD_ONLY';\n    case SamplingDecision.NOT_RECORD:\n      return 'DROP';\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.12.0';\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as api from '@opentelemetry/api';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport { sanitizeAttributes, isTracingSuppressed } from '@opentelemetry/core';\nimport { SpanImpl } from './Span';\nimport type { SpanLimits, TracerOptions } from './types';\nimport type { SpanProcessor } from './SpanProcessor';\nimport type { Sampler } from './Sampler';\nimport type { IdGenerator } from './IdGenerator';\nimport type { Resource } from '@opentelemetry/resources';\nimport { TracerMetrics } from './TracerMetrics';\nimport { VERSION } from './version';\nimport type { InspectFn, InspectStylizeOptions } from './inspect';\nimport {\n  formatInspect,\n  inspectCustom,\n  settledResourceAttributes,\n} from './inspect';\n\n/**\n * This class represents a basic tracer.\n */\nexport class Tracer implements api.Tracer {\n  private readonly _sampler: Sampler;\n  private readonly _spanLimits: SpanLimits;\n  private readonly _idGenerator: IdGenerator;\n  readonly instrumentationScope: InstrumentationScope;\n\n  private readonly _resource: Resource;\n  private readonly _spanProcessor: SpanProcessor;\n  private readonly _tracerMetrics: TracerMetrics;\n\n  /**\n   * Constructs a new Tracer instance.\n   */\n  constructor(\n    instrumentationScope: InstrumentationScope,\n    options: TracerOptions\n  ) {\n    this.instrumentationScope = instrumentationScope;\n    this._sampler = options.sampler;\n    this._spanLimits = options.spanLimits;\n    this._resource = options.resource;\n    this._idGenerator = options.idGenerator;\n    this._spanProcessor = options.spanProcessor;\n\n    const meter = options.meterProvider.getMeter(\n      '@opentelemetry/sdk-trace',\n      VERSION\n    );\n    this._tracerMetrics = new TracerMetrics(meter);\n  }\n\n  /**\n   * Starts a new Span or returns the default NoopSpan based on the sampling\n   * decision.\n   */\n  startSpan(\n    name: string,\n    options: api.SpanOptions = {},\n    context = api.context.active()\n  ): api.Span {\n    // remove span from context in case a root span is requested via options\n    if (options.root) {\n      context = api.trace.deleteSpan(context);\n    }\n    const parentSpan = api.trace.getSpan(context);\n\n    if (isTracingSuppressed(context)) {\n      api.diag.debug('Instrumentation suppressed, returning Noop Span');\n      const nonRecordingSpan = api.trace.wrapSpanContext(\n        api.INVALID_SPAN_CONTEXT\n      );\n      return nonRecordingSpan;\n    }\n\n    const parentSpanContext = parentSpan?.spanContext();\n    const spanId = this._idGenerator.generateSpanId();\n    let validParentSpanContext;\n    let traceId;\n    let traceState;\n    if (\n      !parentSpanContext ||\n      !api.trace.isSpanContextValid(parentSpanContext)\n    ) {\n      // New root span.\n      traceId = this._idGenerator.generateTraceId();\n    } else {\n      // New child span.\n      traceId = parentSpanContext.traceId;\n      traceState = parentSpanContext.traceState;\n      validParentSpanContext = parentSpanContext;\n    }\n\n    const spanKind = options.kind ?? api.SpanKind.INTERNAL;\n    const links = (options.links ?? []).map(link => {\n      return {\n        context: link.context,\n        attributes: sanitizeAttributes(link.attributes),\n      };\n    });\n    const attributes = sanitizeAttributes(options.attributes);\n    // make sampling decision\n    const samplingResult = this._sampler.shouldSample(\n      context,\n      traceId,\n      name,\n      spanKind,\n      attributes,\n      links\n    );\n\n    const recordEndMetrics = this._tracerMetrics.startSpan(\n      parentSpanContext,\n      samplingResult.decision\n    );\n\n    traceState = samplingResult.traceState ?? traceState;\n\n    const traceFlags =\n      samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED\n        ? api.TraceFlags.SAMPLED\n        : api.TraceFlags.NONE;\n    const spanContext = { traceId, spanId, traceFlags, traceState };\n    if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {\n      api.diag.debug(\n        'Recording is off, propagating context in a non-recording span'\n      );\n      const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);\n      return nonRecordingSpan;\n    }\n\n    // Set initial span attributes. The attributes object may have been mutated\n    // by the sampler, so we sanitize the merged attributes before setting them.\n    const initAttributes = sanitizeAttributes(\n      Object.assign(attributes, samplingResult.attributes)\n    );\n\n    const span = new SpanImpl({\n      resource: this._resource,\n      scope: this.instrumentationScope,\n      context,\n      spanContext,\n      name,\n      kind: spanKind,\n      links,\n      parentSpanContext: validParentSpanContext,\n      attributes: initAttributes,\n      startTime: options.startTime,\n      spanProcessor: this._spanProcessor,\n      spanLimits: this._spanLimits,\n      recordEndMetrics,\n    });\n    return span;\n  }\n\n  /**\n   * Starts a new {@link Span} and calls the given function passing it the\n   * created span as first argument.\n   * Additionally the new span gets set in context and this context is activated\n   * for the duration of the function call.\n   *\n   * **Important**: The callback function is responsible for calling `span.end()`\n   * to finish the span. Unlike some other OpenTelemetry implementations, the span\n   * is NOT automatically ended when the callback returns. If `span.end()` is not\n   * called, the span will never be exported and will be silently lost.\n   *\n   * @param name The name of the span\n   * @param [options] SpanOptions used for span creation\n   * @param [context] Context to use to extract parent\n   * @param fn function called in the context of the span and receives the newly created span as an argument\n   * @returns return value of fn\n   * @example\n   *   const something = tracer.startActiveSpan('op', span => {\n   *     try {\n   *       do some work\n   *       span.setStatus({code: SpanStatusCode.OK});\n   *       return something;\n   *     } catch (err) {\n   *       span.setStatus({\n   *         code: SpanStatusCode.ERROR,\n   *         message: err.message,\n   *       });\n   *       throw err;\n   *     } finally {\n   *       span.end();\n   *     }\n   *   });\n   * @example\n   *   const span = tracer.startActiveSpan('op', span => {\n   *     try {\n   *       do some work\n   *       return span;\n   *     } catch (err) {\n   *       span.setStatus({\n   *         code: SpanStatusCode.ERROR,\n   *         message: err.message,\n   *       });\n   *       throw err;\n   *     }\n   *   });\n   *   do some more work\n   *   span.end();\n   */\n  startActiveSpan<F extends (span: api.Span) => ReturnType<F>>(\n    name: string,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: api.Span) => ReturnType<F>>(\n    name: string,\n    opts: api.SpanOptions,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: api.Span) => ReturnType<F>>(\n    name: string,\n    opts: api.SpanOptions,\n    ctx: api.Context,\n    fn: F\n  ): ReturnType<F>;\n  startActiveSpan<F extends (span: api.Span) => ReturnType<F>>(\n    name: string,\n    arg2?: F | api.SpanOptions,\n    arg3?: F | api.Context,\n    arg4?: F\n  ): ReturnType<F> | undefined {\n    let opts: api.SpanOptions | undefined;\n    let ctx: api.Context | undefined;\n    let fn: F;\n\n    if (arguments.length < 2) {\n      return;\n    } else if (arguments.length === 2) {\n      fn = arg2 as F;\n    } else if (arguments.length === 3) {\n      opts = arg2 as api.SpanOptions | undefined;\n      fn = arg3 as F;\n    } else {\n      opts = arg2 as api.SpanOptions | undefined;\n      ctx = arg3 as api.Context | undefined;\n      fn = arg4 as F;\n    }\n\n    const parentContext = ctx ?? api.context.active();\n    const span = this.startSpan(name, opts, parentContext);\n    const contextWithSpanSet = api.trace.setSpan(parentContext, span);\n\n    return api.context.with(contextWithSpanSet, fn, undefined, span);\n  }\n\n  [inspectCustom](\n    depth: number,\n    options: InspectStylizeOptions | undefined,\n    inspect: InspectFn | undefined\n  ): unknown {\n    const payload = {\n      instrumentationScope: this.instrumentationScope,\n      resource: { attributes: settledResourceAttributes(this._resource) },\n      spanLimits: this._spanLimits,\n    };\n    return formatInspect('Tracer', payload, depth, options, inspect);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport { globalErrorHandler } from '@opentelemetry/core';\nimport type { ReadableSpan } from './export/ReadableSpan';\nimport type { Span } from './Span';\nimport type { SpanProcessor } from './SpanProcessor';\n\n/**\n * Implementation of the {@link SpanProcessor} that simply forwards all\n * received events to a list of {@link SpanProcessor}s.\n */\nexport class MultiSpanProcessor implements SpanProcessor {\n  private readonly _spanProcessors: SpanProcessor[];\n  constructor(spanProcessors: SpanProcessor[]) {\n    this._spanProcessors = spanProcessors;\n  }\n\n  forceFlush(): Promise<void> {\n    const promises: Promise<void>[] = [];\n\n    for (const spanProcessor of this._spanProcessors) {\n      promises.push(spanProcessor.forceFlush());\n    }\n    return new Promise(resolve => {\n      Promise.all(promises)\n        .then(() => {\n          resolve();\n        })\n        .catch(error => {\n          globalErrorHandler(\n            error || new Error('MultiSpanProcessor: forceFlush failed')\n          );\n          resolve();\n        });\n    });\n  }\n\n  onStart(span: Span, context: Context): void {\n    for (const spanProcessor of this._spanProcessors) {\n      spanProcessor.onStart(span, context);\n    }\n  }\n\n  onEnding(span: Span): void {\n    for (const spanProcessor of this._spanProcessors) {\n      if (spanProcessor.onEnding) {\n        spanProcessor.onEnding(span);\n      }\n    }\n  }\n\n  onEnd(span: ReadableSpan): void {\n    for (const spanProcessor of this._spanProcessors) {\n      spanProcessor.onEnd(span);\n    }\n  }\n\n  shutdown(): Promise<void> {\n    const promises: Promise<void>[] = [];\n\n    for (const spanProcessor of this._spanProcessors) {\n      promises.push(spanProcessor.shutdown());\n    }\n    return new Promise((resolve, reject) => {\n      Promise.all(promises).then(() => {\n        resolve();\n      }, reject);\n    });\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Sampler, SamplingResult } from '../Sampler';\nimport { SamplingDecision } from '../Sampler';\n\n/** Sampler that samples no traces. */\nexport class AlwaysOffSampler implements Sampler {\n  shouldSample(): SamplingResult {\n    return {\n      decision: SamplingDecision.NOT_RECORD,\n    };\n  }\n\n  toString(): string {\n    return 'AlwaysOffSampler';\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Sampler, SamplingResult } from '../Sampler';\nimport { SamplingDecision } from '../Sampler';\n\n/** Sampler that samples all traces. */\nexport class AlwaysOnSampler implements Sampler {\n  shouldSample(): SamplingResult {\n    return {\n      decision: SamplingDecision.RECORD_AND_SAMPLED,\n    };\n  }\n\n  toString(): string {\n    return 'AlwaysOnSampler';\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context, Link, Attributes, SpanKind } from '@opentelemetry/api';\nimport { isSpanContextValid, TraceFlags, trace } from '@opentelemetry/api';\nimport { globalErrorHandler } from '@opentelemetry/core';\nimport { AlwaysOffSampler } from './AlwaysOffSampler';\nimport { AlwaysOnSampler } from './AlwaysOnSampler';\nimport type { Sampler, SamplingResult } from '../Sampler';\n\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nexport class ParentBasedSampler implements Sampler {\n  private _root: Sampler;\n  private _remoteParentSampled: Sampler;\n  private _remoteParentNotSampled: Sampler;\n  private _localParentSampled: Sampler;\n  private _localParentNotSampled: Sampler;\n\n  constructor(config: ParentBasedSamplerConfig) {\n    this._root = config.root;\n\n    if (!this._root) {\n      globalErrorHandler(\n        new Error('ParentBasedSampler must have a root sampler configured')\n      );\n      this._root = new AlwaysOnSampler();\n    }\n\n    this._remoteParentSampled =\n      config.remoteParentSampled ?? new AlwaysOnSampler();\n    this._remoteParentNotSampled =\n      config.remoteParentNotSampled ?? new AlwaysOffSampler();\n    this._localParentSampled =\n      config.localParentSampled ?? new AlwaysOnSampler();\n    this._localParentNotSampled =\n      config.localParentNotSampled ?? new AlwaysOffSampler();\n  }\n\n  shouldSample(\n    context: Context,\n    traceId: string,\n    spanName: string,\n    spanKind: SpanKind,\n    attributes: Attributes,\n    links: Link[]\n  ): SamplingResult {\n    const parentContext = trace.getSpanContext(context);\n\n    if (!parentContext || !isSpanContextValid(parentContext)) {\n      return this._root.shouldSample(\n        context,\n        traceId,\n        spanName,\n        spanKind,\n        attributes,\n        links\n      );\n    }\n\n    if (parentContext.isRemote) {\n      if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n        return this._remoteParentSampled.shouldSample(\n          context,\n          traceId,\n          spanName,\n          spanKind,\n          attributes,\n          links\n        );\n      }\n      return this._remoteParentNotSampled.shouldSample(\n        context,\n        traceId,\n        spanName,\n        spanKind,\n        attributes,\n        links\n      );\n    }\n\n    if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n      return this._localParentSampled.shouldSample(\n        context,\n        traceId,\n        spanName,\n        spanKind,\n        attributes,\n        links\n      );\n    }\n\n    return this._localParentNotSampled.shouldSample(\n      context,\n      traceId,\n      spanName,\n      spanKind,\n      attributes,\n      links\n    );\n  }\n\n  toString(): string {\n    return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n  }\n}\n\ninterface ParentBasedSamplerConfig {\n  /** Sampler called for spans with no parent */\n  root: Sampler;\n  /** Sampler called for spans with a remote parent which was sampled. Default AlwaysOn */\n  remoteParentSampled?: Sampler;\n  /** Sampler called for spans with a remote parent which was not sampled. Default AlwaysOff */\n  remoteParentNotSampled?: Sampler;\n  /** Sampler called for spans with a local parent which was sampled. Default AlwaysOn */\n  localParentSampled?: Sampler;\n  /** Sampler called for spans with a local parent which was not sampled. Default AlwaysOff */\n  localParentNotSampled?: Sampler;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  Attributes,\n  Counter,\n  Meter,\n  ObservableCallback,\n  ObservableUpDownCounter,\n} from '@opentelemetry/api';\nimport { ATTR_ERROR_TYPE } from '@opentelemetry/semantic-conventions';\nimport {\n  ATTR_OTEL_COMPONENT_NAME,\n  ATTR_OTEL_COMPONENT_TYPE,\n  METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED,\n  METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY,\n  METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE,\n} from '../semconv';\n\nconst componentCounter = new Map<string, number>();\n\ninterface QueueConfig {\n  capacity: number;\n  getQueueSize: () => number;\n}\n\nexport class SpanProcessorMetrics {\n  private readonly processedSpans: Counter;\n  private readonly queueSize: ObservableUpDownCounter | undefined;\n  private readonly queueSizeCallback: ObservableCallback | undefined;\n\n  private readonly standardAttrs: Attributes;\n  private readonly droppedAttrs: Attributes;\n\n  constructor(componentType: string, meter: Meter, queueConfig?: QueueConfig) {\n    const counter = componentCounter.get(componentType) ?? 0;\n    componentCounter.set(componentType, counter + 1);\n\n    this.standardAttrs = {\n      [ATTR_OTEL_COMPONENT_TYPE]: componentType,\n      [ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}`,\n    };\n\n    this.droppedAttrs = {\n      ...this.standardAttrs,\n      [ATTR_ERROR_TYPE]: 'queue_full',\n    };\n\n    this.processedSpans = meter.createCounter(\n      METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED,\n      {\n        unit: '{span}',\n        description:\n          'The number of spans for which the processing has finished, either successful or failed.',\n      }\n    );\n\n    if (queueConfig) {\n      const { capacity, getQueueSize } = queueConfig;\n      const queueCapacity = meter.createUpDownCounter(\n        METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY,\n        {\n          unit: '{span}',\n          description:\n            'The maximum number of spans the queue of a given instance of an SDK span processor can hold.',\n        }\n      );\n      queueCapacity.add(capacity, this.standardAttrs);\n\n      this.queueSize = meter.createObservableUpDownCounter(\n        METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE,\n        {\n          unit: '{span}',\n          description:\n            'The number of spans in the queue of a given instance of an SDK span processor.',\n        }\n      );\n      this.queueSizeCallback = result =>\n        result.observe(getQueueSize(), this.standardAttrs);\n      this.queueSize.addCallback(this.queueSizeCallback);\n    }\n  }\n\n  dropSpans(count: number) {\n    this.processedSpans.add(count, this.droppedAttrs);\n  }\n\n  finishSpans(count: number, error: Error | undefined) {\n    if (!error) {\n      this.processedSpans.add(count, this.standardAttrs);\n      return;\n    }\n\n    const attrs = {\n      ...this.standardAttrs,\n      [ATTR_ERROR_TYPE]: error.name,\n    };\n    this.processedSpans.add(count, attrs);\n  }\n\n  shutdown() {\n    if (this.queueSize && this.queueSizeCallback) {\n      this.queueSize.removeCallback(this.queueSizeCallback);\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport { context, createNoopMeter, diag, TraceFlags } from '@opentelemetry/api';\nimport {\n  BindOnceFuture,\n  ExportResultCode,\n  globalErrorHandler,\n  suppressTracing,\n} from '@opentelemetry/core';\nimport type { Span } from '../Span';\nimport type { SpanProcessor } from '../SpanProcessor';\nimport type { BatchSpanProcessorOptions } from '../types';\nimport type { ReadableSpan } from './ReadableSpan';\nimport type { SpanExporter } from './SpanExporter';\nimport { SpanProcessorMetrics } from './SpanProcessorMetrics';\nimport { OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR } from '../semconv';\n\n/**\n * Implementation of the {@link SpanProcessor} that batches spans exported by\n * the SDK then pushes them to the exporter pipeline.\n */\nexport abstract class BatchSpanProcessorBase<\n  T extends BatchSpanProcessorOptions,\n> implements SpanProcessor\n{\n  private readonly _maxExportBatchSize: number;\n  private readonly _maxQueueSize: number;\n  private readonly _scheduledDelayMillis: number;\n  private readonly _exportTimeoutMillis: number;\n  private readonly _exporter: SpanExporter;\n  private readonly _metrics: SpanProcessorMetrics;\n\n  private _isExporting = false;\n  private _finishedSpans: ReadableSpan[] = [];\n  private _timer: NodeJS.Timeout | number | undefined;\n  private _shutdownOnce: BindOnceFuture<void>;\n  private _droppedSpansCount: number = 0;\n\n  constructor(options: T) {\n    this._exporter = options.exporter;\n    this._maxExportBatchSize = options.maxExportBatchSize ?? 512;\n    this._maxQueueSize = options.maxQueueSize ?? 2048;\n    this._scheduledDelayMillis = options.scheduledDelayMillis ?? 5000;\n    this._exportTimeoutMillis = options.exportTimeoutMillis ?? 30000;\n\n    this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n\n    if (this._maxExportBatchSize > this._maxQueueSize) {\n      diag.warn(\n        'BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize'\n      );\n      this._maxExportBatchSize = this._maxQueueSize;\n    }\n\n    const meter = options.selfObsMeterProvider\n      ? options.selfObsMeterProvider.getMeter('@opentelemetry/sdk-trace')\n      : createNoopMeter();\n    this._metrics = new SpanProcessorMetrics(\n      OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR,\n      meter,\n      {\n        capacity: this._maxQueueSize,\n        getQueueSize: () => this._finishedSpans.length,\n      }\n    );\n  }\n\n  forceFlush(): Promise<void> {\n    if (this._shutdownOnce.isCalled) {\n      return this._shutdownOnce.promise;\n    }\n    return this._flushAll();\n  }\n\n  // does nothing.\n  onStart(_span: Span, _parentContext: Context): void {}\n\n  onEnd(span: ReadableSpan): void {\n    if (this._shutdownOnce.isCalled) {\n      return;\n    }\n\n    if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {\n      return;\n    }\n\n    this._addToBuffer(span);\n  }\n\n  shutdown(): Promise<void> {\n    return this._shutdownOnce.call();\n  }\n\n  private _shutdown() {\n    return Promise.resolve()\n      .then(() => {\n        return this.onShutdown();\n      })\n      .then(() => {\n        return this._flushAll();\n      })\n      .then(() => {\n        this._metrics.shutdown();\n        return this._exporter.shutdown();\n      });\n  }\n\n  /** Add a span in the buffer. */\n  private _addToBuffer(span: ReadableSpan) {\n    if (this._finishedSpans.length >= this._maxQueueSize) {\n      // limit reached, drop span\n\n      if (this._droppedSpansCount === 0) {\n        diag.debug('maxQueueSize reached, dropping spans');\n      }\n      this._droppedSpansCount++;\n      this._metrics.dropSpans(1);\n\n      return;\n    }\n\n    if (this._droppedSpansCount > 0) {\n      // some spans were dropped, log once with count of spans dropped\n      diag.warn(\n        `Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`\n      );\n      this._droppedSpansCount = 0;\n    }\n\n    this._finishedSpans.push(span);\n    this._maybeStartTimer();\n  }\n\n  /**\n   * Send all spans to the exporter respecting the batch size limit\n   * This function is used only on forceFlush or shutdown,\n   * for all other cases _flush should be used\n   * */\n  private _flushAll(): Promise<void> {\n    return new Promise((resolve, reject) => {\n      const promises = [];\n      // calculate number of batches\n      const count = Math.ceil(\n        this._finishedSpans.length / this._maxExportBatchSize\n      );\n      for (let i = 0, j = count; i < j; i++) {\n        promises.push(this._flushOneBatch());\n      }\n      Promise.all(promises)\n        .then(() => {\n          resolve();\n        })\n        .catch(reject);\n    });\n  }\n\n  private _flushOneBatch(): Promise<void> {\n    this._clearTimer();\n    if (this._finishedSpans.length === 0) {\n      return Promise.resolve();\n    }\n    return new Promise((resolve, reject) => {\n      const timer = setTimeout(() => {\n        // don't wait anymore for export, this way the next batch can start\n        reject(new Error('Timeout'));\n      }, this._exportTimeoutMillis);\n      // prevent downstream exporter calls from generating spans\n      context.with(suppressTracing(context.active()), () => {\n        // Reset the finished spans buffer here because the next invocations of the _flush method\n        // could pass the same finished spans to the exporter if the buffer is cleared\n        // outside the execution of this callback.\n        let spans: ReadableSpan[];\n        if (this._finishedSpans.length <= this._maxExportBatchSize) {\n          spans = this._finishedSpans;\n          this._finishedSpans = [];\n        } else {\n          spans = this._finishedSpans.splice(0, this._maxExportBatchSize);\n        }\n\n        const doExport = () =>\n          this._exporter.export(spans, result => {\n            clearTimeout(timer);\n            this._metrics.finishSpans(spans.length, result.error);\n            if (result.code === ExportResultCode.SUCCESS) {\n              resolve();\n            } else {\n              reject(\n                result.error ??\n                  new Error('BatchSpanProcessor: span export failed')\n              );\n            }\n          });\n\n        let pendingResources: Array<Promise<void>> | null = null;\n        for (let i = 0, len = spans.length; i < len; i++) {\n          const span = spans[i];\n          if (\n            span.resource.asyncAttributesPending &&\n            span.resource.waitForAsyncAttributes\n          ) {\n            pendingResources ??= [];\n            pendingResources.push(span.resource.waitForAsyncAttributes());\n          }\n        }\n\n        // Avoid scheduling a promise to make the behavior more predictable and easier to test\n        if (pendingResources === null) {\n          doExport();\n        } else {\n          Promise.all(pendingResources).then(doExport, err => {\n            globalErrorHandler(err);\n            reject(err);\n          });\n        }\n      });\n    });\n  }\n\n  private _maybeStartTimer() {\n    if (this._isExporting) return;\n    const flush = () => {\n      this._isExporting = true;\n      this._flushOneBatch()\n        .finally(() => {\n          this._isExporting = false;\n          if (this._finishedSpans.length > 0) {\n            this._clearTimer();\n            this._maybeStartTimer();\n          }\n        })\n        .catch(e => {\n          this._isExporting = false;\n          globalErrorHandler(e);\n        });\n    };\n    // we only wait if the queue doesn't have enough elements yet\n    if (this._finishedSpans.length >= this._maxExportBatchSize) {\n      return flush();\n    }\n    if (this._timer !== undefined) return;\n    this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);\n\n    // depending on runtime, this may be a 'number' or NodeJS.Timeout\n    if (typeof this._timer !== 'number') {\n      this._timer.unref();\n    }\n  }\n\n  private _clearTimer() {\n    if (this._timer !== undefined) {\n      clearTimeout(this._timer);\n      this._timer = undefined;\n    }\n  }\n\n  protected abstract onShutdown(): void;\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BatchSpanProcessorBase } from '../../../export/BatchSpanProcessorBase';\nimport type { BatchSpanProcessorBrowserOptions } from '../../../types';\nimport { globalErrorHandler } from '@opentelemetry/core';\n\nexport class BatchSpanProcessor extends BatchSpanProcessorBase<BatchSpanProcessorBrowserOptions> {\n  private _visibilityChangeListener?: () => void;\n  private _pageHideListener?: () => void;\n\n  constructor(options: BatchSpanProcessorBrowserOptions) {\n    super(options);\n    this.onInit(options);\n  }\n\n  private onInit(options: BatchSpanProcessorBrowserOptions): void {\n    if (\n      options.disableAutoFlushOnDocumentHide !== true &&\n      typeof document !== 'undefined'\n    ) {\n      this._visibilityChangeListener = () => {\n        if (document.visibilityState === 'hidden') {\n          this.forceFlush().catch(error => {\n            globalErrorHandler(error);\n          });\n        }\n      };\n      this._pageHideListener = () => {\n        this.forceFlush().catch(error => {\n          globalErrorHandler(error);\n        });\n      };\n      document.addEventListener(\n        'visibilitychange',\n        this._visibilityChangeListener\n      );\n\n      // use 'pagehide' event as a fallback for Safari; see https://bugs.webkit.org/show_bug.cgi?id=116769\n      document.addEventListener('pagehide', this._pageHideListener);\n    }\n  }\n\n  protected onShutdown(): void {\n    if (typeof document !== 'undefined') {\n      if (this._visibilityChangeListener) {\n        document.removeEventListener(\n          'visibilitychange',\n          this._visibilityChangeListener\n        );\n      }\n      if (this._pageHideListener) {\n        document.removeEventListener('pagehide', this._pageHideListener);\n      }\n    }\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IdGenerator } from '../../IdGenerator';\n\nconst TRACE_ID_BYTES = 16;\nconst SPAN_ID_BYTES = 8;\n\nconst TRACE_BUFFER = new Uint8Array(TRACE_ID_BYTES);\nconst SPAN_BUFFER = new Uint8Array(SPAN_ID_BYTES);\n\n// Byte-to-hex lookup is faster than toString(16) in browsers\nconst HEX: string[] = Array.from({ length: 256 }, (_, i) =>\n  i.toString(16).padStart(2, '0')\n);\n\n/**\n * Fills buffer with random bytes, ensuring at least one is non-zero\n * per W3C Trace Context spec.\n */\nfunction randomFill(buf: Uint8Array): void {\n  for (let i = 0; i < buf.length; i++) {\n    buf[i] = (Math.random() * 256) >>> 0;\n  }\n  // Ensure non-zero\n  for (let i = 0; i < buf.length; i++) {\n    if (buf[i] > 0) return;\n  }\n  buf[buf.length - 1] = 1;\n}\n\nfunction toHex(buf: Uint8Array): string {\n  let hex = '';\n  for (let i = 0; i < buf.length; i++) {\n    hex += HEX[buf[i]];\n  }\n  return hex;\n}\n\nexport class RandomIdGenerator implements IdGenerator {\n  /**\n   * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n   * characters corresponding to 128 bits.\n   */\n  generateTraceId(): string {\n    randomFill(TRACE_BUFFER);\n    return toHex(TRACE_BUFFER);\n  }\n\n  /**\n   * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n   * characters corresponding to 64 bits.\n   */\n  generateSpanId(): string {\n    randomFill(SPAN_BUFFER);\n    return toHex(SPAN_BUFFER);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n  TracerProvider as ApiTracerProvider,\n  Tracer as ApiTracer,\n} from '@opentelemetry/api';\nimport { createNoopMeter } from '@opentelemetry/api';\nimport type { Resource } from '@opentelemetry/resources';\nimport { defaultResource } from '@opentelemetry/resources';\nimport type { SpanProcessor } from './SpanProcessor';\nimport { Tracer } from './Tracer';\nimport { MultiSpanProcessor } from './MultiSpanProcessor';\nimport type {\n  ForceFlushOptions,\n  TracerProviderOptions,\n  TracerOptions,\n} from './types';\nimport { ParentBasedSampler } from './sampler/ParentBasedSampler';\nimport { AlwaysOnSampler } from './sampler/AlwaysOnSampler';\nimport { RandomIdGenerator } from './platform';\nimport type { InspectFn, InspectStylizeOptions } from './inspect';\nimport {\n  formatInspect,\n  inspectCustom,\n  settledResourceAttributes,\n} from './inspect';\n\nenum ForceFlushState {\n  'resolved',\n  'timeout',\n  'error',\n  'unresolved',\n}\n\n/**\n * This class represents a basic tracer provider which platform libraries can extend\n */\nexport class TracerProvider implements ApiTracerProvider {\n  private readonly _resource: Resource;\n  private readonly _activeSpanProcessor: MultiSpanProcessor;\n  private readonly _forceFlushTimeoutMillis: number;\n  private readonly _tracerOptions: TracerOptions;\n  private readonly _tracers: Map<string, Tracer> = new Map();\n\n  constructor(options: TracerProviderOptions = {}) {\n    this._forceFlushTimeoutMillis = options.forceFlushTimeoutMillis ?? 30000;\n    this._resource = options.resource ?? defaultResource();\n    const spanProcessors = options.spanProcessors ?? [];\n    this._activeSpanProcessor = new MultiSpanProcessor(spanProcessors);\n\n    this._tracerOptions = {\n      resource: this._resource,\n      sampler:\n        options.sampler ??\n        new ParentBasedSampler({\n          root: new AlwaysOnSampler(),\n        }),\n      spanLimits: {\n        attributeCountLimit: options.spanLimits?.attributeCountLimit ?? 128,\n        attributeValueLengthLimit:\n          options.spanLimits?.attributeValueLengthLimit ?? Infinity,\n        eventCountLimit: options.spanLimits?.eventCountLimit ?? 128,\n        linkCountLimit: options.spanLimits?.linkCountLimit ?? 128,\n        attributePerEventCountLimit:\n          options.spanLimits?.attributePerEventCountLimit ?? 128,\n        attributePerLinkCountLimit:\n          options.spanLimits?.attributePerLinkCountLimit ?? 128,\n      },\n      idGenerator: options.idGenerator || new RandomIdGenerator(),\n      spanProcessor: this._activeSpanProcessor,\n      meterProvider: options.meterProvider ?? {\n        getMeter() {\n          return createNoopMeter();\n        },\n      },\n    };\n  }\n\n  getTracer(\n    name: string,\n    version?: string,\n    options?: { schemaUrl?: string }\n  ): ApiTracer {\n    const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n    if (!this._tracers.has(key)) {\n      this._tracers.set(\n        key,\n        new Tracer(\n          { name, version, schemaUrl: options?.schemaUrl },\n          this._tracerOptions\n        )\n      );\n    }\n\n    return this._tracers.get(key)!;\n  }\n\n  forceFlush(options?: ForceFlushOptions): Promise<void> {\n    const timeout = options?.timeoutMillis ?? this._forceFlushTimeoutMillis;\n    const promises = this._activeSpanProcessor['_spanProcessors'].map(\n      (spanProcessor: SpanProcessor) => {\n        return new Promise(resolve => {\n          let state: ForceFlushState;\n          const timeoutInterval = setTimeout(() => {\n            resolve(\n              new Error(\n                `Span processor did not completed within timeout period of ${timeout} ms`\n              )\n            );\n            state = ForceFlushState.timeout;\n          }, timeout);\n\n          spanProcessor\n            .forceFlush()\n            .then(() => {\n              clearTimeout(timeoutInterval);\n              if (state !== ForceFlushState.timeout) {\n                state = ForceFlushState.resolved;\n                resolve(state);\n              }\n            })\n            .catch(error => {\n              clearTimeout(timeoutInterval);\n              state = ForceFlushState.error;\n              resolve(error);\n            });\n        });\n      }\n    );\n\n    return new Promise<void>((resolve, reject) => {\n      Promise.all(promises)\n        .then(results => {\n          const errors = results.filter(\n            result => result !== ForceFlushState.resolved\n          );\n          if (errors.length > 0) {\n            reject(errors);\n          } else {\n            resolve();\n          }\n        })\n        .catch(error => reject([error]));\n    });\n  }\n\n  shutdown(): Promise<void> {\n    return this._activeSpanProcessor.shutdown();\n  }\n\n  [inspectCustom](\n    depth: number,\n    options: InspectStylizeOptions | undefined,\n    inspect: InspectFn | undefined\n  ): unknown {\n    const processors = this._activeSpanProcessor[\n      '_spanProcessors'\n    ] as SpanProcessor[];\n    const payload = {\n      resource: { attributes: settledResourceAttributes(this._resource) },\n      tracers: Array.from(this._tracers.keys()),\n      spanProcessors: processors.map(\n        p => p.constructor?.name ?? 'SpanProcessor'\n      ),\n    };\n    return formatInspect('TracerProvider', payload, depth, options, inspect);\n  }\n}\n", "/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isValidTraceId } from '@opentelemetry/api';\nimport type { Sampler, SamplingResult } from '../Sampler';\nimport { SamplingDecision } from '../Sampler';\n\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nexport class TraceIdRatioBasedSampler implements Sampler {\n  private readonly _ratio;\n  private _upperBound: number;\n\n  constructor(ratio = 0) {\n    this._ratio = this._normalize(ratio);\n    this._upperBound =\n      this._ratio === 1 ? 0x100000000 : Math.floor(this._ratio * 0xffffffff);\n  }\n\n  shouldSample(context: unknown, traceId: string): SamplingResult {\n    return {\n      decision:\n        isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n          ? SamplingDecision.RECORD_AND_SAMPLED\n          : SamplingDecision.NOT_RECORD,\n    };\n  }\n\n  toString(): string {\n    return `TraceIdRatioBased{${this._ratio}}`;\n  }\n\n  private _normalize(ratio: number): number {\n    if (typeof ratio !== 'number' || isNaN(ratio)) return 0;\n    return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n  }\n\n  private _accumulate(traceId: string): number {\n    let accumulation = 0;\n    for (let i = 0; i < 32; i += 8) {\n      let part = 0;\n      for (let j = 0; j < 8; j++) {\n        const c = traceId.charCodeAt(i + j);\n        // Convert hex char code to value: '0'-'9' -> 0-9, 'a'-'f' -> 10-15, 'A'-'F' -> 10-15\n        const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87;\n        part = (part << 4) | v;\n      }\n      accumulation = (accumulation ^ part) >>> 0;\n    }\n    return accumulation;\n  }\n}\n", "/**\n * Same-origin keep-all + top-N cross-origin caps for browser.resource_timing.\n * Pure helpers are unit-tested; the exporter wrapper buffers cross-origin until flush.\n */\n\nimport { ExportResultCode, type ExportResult } from \"@opentelemetry/core\";\nimport type { LogRecordExporter, ReadableLogRecord } from \"@opentelemetry/sdk-logs\";\n\nexport const DEFAULT_CROSS_ORIGIN_TOP_N = 25;\nexport const RESOURCE_TIMING_EVENT = \"browser.resource_timing\";\n\nexport type ResourceOriginClass = \"same\" | \"cross\" | \"unknown\";\n\nexport function classifyResourceUrl(url: string, pageOrigin: string): ResourceOriginClass {\n  const raw = (url ?? \"\").trim();\n  const origin = (pageOrigin ?? \"\").trim();\n  if (!raw || raw === \"[REDACTED]\" || !origin) return \"unknown\";\n  try {\n    const u = new URL(raw, origin);\n    if (u.origin === origin) return \"same\";\n    return \"cross\";\n  } catch {\n    return \"unknown\";\n  }\n}\n\nexport function resourceTimingUrl(attrs: Record<string, unknown> | undefined): string {\n  if (!attrs) return \"\";\n  const full = attrs[\"url.full\"];\n  if (full != null && String(full).trim()) return String(full);\n  const legacy = attrs[\"resource.url\"];\n  if (legacy != null && String(legacy).trim()) return String(legacy);\n  return \"\";\n}\n\nexport function resourceTimingDuration(attrs: Record<string, unknown> | undefined): number {\n  if (!attrs) return 0;\n  const raw = attrs[\"browser.resource_timing.duration\"] ?? attrs[\"resource.duration_ms\"];\n  const n = Number(raw);\n  return Number.isFinite(n) && n > 0 ? n : 0;\n}\n\n/**\n * Partition resource_timing candidates: same-origin kept; cross-origin/unknown\n * ranked by duration descending, capped at topN.\n */\nexport function selectResourceTimingEntries<T>(\n  entries: T[],\n  opts: {\n    getUrl: (e: T) => string;\n    getDuration: (e: T) => number;\n    pageOrigin: string;\n    crossOriginTopN?: number;\n    getOrigin?: (e: T) => ResourceOriginClass;\n  },\n): T[] {\n  const topN = opts.crossOriginTopN ?? DEFAULT_CROSS_ORIGIN_TOP_N;\n  const keep: T[] = [];\n  const cross: T[] = [];\n  for (const e of entries) {\n    const kind = opts.getOrigin?.(e) ?? classifyResourceUrl(opts.getUrl(e), opts.pageOrigin);\n    if (kind !== \"same\") cross.push(e);\n    else keep.push(e);\n  }\n  cross.sort((a, b) => opts.getDuration(b) - opts.getDuration(a));\n  return keep.concat(cross.slice(0, Math.max(0, topN)));\n}\n\n/** Wraps an OTLP log exporter: buffers cross-origin resource timings until flush. */\nexport class ResourceTimingCapExporter implements LogRecordExporter {\n  private buffered: ReadableLogRecord[] = [];\n  private timer: ReturnType<typeof setTimeout> | undefined;\n  private serial = Promise.resolve();\n  private failure: Error | undefined;\n  private stopped = false;\n  private discarded = false;\n  private flushing: Promise<void> | undefined;\n  private shutdownPromise: Promise<void> | undefined;\n  private crossExport: Promise<void> | undefined;\n  private readonly inner: LogRecordExporter;\n  private readonly options: {\n    pageOrigin: () => string;\n    crossOriginTopN?: number;\n    onDiagnostic?: (code: \"cap_dropped\" | \"export_failed\", count?: number) => void;\n    isActive?: () => boolean;\n  };\n\n  constructor(\n    inner: LogRecordExporter,\n    options: {\n      pageOrigin: () => string;\n      crossOriginTopN?: number;\n      onDiagnostic?: (code: \"cap_dropped\" | \"export_failed\", count?: number) => void;\n      isActive?: () => boolean;\n    },\n  ) {\n    this.inner = inner;\n    this.options = options;\n  }\n\n  export(logs: ReadableLogRecord[], resultCallback: (result: ExportResult) => void): void {\n    if (this.discarded || this.options.isActive?.() === false) {\n      resultCallback({ code: ExportResultCode.SUCCESS });\n      return;\n    }\n    if (this.stopped) {\n      resultCallback({ code: ExportResultCode.FAILED, error: new Error(\"exporter stopped\") });\n      return;\n    }\n    const pass: ReadableLogRecord[] = [];\n    for (const record of logs) {\n      if (record.eventName !== RESOURCE_TIMING_EVENT) {\n        pass.push(record);\n        continue;\n      }\n      const url = resourceTimingUrl(record.attributes as Record<string, unknown>);\n      const kind = resourceOrigin(record.attributes, url, this.options.pageOrigin());\n      if (kind !== \"same\") {\n        const size = this.buffered.length + 1;\n        // Keep only the best candidates while collecting, not an unbounded page history.\n        this.buffered = selectResourceTimingEntries([...this.buffered, record], {\n          getUrl: (r) => resourceTimingUrl(r.attributes),\n          getDuration: (r) => resourceTimingDuration(r.attributes),\n          pageOrigin: this.options.pageOrigin(),\n          crossOriginTopN: this.options.crossOriginTopN,\n          getOrigin: (r) =>\n            resourceOrigin(\n              r.attributes,\n              resourceTimingUrl(r.attributes),\n              this.options.pageOrigin(),\n            ),\n        });\n        if (size > this.buffered.length)\n          this.options.onDiagnostic?.(\"cap_dropped\", size - this.buffered.length);\n      } else pass.push(record);\n    }\n    if (this.buffered.length > 0 && this.timer === undefined) {\n      this.timer = setTimeout(() => {\n        void this.flushBuffered().catch(() => {});\n      }, 1000);\n    }\n    if (pass.length === 0) {\n      resultCallback({ code: ExportResultCode.SUCCESS });\n      return;\n    }\n    this.send(pass, resultCallback);\n  }\n\n  forceFlush(): Promise<void> {\n    return (this.flushing ??= (async () => {\n      await this.flushBuffered();\n      await this.serial;\n      await this.inner.forceFlush();\n      if (this.failure) {\n        const failure = this.failure;\n        this.failure = undefined;\n        throw failure;\n      }\n    })().finally(() => {\n      this.flushing = undefined;\n    }));\n  }\n\n  shutdown(): Promise<void> {\n    return (this.shutdownPromise ??= (async () => {\n      this.stopped = true;\n      try {\n        await this.forceFlush();\n      } finally {\n        await this.inner.shutdown();\n      }\n    })());\n  }\n\n  /** Withdrawal clears candidates and blocks every already-serialized send. */\n  discard(): Promise<void> {\n    this.discarded = true;\n    this.stopped = true;\n    this.buffered.length = 0;\n    if (this.timer !== undefined) clearTimeout(this.timer);\n    this.timer = undefined;\n    const cancellable = this.inner as LogRecordExporter & { discard?: () => Promise<void> };\n    const canceled = cancellable.discard?.();\n    return (this.shutdownPromise ??= (async () => {\n      await canceled;\n      await this.serial;\n      await this.inner.shutdown();\n    })());\n  }\n\n  /** Timed cross-origin exports must not race the SDK's regular batches. */\n  private send(records: ReadableLogRecord[], callback: (result: ExportResult) => void): void {\n    this.serial = this.serial.then(\n      () =>\n        new Promise<void>((resolve) => {\n          if (this.discarded || this.options.isActive?.() === false) {\n            callback({ code: ExportResultCode.SUCCESS });\n            resolve();\n            return;\n          }\n          let done = false;\n          const complete = (result: ExportResult) => {\n            if (done) return;\n            done = true;\n            clearTimeout(timeout);\n            if (\n              result.code !== ExportResultCode.SUCCESS &&\n              !this.discarded &&\n              this.options.isActive?.() !== false\n            ) {\n              this.failure = result.error ?? new Error(\"RUM transport export failed\");\n              this.options.onDiagnostic?.(\"export_failed\");\n            }\n            resolve();\n            callback(result);\n          };\n          const timeout = setTimeout(\n            () =>\n              complete({ code: ExportResultCode.FAILED, error: new Error(\"RUM export timed out\") }),\n            10_000,\n          );\n          try {\n            this.inner.export(records, complete);\n          } catch (error) {\n            complete({\n              code: ExportResultCode.FAILED,\n              error: error instanceof Error ? error : new Error(\"RUM exporter threw\"),\n            });\n          }\n        }),\n    );\n  }\n\n  private flushBuffered(): Promise<void> {\n    if (this.timer !== undefined) clearTimeout(this.timer);\n    this.timer = undefined;\n    if (this.discarded || this.options.isActive?.() === false) {\n      this.buffered.length = 0;\n      return Promise.resolve();\n    }\n    if (this.crossExport) return this.crossExport.then(() => this.flushBuffered());\n    if (this.buffered.length === 0) return Promise.resolve();\n    const selected = selectResourceTimingEntries(this.buffered.splice(0), {\n      getUrl: (r) => resourceTimingUrl(r.attributes as Record<string, unknown>),\n      getDuration: (r) => resourceTimingDuration(r.attributes as Record<string, unknown>),\n      pageOrigin: this.options.pageOrigin(),\n      crossOriginTopN: this.options.crossOriginTopN,\n      getOrigin: (r) =>\n        resourceOrigin(r.attributes, resourceTimingUrl(r.attributes), this.options.pageOrigin()),\n    });\n    if (selected.length === 0) return Promise.resolve();\n    this.crossExport = new Promise<void>((resolve) => {\n      this.send(selected, () => resolve());\n    }).finally(() => {\n      this.crossExport = undefined;\n    });\n    return this.crossExport;\n  }\n}\n\n/** Origin is established before URL redaction. Unknown origins share the bounded cap. */\nfunction resourceOrigin(\n  attrs: Record<string, unknown>,\n  url: string,\n  origin: string,\n): ResourceOriginClass {\n  const value = attrs[\"corridora.resource.origin\"];\n  return value === \"same\" || value === \"cross\" || value === \"unknown\"\n    ? value\n    : classifyResourceUrl(url, origin);\n}\n", "export const SCOPE_NAME = \"@corridora/rum-agent\";\nexport const VERSION = \"0.8.0\";\n", "interface ResourceTimingLike {\n  name?: string;\n  initiatorType?: string;\n  responseStatus?: number;\n  renderBlockingStatus?: string;\n  fetchPriority?: string;\n  serverTiming?: ArrayLike<{ name: string; duration: number; description?: string }>;\n}\n\nexport function resourceTimingExtraAttributes(\n  entry: ResourceTimingLike | undefined,\n): Record<string, string> {\n  if (!entry) return {};\n  const out: Record<string, string> = {};\n  if (Number.isFinite(entry.responseStatus) && (entry.responseStatus ?? 0) > 0) {\n    out[\"browser.resource_timing.response_status\"] = String(entry.responseStatus);\n  }\n  if (entry.renderBlockingStatus) {\n    out[\"browser.resource_timing.render_blocking_status\"] = entry.renderBlockingStatus;\n  }\n  if (entry.fetchPriority) {\n    out[\"browser.resource_timing.fetch_priority\"] = entry.fetchPriority;\n  }\n  if (entry.serverTiming?.length) {\n    const timings = Array.from(entry.serverTiming)\n      .slice(0, 16)\n      .filter((timing) => timing.name && Number.isFinite(timing.duration))\n      .map((timing) => ({\n        name: timing.name.slice(0, 128),\n        duration: timing.duration,\n        ...(timing.description ? { description: timing.description.slice(0, 256) } : {}),\n      }));\n    if (timings.length) out[\"browser.resource_timing.server_timing\"] = JSON.stringify(timings);\n  }\n  return out;\n}\n", "import { ROOT_CONTEXT, SpanKind, SpanStatusCode, trace, type Context } from \"@opentelemetry/api\";\nimport { SeverityNumber, type Logger } from \"@opentelemetry/api-logs\";\nimport { createLocationDocumentProvider } from \"@opentelemetry/browser-sdk/document\";\nimport type { LogRecordProcessor, ReadWriteLogRecord } from \"@opentelemetry/sdk-logs\";\nimport type { ReadableSpan, Span, SpanProcessor } from \"@opentelemetry/sdk-trace\";\nimport { classifyResourceUrl } from \"../resource-timing-caps.ts\";\nimport { resourceTimingExtraAttributes } from \"../resource-enrichment.ts\";\nimport { safeRedactUrl, type RedactUrlFn } from \"../plugins/config.ts\";\n\nconst URL_ATTRIBUTES = new Set([\n  \"url.full\",\n  \"page.url\",\n  \"browser.document.url.full\",\n  \"http.url\",\n  \"browser.web_vital.resource_url\",\n  \"resource.url\",\n]);\n\n/** Late request-error logs retain the session captured when their span started. */\nexport class RumSessionLogProcessor implements LogRecordProcessor {\n  private readonly getSessionId: () => string;\n  constructor(getSessionId: () => string) {\n    this.getSessionId = getSessionId;\n  }\n  onEmit(record: ReadWriteLogRecord): void {\n    if (\n      record.eventName === \"browser.resource_timing\" &&\n      record.attributes[\"browser.navigation.assignment\"] === \"unavailable\"\n    )\n      return;\n    if (\n      [\n        \"browser.request.error\",\n        \"browser.web_vital\",\n        \"browser.resource_timing\",\n        \"browser.navigation_timing\",\n      ].includes(record.eventName ?? \"\") &&\n      record.attributes[\"session.id\"]\n    )\n      return;\n    record.setAttribute(\"session.id\", this.getSessionId());\n  }\n  async forceFlush(): Promise<void> {}\n  async shutdown(): Promise<void> {}\n}\n\nexport function sanitizeAttributes<T extends Record<string, unknown>>(\n  attrs: T,\n  redact: RedactUrlFn,\n): T {\n  return Object.fromEntries(\n    Object.entries(attrs).map(([key, value]) => [\n      key,\n      URL_ATTRIBUTES.has(key) && typeof value === \"string\" ? safeRedactUrl(redact, value) : value,\n    ]),\n  ) as T;\n}\n\n/** Record-time page context; initial resource page fields are deliberately absent. */\nexport class RumLogProcessor implements LogRecordProcessor {\n  private readonly document;\n  private readonly redact: RedactUrlFn;\n  private readonly navigationAttributes: (record: ReadWriteLogRecord) => Record<string, string>;\n  constructor(\n    redact: RedactUrlFn,\n    navigationAttributes: (record: ReadWriteLogRecord) => Record<string, string> = () => ({}),\n  ) {\n    this.navigationAttributes = navigationAttributes;\n    this.redact = redact;\n    this.document = createLocationDocumentProvider({\n      sanitizeUrl: (url) => safeRedactUrl(redact, url),\n    });\n  }\n  onEmit(record: ReadWriteLogRecord): void {\n    if (!record.attributes[\"browser.navigation.id\"])\n      record.setAttributes(this.navigationAttributes(record));\n    if (record.eventName === \"browser.resource_timing\") {\n      record.setAttribute(\n        \"corridora.resource.origin\",\n        classifyResourceUrl(String(record.attributes[\"url.full\"] ?? \"\"), location.origin),\n      );\n    }\n    try {\n      // Request-error logs carry the page/session from span start, even across SPA navigation.\n      if (\n        !record.attributes[\"browser.document.url.full\"] &&\n        record.attributes[\"browser.navigation.assignment\"] !== \"unavailable\"\n      ) {\n        record.setAttribute(\n          \"browser.document.url.full\",\n          this.document.getDocumentUrl() ?? \"[REDACTED]\",\n        );\n      }\n      if (record.eventName === \"browser.resource_timing\") {\n        const rawUrl = String(record.attributes[\"url.full\"] ?? \"\");\n        const entries = performance.getEntriesByName(rawUrl, \"resource\");\n        const start = Number(record.attributes[\"browser.resource_timing.fetch_start\"]);\n        const matches = entries.filter(\n          (entry) =>\n            Number.isFinite(start) && (entry as PerformanceResourceTiming).fetchStart === start,\n        );\n        const entry = matches.length === 1 ? (matches[0] as PerformanceResourceTiming) : undefined;\n        record.setAttributes(resourceTimingExtraAttributes(entry));\n      }\n    } catch {\n      /* instrumentation must not affect the host */\n    }\n    record.setAttributes(sanitizeAttributes(record.attributes, this.redact));\n  }\n  async forceFlush(): Promise<void> {}\n  async shutdown(): Promise<void> {}\n}\n\n/** Capture application span URLs as well as those emitted by auto-instrumentation. */\nexport class RumSpanProcessor implements SpanProcessor {\n  private readonly redact: RedactUrlFn;\n  private readonly logger: Logger;\n  private readonly navigationAttributes: () => Record<string, string>;\n  constructor(\n    redact: RedactUrlFn,\n    logger: Logger,\n    navigationAttributes: () => Record<string, string> = () => ({}),\n  ) {\n    this.navigationAttributes = navigationAttributes;\n    this.redact = redact;\n    this.logger = logger;\n  }\n  onStart(span: Span, _ctx: Context): void {\n    span.setAttributes(this.navigationAttributes());\n    span.setAttributes(sanitizeAttributes(span.attributes, this.redact));\n  }\n  onEnding(span: Span): void {\n    span.setAttributes(sanitizeAttributes(span.attributes, this.redact));\n  }\n  onEnd(span: ReadableSpan): void {\n    if (span.kind !== SpanKind.CLIENT || span.status.code !== SpanStatusCode.ERROR) return;\n    try {\n      const attributes = sanitizeAttributes(span.attributes, this.redact);\n      this.logger.emit({\n        eventName: \"browser.request.error\",\n        severityNumber: SeverityNumber.ERROR,\n        severityText: \"ERROR\",\n        body: String(attributes[\"error.type\"] ?? \"HTTP request failed\"),\n        context: trace.setSpanContext(ROOT_CONTEXT, span.spanContext()),\n        timestamp: span.endTime,\n        attributes: {\n          ...attributes,\n          \"browser.request.duration\": span.duration[0] * 1000 + span.duration[1] / 1e6,\n        },\n      });\n    } catch {\n      /* no error-loop if a log processor fails */\n    }\n  }\n  async forceFlush(): Promise<void> {}\n  async shutdown(): Promise<void> {}\n}\n", "import { ROOT_CONTEXT, type Context, type ContextManager } from \"@opentelemetry/api\";\n\n/** Synchronous context scopes for browser instrumentation, without patching promises. */\nexport function createStackContextManager(): ContextManager {\n  let current = ROOT_CONTEXT;\n  let enabled = false;\n  const manager: ContextManager = {\n    active: () => current,\n    with(context, fn, thisArg, ...args) {\n      const previous = current;\n      current = context || ROOT_CONTEXT;\n      try {\n        return fn.call(thisArg, ...args);\n      } finally {\n        current = previous;\n      }\n    },\n    bind<T>(context: Context | undefined, target: T): T {\n      if (typeof target !== \"function\") return target;\n      const boundContext = context === undefined ? current : context;\n      const bound = function (this: unknown, ...args: unknown[]) {\n        return manager.with(boundContext, () => target.apply(this, args));\n      };\n      Object.defineProperty(bound, \"length\", {\n        configurable: true,\n        value: target.length,\n      });\n      return bound as unknown as T;\n    },\n    enable() {\n      if (!enabled) {\n        current = ROOT_CONTEXT;\n        enabled = true;\n      }\n      return this;\n    },\n    disable() {\n      current = ROOT_CONTEXT;\n      enabled = false;\n      return this;\n    },\n  };\n  return manager;\n}\n", "import {\n  context,\n  createContextKey,\n  trace,\n  type Context,\n  type TextMapPropagator,\n} from \"@opentelemetry/api\";\nimport { W3CTraceContextPropagator } from \"@opentelemetry/core\";\n\nconst NO_PROPAGATION = createContextKey(\"corridora.no-propagation\");\nconst TRACE_HEADERS = [\"traceparent\", \"tracestate\", \"baggage\"];\nconst injecting = new WeakSet<object>();\nconst xhrRequests = new WeakMap<XMLHttpRequest, { propagate: boolean; ignored: boolean }>();\nexport const OTLP_URL = /\\/v1\\/(?:logs|traces|metrics)\\/?(?:\\?|$)/i;\n\nexport function originPatterns(origins: readonly string[]): RegExp[] {\n  return origins.map((origin) => new RegExp(`^${origin.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}/`));\n}\n\n/** Deliberately propagate only traceparent, including for unsampled spans. */\nexport function traceparentPropagator(): TextMapPropagator {\n  const w3c = new W3CTraceContextPropagator();\n  return {\n    inject(ctx, carrier, setter) {\n      if (ctx.getValue(NO_PROPAGATION)) return;\n      if (\n        typeof XMLHttpRequest !== \"undefined\" &&\n        carrier instanceof XMLHttpRequest &&\n        xhrRequests.get(carrier)?.propagate === false\n      )\n        return;\n      const parent = trace.getSpanContext(ctx);\n      const clean = parent ? trace.setSpanContext(ctx, { ...parent, traceState: undefined }) : ctx;\n      if (carrier && typeof carrier === \"object\") injecting.add(carrier);\n      try {\n        w3c.inject(clean, carrier, {\n          set: (c, key, value) => {\n            if (key === \"traceparent\") setter.set(c, key, value);\n          },\n        });\n      } finally {\n        if (carrier && typeof carrier === \"object\") injecting.delete(carrier);\n      }\n    },\n    extract: (ctx, carrier, getter) => w3c.extract(ctx, carrier, getter),\n    fields: () => [\"traceparent\"],\n  };\n}\n\nfunction eligible(url: URL, origins: readonly string[]): boolean {\n  return (\n    url.origin === location.origin || (url.protocol === \"https:\" && origins.includes(url.origin))\n  );\n}\n\n/**\n * Input adapter around OTel's fetch wrapper. It records no telemetry: OTel owns\n * spans, response-body timing and errors. Isolate objects that OTel mutates and\n * carry the no-cors decision through its propagation hook.\n */\nexport function protectFetchInputs(origins: readonly string[]): () => void {\n  const instrumented = globalThis.fetch;\n  const adapter: typeof fetch = function (input, init) {\n    let args: Parameters<typeof fetch> = arguments.length > 1 ? [input, init] : [input];\n    let ctx: Context = context.active();\n    try {\n      const request = input instanceof Request ? input : undefined;\n      const url = new URL(request?.url ?? String(input), document.baseURI);\n      if (OTLP_URL.test(url.href)) return Reflect.apply(instrumented, globalThis, args);\n      const mode = init?.mode ?? request?.mode;\n      const propagate = mode !== \"no-cors\" && eligible(url, origins);\n      ctx = ctx.setValue(NO_PROPAGATION, !propagate);\n      const headers = new Headers(init?.headers ?? request?.headers);\n      if (propagate) for (const key of TRACE_HEADERS) headers.delete(key);\n      // Transfer a Request body as native fetch does, without teeing an unread\n      // duplicate upload stream. Headers/init remain isolated from OTel mutation.\n      args = request ? [new Request(request, { ...init, headers })] : [input, { ...init, headers }];\n    } catch {\n      // Native fetch remains authoritative for malformed/consumed inputs.\n      ctx = ctx.setValue(NO_PROPAGATION, true);\n    }\n    return context.with(ctx, () => Reflect.apply(instrumented, globalThis, args));\n  };\n  globalThis.fetch = adapter;\n  return () => {\n    if (globalThis.fetch === adapter) globalThis.fetch = instrumented;\n  };\n}\n\n/**\n * XHR cannot replace a header once set (setRequestHeader appends). Defer caller\n * context headers until send, dropping stale context only on eligible requests.\n * Install before OTel so its new traceparent goes directly to the native setter.\n */\nexport function protectXhrHeaders(origins: readonly string[]): () => void {\n  const proto = XMLHttpRequest.prototype;\n  const open = proto.open;\n  const send = proto.send;\n  const setHeader = proto.setRequestHeader;\n  const pending = new WeakMap<\n    XMLHttpRequest,\n    { url: URL; headers: [string, string][]; sending: boolean }\n  >();\n  const adaptedOpen: typeof open = function (\n    this: XMLHttpRequest,\n    method,\n    url,\n    ...rest: unknown[]\n  ) {\n    pending.delete(this);\n    xhrRequests.delete(this);\n    const result = Reflect.apply(open, this, [method, url, ...rest]);\n    try {\n      const target = new URL(String(url), document.baseURI);\n      const ignored = OTLP_URL.test(target.href);\n      pending.set(this, { url: target, headers: [], sending: false });\n      xhrRequests.set(this, { ignored, propagate: !ignored && eligible(target, origins) });\n    } catch {}\n    return result;\n  };\n  const adaptedHeader: typeof setHeader = function (this: XMLHttpRequest, name, value) {\n    const record = pending.get(this);\n    if (\n      record &&\n      !record.sending &&\n      !injecting.has(this) &&\n      TRACE_HEADERS.includes(String(name).toLowerCase())\n    ) {\n      // Validate through the native API without storing any context on the wire.\n      // Headers checks syntax; readyState retains native InvalidStateError behavior.\n      new Headers([[name, value]]);\n      if (this.readyState !== XMLHttpRequest.OPENED) return setHeader.call(this, name, value);\n      record.headers.push([name, value]);\n      return;\n    }\n    return setHeader.call(this, name, value);\n  };\n  const adaptedSend: typeof send = function (this: XMLHttpRequest, body) {\n    const record = pending.get(this);\n    if (record) {\n      if (OTLP_URL.test(record.url.href) || !eligible(record.url, origins)) {\n        for (const [key, value] of record.headers) setHeader.call(this, key, value);\n      }\n      record.headers = [];\n      record.sending = true;\n    }\n    return send.call(this, body);\n  };\n  proto.open = adaptedOpen;\n  proto.setRequestHeader = adaptedHeader;\n  proto.send = adaptedSend;\n  return () => {\n    if (proto.open === adaptedOpen) proto.open = open;\n    if (proto.send === adaptedSend) proto.send = send;\n    if (proto.setRequestHeader === adaptedHeader) proto.setRequestHeader = setHeader;\n  };\n}\n", "import { createDiagnostics } from \"../diagnostics.ts\";\nimport { createNavigationContext } from \"../navigation.ts\";\nimport {\n  context,\n  diag,\n  DiagConsoleLogger,\n  DiagLogLevel,\n  propagation,\n  trace,\n  type TextMapPropagator,\n} from \"@opentelemetry/api\";\nimport { logs } from \"@opentelemetry/api-logs\";\nimport { CompositePropagator } from \"@opentelemetry/core\";\nimport { defaultResource, resourceFromAttributes } from \"@opentelemetry/resources\";\nimport {\n  createDocumentSpanProcessor,\n  createLocationDocumentProvider,\n} from \"@opentelemetry/browser-sdk/document\";\nimport { createSessionSpanProcessor } from \"@opentelemetry/browser-sdk/session\";\nimport { ErrorsInstrumentation } from \"@opentelemetry/browser-instrumentation/experimental/errors\";\nimport { FetchInstrumentation } from \"@opentelemetry/browser-instrumentation/experimental/fetch\";\nimport { XhrInstrumentation } from \"@opentelemetry/browser-instrumentation/experimental/xhr\";\nimport { NavigationInstrumentation } from \"@opentelemetry/browser-instrumentation/experimental/navigation\";\nimport { ResourceTimingInstrumentation } from \"@opentelemetry/browser-instrumentation/experimental/resource-timing\";\nimport { JsonLogsSerializer, JsonTraceSerializer } from \"@opentelemetry/otlp-transformer\";\nimport { ConsentHttpExporter } from \"./consent-exporter.ts\";\nimport { isEpochResource, isEpochTimestamp, type CaptureEpoch } from \"../consent-epoch.ts\";\nimport { createCaptureBudget } from \"../capture-policy.ts\";\nimport { registerInstrumentations, type Instrumentation } from \"@opentelemetry/instrumentation\";\nimport {\n  BatchLogRecordProcessor,\n  LoggerProvider,\n  type LogRecordProcessor,\n  type ReadableLogRecord,\n} from \"@opentelemetry/sdk-logs\";\nimport {\n  BatchSpanProcessor,\n  ParentBasedSampler,\n  TraceIdRatioBasedSampler,\n  TracerProvider,\n  type SpanProcessor,\n  type ReadableSpan,\n  type Sampler,\n} from \"@opentelemetry/sdk-trace\";\nimport type { ResolvedAgentConfig } from \"../config.ts\";\nimport { safeRedactUrl } from \"../plugins/config.ts\";\nimport { ResourceTimingCapExporter } from \"../resource-timing-caps.ts\";\nimport type { Emitter } from \"../types.ts\";\nimport { SCOPE_NAME, VERSION } from \"../version.ts\";\nimport { RumLogProcessor, RumSpanProcessor, RumSessionLogProcessor } from \"./processors.ts\";\nimport { createStackContextManager } from \"./context-manager.ts\";\nimport {\n  OTLP_URL,\n  originPatterns,\n  protectFetchInputs,\n  protectXhrHeaders,\n  traceparentPropagator,\n} from \"./network.ts\";\n\nlet diagnosticsConfigured = false;\n\nexport interface OtelRuntime {\n  emitter: Emitter;\n  forceFlush: () => Promise<void>;\n  shutdown: () => Promise<void>;\n  /** Synchronously close collection/transport and discard rather than flush. */\n  discard: () => Promise<void>;\n  resetNavigation: () => void;\n}\n\nexport function startOtelRuntime(\n  config: ResolvedAgentConfig,\n  resourceAttributes: Record<string, string>,\n  getSessionId: () => string,\n  onNavigation: () => void = () => {},\n  captureBudget = createCaptureBudget(),\n  diagnostic = createDiagnostics(config.onDiagnostic),\n  epoch: CaptureEpoch = { startedAt: performance.now(), isActive: () => true },\n): OtelRuntime {\n  const cleanup: Array<() => void> = [];\n  let captureOpen = true;\n  let transportOpen = true;\n  const active = () => captureOpen && epoch.isActive();\n  const transportEpoch: CaptureEpoch = {\n    startedAt: epoch.startedAt,\n    isActive: () => transportOpen && epoch.isActive(),\n  };\n  const logAllowed = (record: ReadableLogRecord) => {\n    if (!active() || !isEpochTimestamp(record.hrTime, epoch)) return false;\n    if ([\"browser.navigation_timing\", \"browser.web_vital\"].includes(record.eventName ?? \"\"))\n      return false;\n    return (\n      record.eventName !== \"browser.resource_timing\" || isEpochResource(record.attributes, epoch)\n    );\n  };\n  const gateLogProcessor = (processor: LogRecordProcessor): LogRecordProcessor => ({\n    onEmit(record, ctx) {\n      if (logAllowed(record)) processor.onEmit(record, ctx);\n    },\n    forceFlush: () => processor.forceFlush(),\n    shutdown: () => processor.shutdown(),\n  });\n  const gateSpanProcessor = (processor: SpanProcessor): SpanProcessor => ({\n    onStart(span, ctx) {\n      if (active() && isEpochTimestamp(span.startTime, epoch)) processor.onStart(span, ctx);\n    },\n    onEnding(span) {\n      if (active() && isEpochTimestamp(span.startTime, epoch)) processor.onEnding?.(span);\n    },\n    onEnd(span) {\n      if (active() && isEpochTimestamp(span.startTime, epoch)) processor.onEnd(span);\n    },\n    forceFlush: () => processor.forceFlush(),\n    shutdown: () => processor.shutdown(),\n  });\n  try {\n    const headers = { \"X-CORRIDORA-KEY\": config.ingestKey, \"X-Corridora-Ingest-Source\": \"rum\" };\n    const redact = (url: string) => safeRedactUrl(config.redactUrl, url);\n    const session = { getSessionId };\n    const navigation = createNavigationContext(redact(location.href), getSessionId);\n    const restoreVisit = (event: PageTransitionEvent) => {\n      if (active() && event.persisted) {\n        onNavigation();\n        navigation.restore(redact(location.href));\n      }\n    };\n    window.addEventListener(\"pageshow\", restoreVisit);\n    cleanup.push(() => window.removeEventListener(\"pageshow\", restoreVisit));\n    const navigationAttributes = (record?: {\n      eventName?: string;\n      attributes: Record<string, unknown>;\n    }): Record<string, string> => {\n      let identity =\n        record?.eventName === \"browser.resource_timing\"\n          ? navigation.document()\n          : navigation.current();\n      if (record?.eventName === \"browser.navigation_timing\") identity = navigation.document();\n      else if (record?.eventName === \"browser.resource_timing\") {\n        const start = Number(record.attributes[\"browser.resource_timing.fetch_start\"]);\n        const origin = Number.isFinite(start) ? navigation.at(start) : null;\n        if (!origin) return { \"browser.navigation.assignment\": \"unavailable\" };\n        identity = origin;\n      }\n      return {\n        \"browser.navigation.id\": identity.id,\n        ...(record ? { \"browser.document.url.full\": identity.url } : {}),\n        ...([\"browser.navigation_timing\", \"browser.resource_timing\"].includes(\n          record?.eventName ?? \"\",\n        )\n          ? { \"session.id\": identity.sessionId }\n          : {}),\n      };\n    };\n    const exporter = new ResourceTimingCapExporter(\n      new ConsentHttpExporter<ReadableLogRecord>({\n        url: config.signalEndpoints.logs,\n        headers,\n        serializer: JsonLogsSerializer,\n        epoch: transportEpoch,\n      }),\n      {\n        pageOrigin: () => location.origin,\n        onDiagnostic: diagnostic,\n        isActive: transportEpoch.isActive,\n      },\n    );\n    const logBatch = new BatchLogRecordProcessor({\n      exporter,\n      maxExportBatchSize: 20,\n      scheduledDelayMillis: 1000,\n    });\n    cleanup.push(() => {\n      void exporter.discard().catch(() => {});\n    });\n    const filteredBatch = {\n      onEmit(record: Parameters<typeof logBatch.onEmit>[0]) {\n        if (record.eventName === \"browser.navigation\") {\n          const sameDocument = record.attributes[\"browser.navigation.same_document\"] === true;\n          if (!(sameDocument ? config.plugins.spa : config.plugins.documentLoad)) return;\n        }\n        if (record.eventName?.startsWith(\"browser.user_action\")) {\n          record.setAttribute(\n            \"browser.css_selector\",\n            String(record.attributes[\"browser.tag_name\"] ?? \"\")\n              .toLowerCase()\n              .slice(0, 64),\n          );\n          delete record.attributes[\"browser.element.attributes\"];\n          if (!captureBudget.admit(record.attributes)) {\n            diagnostic(\"replay_dropped\");\n            return;\n          }\n        }\n        if (record.eventName === \"browser.console\") {\n          if (typeof record.body === \"string\") record.setBody(record.body.slice(0, 4096));\n          if (!captureBudget.admit({ attributes: record.attributes, body: record.body })) {\n            diagnostic(\"replay_dropped\");\n            return;\n          }\n        }\n        logBatch.onEmit(record);\n      },\n      forceFlush: () => logBatch.forceFlush(),\n      shutdown: () => logBatch.shutdown(),\n    };\n    // Own provider setup so the CDN bundle only includes our consent-aware\n    // exporters, rather than the SDK helpers' fallback transports and consoles.\n    if (!diagnosticsConfigured) {\n      diag.setLogger(new DiagConsoleLogger(), { logLevel: DiagLogLevel.NONE });\n      diagnosticsConfigured = true;\n    }\n    const resource = defaultResource().merge(resourceFromAttributes(resourceAttributes));\n    const loggerProvider = new LoggerProvider({\n      resource,\n      processors: [\n        gateLogProcessor(new RumLogProcessor(redact, navigationAttributes)),\n        gateLogProcessor(new RumSessionLogProcessor(getSessionId)),\n        gateLogProcessor(filteredBatch),\n      ],\n    });\n    cleanup.push(() => {\n      logs.disable();\n      void loggerProvider.shutdown().catch(() => {});\n    });\n    logs.setGlobalLoggerProvider(loggerProvider);\n    const logger = logs.getLogger(SCOPE_NAME, VERSION);\n    const spanExporter = new ConsentHttpExporter<ReadableSpan>({\n      url: config.signalEndpoints.traces,\n      headers,\n      serializer: JsonTraceSerializer,\n      epoch: transportEpoch,\n    });\n    cleanup.push(() => {\n      void spanExporter.discard().catch(() => {});\n    });\n    const spanBatch = new BatchSpanProcessor({\n      exporter: spanExporter,\n      maxExportBatchSize: 20,\n      scheduledDelayMillis: 1000,\n    });\n    const sampler = new ParentBasedSampler({\n      root: new TraceIdRatioBasedSampler(config.traceSampleRate),\n    });\n    const consentSampler: Sampler = {\n      shouldSample(...args) {\n        return active() ? sampler.shouldSample(...args) : { decision: 0 };\n      },\n      toString: () => \"CorridoraConsentSampler\",\n    };\n    const propagator = traceparentPropagator();\n    const consentPropagator: TextMapPropagator = {\n      inject(ctx, carrier, setter) {\n        if (active()) propagator.inject(ctx, carrier, setter);\n      },\n      extract: (ctx, carrier, getter) =>\n        active() ? propagator.extract(ctx, carrier, getter) : ctx,\n      fields: () => propagator.fields(),\n    };\n    const tracerProvider = new TracerProvider({\n      resource,\n      sampler: consentSampler,\n      spanProcessors: [\n        gateSpanProcessor(createSessionSpanProcessor(session)),\n        gateSpanProcessor(\n          createDocumentSpanProcessor(createLocationDocumentProvider({ sanitizeUrl: redact })),\n        ),\n        gateSpanProcessor(new RumSpanProcessor(redact, logger, navigationAttributes)),\n        gateSpanProcessor(spanBatch),\n      ],\n    });\n    cleanup.push(() => {\n      trace.disable();\n      propagation.disable();\n      context.disable();\n      void tracerProvider.shutdown().catch(() => {});\n    });\n    trace.setGlobalTracerProvider(tracerProvider);\n    propagation.setGlobalPropagator(new CompositePropagator({ propagators: [consentPropagator] }));\n    context.setGlobalContextManager(createStackContextManager().enable());\n    const tracer = trace.getTracer(SCOPE_NAME, VERSION);\n    const p = config.plugins;\n    const originalPush = history.pushState;\n    const originalReplace = history.replaceState;\n    let instrumentedPush: typeof history.pushState;\n    let instrumentedReplace: typeof history.replaceState;\n    cleanup.push(() => {\n      if (history.pushState === instrumentedPush) history.pushState = originalPush;\n      if (history.replaceState === instrumentedReplace) history.replaceState = originalReplace;\n    });\n    const originalFetch = globalThis.fetch;\n    const xhrProto = typeof XMLHttpRequest === \"undefined\" ? undefined : XMLHttpRequest.prototype;\n    const originalOpen = xhrProto?.open;\n    const originalSend = xhrProto?.send;\n    const restoreXhrHeaders =\n      p.xhr && xhrProto ? protectXhrHeaders(config.tracePropagationOrigins) : () => {};\n    cleanup.push(restoreXhrHeaders);\n    const instrumentations: Instrumentation[] = [];\n    cleanup.push(() => {\n      for (const instrumentation of instrumentations) instrumentation.disable();\n    });\n    const networkConfig = {\n      enabled: false,\n      ignoreUrls: [OTLP_URL],\n      propagateTraceHeaderCorsUrls: originPatterns(config.tracePropagationOrigins),\n      sanitizeUrl: redact,\n    };\n    if (p.errors) instrumentations.push(new ErrorsInstrumentation({ enabled: false }));\n    // Always track visits internally; filteredBatch enforces public capture flags.\n    instrumentations.push(\n      new NavigationInstrumentation({\n        enabled: false,\n        sanitizeUrl: redact,\n        applyCustomLogRecordData: (record) => {\n          if (!active()) return;\n          onNavigation();\n          const attrs = record.attributes ?? {};\n          const identity = navigation.navigate(\n            String(attrs[\"url.full\"] ?? redact(location.href)),\n            attrs[\"browser.navigation.same_document\"] === true,\n          );\n          record.attributes = { ...attrs, \"browser.navigation.id\": identity.id };\n          if (config.debug)\n            console.debug(\"[corridora-rum] navigation\", record.attributes?.[\"url.full\"]);\n        },\n      }),\n    );\n    // Navigation timing and Web Vitals describe the document from its start,\n    // which predates any grant in this document. Never backfill those aggregates.\n    if (p.resources)\n      instrumentations.push(\n        new ResourceTimingInstrumentation({ enabled: false, ignoreUrls: [OTLP_URL] }),\n      );\n    if (p.fetch) instrumentations.push(new FetchInstrumentation(networkConfig));\n    if (p.xhr && xhrProto) instrumentations.push(new XhrInstrumentation(networkConfig));\n    let unregister: () => void = () => {};\n    let instrumentedFetch = globalThis.fetch;\n    let instrumentedOpen = xhrProto?.open;\n    let instrumentedSend = xhrProto?.send;\n    cleanup.push(() => {\n      if (globalThis.fetch === instrumentedFetch) globalThis.fetch = originalFetch;\n      if (xhrProto?.open === instrumentedOpen && originalOpen) xhrProto.open = originalOpen;\n      if (xhrProto?.send === instrumentedSend && originalSend) xhrProto.send = originalSend;\n    });\n    // Capture owned wrappers even when enable() fails partway through registration.\n    try {\n      unregister = registerInstrumentations({ instrumentations });\n      for (const instrumentation of instrumentations) instrumentation.enable();\n    } finally {\n      instrumentedFetch = globalThis.fetch;\n      instrumentedOpen = xhrProto?.open;\n      instrumentedSend = xhrProto?.send;\n      instrumentedPush = history.pushState;\n      instrumentedReplace = history.replaceState;\n    }\n    cleanup.push(unregister);\n    const restoreFetchInputs = p.fetch\n      ? protectFetchInputs(config.tracePropagationOrigins)\n      : () => {};\n    cleanup.push(restoreFetchInputs);\n    let stopped = false;\n    let flushing: Promise<void> | undefined;\n    const forceFlush = (): Promise<void> =>\n      !transportEpoch.isActive()\n        ? Promise.resolve()\n        : (flushing ??= Promise.all([spanBatch.forceFlush(), logBatch.forceFlush()])\n            .then(() => exporter.forceFlush())\n            .finally(() => {\n              flushing = undefined;\n            }));\n    const emitter: Emitter = {\n      emitLog(event) {\n        if (stopped || !active()) return;\n        try {\n          logger.emit({\n            eventName: event.eventName,\n            attributes: event.attributes,\n            timestamp: event.startTimeMs,\n          });\n        } catch {}\n      },\n      emitSpan(event) {\n        if (stopped || !active()) return;\n        try {\n          const start = event.startTimeMs ?? Date.now();\n          const span = tracer.startSpan(event.name, {\n            attributes: event.attributes,\n            startTime: start,\n            kind: event.kind,\n          });\n          if (event.status) span.setStatus(event.status);\n          if (event.name === \"dom.mutation\" || event.name === \"user.interaction\") {\n            if (!span.isRecording()) {\n              diagnostic(\"replay_sampled\");\n              logger.emit({\n                eventName: \"browser.replay.status\",\n                attributes: {\n                  \"corridora.replay.complete\": \"false\",\n                  \"corridora.replay.sampled\": \"1\",\n                  \"corridora.replay.sequence\": String(\n                    event.attributes[\"corridora.replay.sequence\"] ?? \"\",\n                  ),\n                },\n              });\n            }\n          }\n          span.end(start + (event.durationMs ?? 1));\n        } catch {}\n      },\n      flush() {\n        void forceFlush().catch(() => {});\n      },\n    };\n    let finishing: Promise<void> | undefined;\n    let discardStarted = false;\n    let cancellation: Promise<PromiseSettledResult<void>[]> = Promise.resolve([]);\n    const cleanupErrors: unknown[] = [];\n    const finish = (discard: boolean): Promise<void> => {\n      const alreadyFinishing = finishing;\n      let resolveFinish!: () => void;\n      let rejectFinish!: (error: unknown) => void;\n      // Abort listeners and instrumentations can invoke host code synchronously.\n      // Reserve the lifecycle result before any such hook can reenter teardown.\n      if (!finishing) {\n        finishing = new Promise<void>((resolve, reject) => {\n          resolveFinish = resolve;\n          rejectFinish = reject;\n        });\n        stopped = true;\n        captureOpen = false;\n      }\n      // Closing transport and canceling work must also take effect if withdrawal\n      // arrives while an ordinary authorized shutdown/flush is already pending.\n      if (discard && !discardStarted) {\n        discardStarted = true;\n        transportOpen = false;\n        cancellation = Promise.allSettled(\n          [exporter, spanExporter].map((target) => {\n            try {\n              return target.discard();\n            } catch (error) {\n              return Promise.reject(error);\n            }\n          }),\n        );\n      }\n      if (alreadyFinishing) return finishing;\n      const stop = (fn: () => void) => {\n        try {\n          fn();\n        } catch (error) {\n          cleanupErrors.push(error);\n        }\n      };\n      stop(unregister);\n      for (const instrumentation of instrumentations) stop(() => instrumentation.disable());\n      stop(() => {\n        if (history.pushState === instrumentedPush) history.pushState = originalPush;\n      });\n      stop(() => {\n        if (history.replaceState === instrumentedReplace) history.replaceState = originalReplace;\n      });\n      stop(() => window.removeEventListener(\"pageshow\", restoreVisit));\n      stop(restoreFetchInputs);\n      stop(() => {\n        if (globalThis.fetch === instrumentedFetch) globalThis.fetch = originalFetch;\n      });\n      stop(() => {\n        if (xhrProto?.open === instrumentedOpen && originalOpen) xhrProto.open = originalOpen;\n      });\n      stop(() => {\n        if (xhrProto?.send === instrumentedSend && originalSend) xhrProto.send = originalSend;\n      });\n      stop(restoreXhrHeaders);\n      stop(() => logs.disable());\n      stop(() => trace.disable());\n      stop(() => propagation.disable());\n      stop(() => context.disable());\n      void (async () => {\n        if (discardStarted) await cancellation;\n        else await forceFlush().catch((error) => cleanupErrors.push(error));\n        const results = await Promise.allSettled([\n          tracerProvider.shutdown(),\n          loggerProvider.shutdown(),\n        ]);\n        for (const result of [...results, ...(await cancellation)])\n          if (result.status === \"rejected\") cleanupErrors.push(result.reason);\n        transportOpen = false;\n        if (cleanupErrors.length)\n          throw new AggregateError(cleanupErrors, \"RUM runtime cleanup failed\");\n      })().then(resolveFinish, rejectFinish);\n      return finishing;\n    };\n    return {\n      emitter,\n      forceFlush,\n      resetNavigation: () => {\n        if (active()) navigation.reset(redact(location.href));\n      },\n      shutdown: () => finish(false),\n      discard: () => finish(true),\n    };\n  } catch (error) {\n    captureOpen = false;\n    transportOpen = false;\n    for (const stop of cleanup.reverse()) {\n      try {\n        stop();\n      } catch {}\n    }\n    throw error;\n  }\n}\n", "import { randomId } from \"./identity.ts\";\n/** Versioned per-service session storage; telemetry itself is not user activity. */\nexport const SESSION_IDLE_MS = 30 * 60_000;\nexport const SESSION_MAX_MS = 24 * 60 * 60_000;\ninterface SessionState {\n  version: 1;\n  id: string;\n  startedAt: number;\n  lastActivityAt: number;\n}\ninterface StorageLike {\n  getItem(key: string): string | null;\n  setItem(key: string, value: string): void;\n  removeItem?(key: string): void;\n}\n\nexport function createSessionManager(options: {\n  service: string;\n  storage?: StorageLike;\n  now?: () => number;\n  newId?: () => string;\n  /** Consent grants start a fresh capture session rather than restoring one. */\n  fresh?: boolean;\n}) {\n  const now = options.now ?? Date.now;\n  const newId = options.newId ?? randomId;\n  const key = `corridora.session.v1:${options.service}`;\n  let state: SessionState | undefined;\n  let cleared = false;\n  try {\n    const stored = JSON.parse(\n      options.fresh ? \"null\" : (options.storage?.getItem(key) ?? \"null\"),\n    ) as SessionState | null;\n    if (\n      stored?.version === 1 &&\n      typeof stored.id === \"string\" &&\n      /^[a-zA-Z0-9-]{16,64}$/.test(stored.id) &&\n      Number.isSafeInteger(stored.startedAt) &&\n      Number.isSafeInteger(stored.lastActivityAt) &&\n      stored.startedAt <= stored.lastActivityAt\n    )\n      state = stored;\n  } catch {\n    /* Memory-only operation also works when browser storage is blocked. */\n  }\n  function persist() {\n    try {\n      options.storage?.setItem(key, JSON.stringify(state));\n    } catch {}\n  }\n  function current(at: number): SessionState {\n    if (\n      !state ||\n      at < state.lastActivityAt ||\n      at - state.lastActivityAt >= SESSION_IDLE_MS ||\n      at - state.startedAt >= SESSION_MAX_MS\n    ) {\n      state = { version: 1, id: newId(), startedAt: at, lastActivityAt: at };\n      persist();\n    }\n    return state;\n  }\n  return {\n    getSessionId(): string {\n      if (cleared) return \"\";\n      return current(now()).id;\n    },\n    activity(): void {\n      if (cleared) return;\n      const at = now();\n      current(at).lastActivityAt = at;\n      persist();\n    },\n    reset(): string {\n      if (cleared) return \"\";\n      state = undefined;\n      return current(now()).id;\n    },\n    clear(): void {\n      cleared = true;\n      state = undefined;\n      try {\n        options.storage?.removeItem?.(key);\n      } catch {\n        // Blocked storage cannot prevent withdrawal or recreate identity.\n      }\n    },\n  };\n}\n", "/** Corridora distribution over OpenTelemetry browser instrumentation and SDKs. */\nimport { createCaptureBudget } from \"./capture-policy.ts\";\nimport { preflight } from \"./identity.ts\";\nimport { createDiagnostics } from \"./diagnostics.ts\";\nimport { buildResourceAttributes, type RumContext } from \"./context.ts\";\nimport {\n  normalizeConsent,\n  resolveConfig,\n  type ConsentState,\n  type CorridoraAgentConfig,\n  type ResolvedAgentConfig,\n} from \"./config.ts\";\nimport { createCaptureEpoch, type CaptureEpoch, type ConsentOptions } from \"./consent-epoch.ts\";\nimport { startLongTaskPlugin } from \"./plugins/runtime.ts\";\nimport { startOtelRuntime, type OtelRuntime } from \"./otel/setup.ts\";\nimport { sanitizeAttributes } from \"./otel/processors.ts\";\nimport { SCOPE_NAME, VERSION } from \"./version.ts\";\nimport { createSessionManager, SESSION_IDLE_MS, SESSION_MAX_MS } from \"./session.ts\";\n\nexport { VERSION } from \"./version.ts\";\nexport type { ConsentState, CorridoraAgentConfig, ResolvedAgentConfig };\nexport type { ConsentOptions };\nexport type { RumDiagnostic } from \"./config.ts\";\nexport {\n  resolveConfig,\n  normalizeOtlpBase,\n  normalizeTracePropagationOrigins,\n  otlpSignalEndpoints,\n} from \"./config.ts\";\n\nexport interface RumAgent extends ResolvedAgentConfig {\n  getConsent(): ConsentState;\n  setConsent(state: ConsentState, options?: ConsentOptions): Promise<void>;\n  forceFlush(): Promise<void>;\n  shutdown(): Promise<void>;\n  /** Start a new session, for example when the application logs out. */\n  resetSession(): void;\n}\nlet activeAgent: RumAgent | undefined;\nlet initializationStatus: \"idle\" | \"pending\" | \"denied\" | \"ready\" | \"failed\" = \"idle\";\nexport function getInitializationStatus() {\n  return initializationStatus;\n}\n\nexport function getConsent(): ConsentState {\n  return activeAgent?.getConsent() ?? \"pending\";\n}\n\nexport function setConsent(state: ConsentState, options?: ConsentOptions): Promise<void> {\n  // The host must initialize a controller before granting its analytics purpose.\n  return activeAgent?.setConsent(state, options) ?? Promise.resolve();\n}\n\ninterface CaptureRuntime {\n  forceFlush(): Promise<void>;\n  resetSession(): void;\n  stop(discard: boolean): Promise<void>;\n}\n\nfunction startCapture(resolved: ResolvedAgentConfig, epoch: CaptureEpoch): CaptureRuntime {\n  const stops: Array<() => void> = [];\n  let otel: OtelRuntime | undefined;\n  let sessions: ReturnType<typeof createSessionManager> | undefined;\n  try {\n    preflight();\n    let storage: Storage | undefined;\n    try {\n      storage = window.sessionStorage;\n    } catch {}\n    sessions = createSessionManager({ service: resolved.serviceName, storage, fresh: true });\n    const session = sessions;\n    sessions.activity();\n    const id = sessions.getSessionId();\n    const ctx: RumContext = { sessionId: id, userAgent: navigator.userAgent };\n    const resourceAttributes = sanitizeAttributes(\n      buildResourceAttributes(\n        {\n          ...resolved,\n          resourceAttributes: {\n            ...resolved.resourceAttributes,\n            \"telemetry.distro.name\": SCOPE_NAME,\n            \"telemetry.distro.version\": VERSION,\n            \"corridora.capture.trace_sample_rate\": String(resolved.traceSampleRate),\n            ...Object.fromEntries(\n              Object.entries(resolved.plugins).map(([key, value]) => [\n                `corridora.capture.plugins.${key}`,\n                String(value),\n              ]),\n            ),\n            \"corridora.session.boundary.version\": \"1\",\n            \"corridora.session.idle_timeout_ms\": String(SESSION_IDLE_MS),\n            \"corridora.session.max_duration_ms\": String(SESSION_MAX_MS),\n          },\n        },\n        ctx,\n      ),\n      resolved.redactUrl,\n    );\n    // Session and document context belong to records, not a frozen page resource.\n    for (const key of [\"session.id\", \"page.route\", \"page.url\", \"browser.document.url.full\"])\n      delete resourceAttributes[key];\n    // A host redaction hook can synchronously withdraw during construction.\n    if (!epoch.isActive()) {\n      session.clear();\n      return {\n        async forceFlush() {},\n        resetSession() {},\n        async stop() {},\n      };\n    }\n    const activity = (event: Event) => {\n      if (epoch.isActive() && event.isTrusted) session.activity();\n    };\n    stops.push(() => {\n      window.removeEventListener(\"pointerdown\", activity, true);\n      window.removeEventListener(\"keydown\", activity, true);\n    });\n    window.addEventListener(\"pointerdown\", activity, true);\n    window.addEventListener(\"keydown\", activity, true);\n    const captureBudget = createCaptureBudget();\n    const diagnostic = createDiagnostics(resolved.onDiagnostic);\n    otel = startOtelRuntime(\n      resolved,\n      resourceAttributes,\n      session.getSessionId,\n      () => {\n        if (epoch.isActive()) session.activity();\n      },\n      captureBudget,\n      diagnostic,\n      epoch,\n    );\n    const runtime = otel;\n    if (resolved.plugins.longTasks)\n      stops.push(startLongTaskPlugin(runtime.emitter, epoch.startedAt, epoch.isActive));\n    const flush = () => {\n      if (epoch.isActive()) void runtime.forceFlush().catch(() => {});\n    };\n    const hide = () => {\n      if (document.visibilityState === \"hidden\") flush();\n    };\n    stops.push(() => {\n      window.removeEventListener(\"pagehide\", flush);\n      document.removeEventListener(\"visibilitychange\", hide);\n    });\n    window.addEventListener(\"pagehide\", flush);\n    document.addEventListener(\"visibilitychange\", hide);\n    let stopPromise: Promise<void> | undefined;\n    return {\n      forceFlush: () => (epoch.isActive() ? runtime.forceFlush() : Promise.resolve()),\n      resetSession() {\n        if (!epoch.isActive()) return;\n        session.reset();\n        runtime.resetNavigation();\n      },\n      stop(discard) {\n        if (stopPromise) {\n          if (discard) {\n            session.clear();\n            return Promise.all([stopPromise, runtime.discard()]).then(() => {});\n          }\n          return stopPromise;\n        }\n        let resolveStop!: () => void;\n        let rejectStop!: (error: unknown) => void;\n        const operation = new Promise<void>((resolve, reject) => {\n          resolveStop = resolve;\n          rejectStop = reject;\n        });\n        stopPromise = operation;\n        const failures: unknown[] = [];\n        for (const stop of stops.reverse()) {\n          try {\n            stop();\n          } catch (error) {\n            failures.push(error);\n          }\n        }\n        // discard() stops instrumentation and aborts exports synchronously,\n        // before its asynchronous provider cleanup finishes.\n        let stopped: Promise<void>;\n        try {\n          stopped = discard ? runtime.discard() : runtime.shutdown();\n        } catch (error) {\n          stopped = Promise.reject(error);\n        }\n        if (discard) session.clear();\n        void stopped\n          .catch((error) => {\n            failures.push(error);\n          })\n          .then(() => {\n            if (failures.length) rejectStop(new AggregateError(failures, \"RUM cleanup failed\"));\n            else resolveStop();\n          });\n        return operation;\n      },\n    };\n  } catch (error) {\n    for (const stop of stops.reverse()) {\n      try {\n        stop();\n      } catch {}\n    }\n    if (otel) void otel.discard().catch(() => {});\n    sessions?.clear();\n    throw error;\n  }\n}\n\n/** Repeated initialization returns the controller; decisions change through setConsent. */\nexport function init(config: CorridoraAgentConfig): RumAgent {\n  // Server renders must not share browser controllers across requests/tenants.\n  if (typeof window === \"undefined\") {\n    const resolved = resolveConfig(config);\n    let consent = resolved.consent;\n    return {\n      ...resolved,\n      get consent() {\n        return consent;\n      },\n      getConsent: () => consent,\n      async setConsent(value) {\n        if (resolved.requireAnalyticsConsent) consent = normalizeConsent(value);\n      },\n      async forceFlush() {},\n      async shutdown() {},\n      resetSession() {},\n    };\n  }\n  if (activeAgent) return activeAgent;\n  const resolved = resolveConfig(config);\n  let consent = resolved.consent;\n  let revision = 0;\n  let closed = false;\n  let capture: CaptureRuntime | undefined;\n  let closeEpoch: (() => void) | undefined;\n  let serial = Promise.resolve();\n  let decision = serial;\n  let cleanupFailure: unknown;\n  let starting: Promise<void> | undefined;\n  let shutdownPromise: Promise<void> | undefined;\n  const diagnostic = createDiagnostics(config.onDiagnostic);\n\n  function start(options?: ConsentOptions) {\n    if (closed || consent !== \"granted\" || typeof window === \"undefined\") return;\n    if (cleanupFailure) {\n      initializationStatus = \"failed\";\n      throw cleanupFailure;\n    }\n    const epochRevision = revision;\n    const epoch = createCaptureEpoch(options, () => {\n      if (closed) {\n        // Expiry during an authorized shutdown must also upgrade its flush to\n        // discard and remove the session identity.\n        consent = \"pending\";\n        void capture?.stop(true).catch(() => {});\n        return;\n      }\n      if (revision !== epochRevision || consent !== \"granted\") return;\n      consent = \"pending\";\n      revision++;\n      initializationStatus = \"pending\";\n      void withdraw().catch(() => {});\n    });\n    closeEpoch = epoch.close;\n    let finishStartup!: () => void;\n    let failStartup!: (error: unknown) => void;\n    const startup = new Promise<void>((resolve, reject) => {\n      finishStartup = resolve;\n      failStartup = reject;\n    });\n    starting = startup;\n    void startup.then(\n      () => {\n        if (starting === startup) starting = undefined;\n      },\n      () => {\n        if (starting === startup) starting = undefined;\n      },\n    );\n    try {\n      // Validate before creating identity or touching storage. No host expiry\n      // timer needs to run for an expired or stale decision to stay inactive.\n      if (!epoch.isActive()) {\n        finishStartup();\n        return;\n      }\n      const runtime = startCapture(resolved, epoch);\n      // Host callbacks may reenter setConsent/shutdown during startup. Any\n      // newer decision waits for this abandoned runtime to be discarded.\n      if (!epoch.isActive() || closed || consent !== \"granted\") {\n        epoch.close();\n        void runtime.stop(true).then(finishStartup, (error) => {\n          cleanupFailure = error;\n          diagnostic(\"consent_cleanup_failed\");\n          failStartup(error);\n        });\n        return;\n      }\n      capture = runtime;\n      initializationStatus = \"ready\";\n      finishStartup();\n    } catch (error) {\n      epoch.close();\n      if (consent === \"granted\" && !closed) initializationStatus = \"failed\";\n      failStartup(error);\n      diagnostic(\"initialization_failed\");\n      throw error;\n    }\n  }\n\n  function enqueue(work: () => Promise<void> | void): Promise<void> {\n    const operation = serial.then(work);\n    // Keep the lifecycle usable after a rejected decision, without hiding the\n    // rejection from the caller. Cleanup failures separately prevent restart.\n    serial = operation.catch(() => {});\n    return operation;\n  }\n\n  function withdraw(): Promise<void> {\n    let resolveCleanup!: () => void;\n    let rejectCleanup!: (error: unknown) => void;\n    const barrier = new Promise<void>((resolve, reject) => {\n      resolveCleanup = resolve;\n      rejectCleanup = reject;\n    });\n    // Reserve the lifecycle slot before teardown can invoke a host callback\n    // that requests another grant.\n    const operation = enqueue(() => barrier);\n    decision = operation;\n    closeEpoch?.();\n    const previous = capture;\n    capture = undefined;\n    let stopping: Promise<void>;\n    try {\n      stopping = previous?.stop(true) ?? starting ?? Promise.resolve();\n    } catch (error) {\n      stopping = Promise.reject(error);\n    }\n    // Begin cleanup immediately; serialize a later grant behind its completion.\n    void barrier.catch(() => {});\n    void stopping.then(resolveCleanup, (error) => {\n      cleanupFailure = error;\n      diagnostic(\"consent_cleanup_failed\");\n      rejectCleanup(error);\n    });\n    return operation;\n  }\n\n  const agent: RumAgent = {\n    ...resolved,\n    get consent() {\n      return consent;\n    },\n    getConsent: () => consent,\n    setConsent(value, options) {\n      if (!resolved.requireAnalyticsConsent) return decision;\n      const next = normalizeConsent(value);\n      if (closed) {\n        if (next !== \"granted\") {\n          consent = next;\n          closeEpoch?.();\n          return capture?.stop(true) ?? Promise.resolve();\n        }\n        return Promise.resolve();\n      }\n      if (next === consent && !(next === \"granted\" && options !== undefined)) return decision;\n      // Copy the validity contract now: mutation of the caller's options must\n      // not revive an old capture epoch or extend its deadline.\n      const validity =\n        next === \"granted\" && options !== undefined\n          ? { expiresAt: options.expiresAt, isCurrent: options.isCurrent }\n          : undefined;\n      consent = next;\n      const currentRevision = ++revision;\n      if (next !== \"granted\") {\n        initializationStatus = next;\n        return withdraw();\n      }\n      initializationStatus = \"pending\";\n      if (capture || starting) withdraw();\n      return (decision = enqueue(() => {\n        if (closed || currentRevision !== revision || consent !== \"granted\") return;\n        start(validity);\n      }));\n    },\n    forceFlush: () =>\n      consent === \"granted\" && !closed ? (capture?.forceFlush() ?? decision) : Promise.resolve(),\n    resetSession() {\n      if (consent === \"granted\" && !closed) capture?.resetSession();\n    },\n    shutdown() {\n      if (shutdownPromise) return shutdownPromise;\n      closed = true;\n      revision++;\n      let resolveShutdown!: () => void;\n      let rejectShutdown!: (error: unknown) => void;\n      const barrier = new Promise<void>((resolve, reject) => {\n        resolveShutdown = resolve;\n        rejectShutdown = reject;\n      });\n      void barrier.catch(() => {});\n      shutdownPromise = enqueue(() => barrier).finally(() => {\n        closeEpoch?.();\n        capture = undefined;\n        if (activeAgent === agent) {\n          activeAgent = undefined;\n          initializationStatus = \"idle\";\n        }\n      });\n      // Ordinary shutdown can flush data from a still-authorized epoch. A later\n      // denial, even during this flush, must still be able to close its gates.\n      const current = capture;\n      let stopping: Promise<void>;\n      try {\n        // If a host callback shuts down during construction, close that epoch\n        // now and wait until its partially constructed runtime is discarded.\n        if (!current) closeEpoch?.();\n        stopping = current?.stop(consent !== \"granted\") ?? starting ?? Promise.resolve();\n      } catch (error) {\n        stopping = Promise.reject(error);\n      }\n      void stopping.then(resolveShutdown, rejectShutdown);\n      return shutdownPromise;\n    },\n  };\n  activeAgent = agent;\n  initializationStatus = consent === \"granted\" ? \"pending\" : consent;\n  try {\n    if (consent === \"granted\") start();\n  } catch (error) {\n    activeAgent = undefined;\n    throw error;\n  }\n  return agent;\n}\n\nexport { buildResourceAttributes, parseUserAgent } from \"./context.ts\";\nexport type { RumContext, ParsedUserAgent, DeviceType } from \"./context.ts\";\nexport { lcpElementSelector } from \"./lcp.ts\";\nexport type { ElementLike } from \"./lcp.ts\";\nexport { attributeLayoutShift } from \"./cls.ts\";\nexport type { LayoutShiftEntryLike, LayoutShiftSource, LayoutShiftAttribution } from \"./cls.ts\";\nexport type { ExportMode, RedactUrlFn, RumPluginConfig } from \"./plugins/config.ts\";\nexport { resolvePlugins } from \"./plugins/config.ts\";\nexport type {\n  Emitter,\n  LogEvent,\n  MetricEvent,\n  SpanAttributeValue,\n  SpanEvent,\n  SpanKind,\n  SpanStatus,\n} from \"./types.ts\";\nexport { spaNavigationAttributes } from \"./plugins/runtime.ts\";\n", "import type { CorridoraAgentConfig } from \"./config.ts\";\nimport type { RumPluginConfig } from \"./plugins/config.ts\";\ninterface ScriptAttributes {\n  getAttribute(name: string): string | null;\n}\n\nfunction attr(script: ScriptAttributes, name: string): string {\n  return (script.getAttribute(name) ?? \"\").trim();\n}\n\n/** Comma-separated script-tag origins; config resolution validates each entry. */\nexport function tracePropagationOriginsFromScript(script: ScriptAttributes): string[] {\n  return attr(script, \"data-trace-origins\")\n    .split(\",\")\n    .map((origin) => origin.trim())\n    .filter(Boolean);\n}\n\n/** Resource attributes supplied by the host application through its script tag. */\nexport function resourceAttributesFromScript(script: ScriptAttributes): Record<string, string> {\n  const serviceNamespace = attr(script, \"data-service-namespace\");\n  const serviceVersion = attr(script, \"data-version\");\n  return {\n    \"deployment.environment.name\": attr(script, \"data-env\") || \"production\",\n    ...(serviceNamespace ? { \"service.namespace\": serviceNamespace } : {}),\n    ...(serviceVersion ? { \"service.version\": serviceVersion } : {}),\n  };\n}\n\n/** Script parsing is an adapter; resolveConfig remains the validation authority. */\nexport function optionsFromScript(script: ScriptAttributes): Partial<CorridoraAgentConfig> {\n  const mapping: Record<keyof RumPluginConfig, string> = {\n    documentLoad: \"document-load\",\n    webVitals: \"web-vitals\",\n    fetch: \"fetch\",\n    xhr: \"xhr\",\n    resources: \"resources\",\n    spa: \"spa\",\n    errors: \"errors\",\n    console: \"console\",\n    userActions: \"user-actions\",\n    longTasks: \"long-tasks\",\n    interactions: \"interactions\",\n    domMutations: \"dom-mutations\",\n  };\n  const boolean = (name: string): boolean | undefined => {\n    const value = script.getAttribute(name);\n    if (value === null) return undefined;\n    const raw = value.trim().toLowerCase();\n    if ([\"\", \"1\", \"true\", \"yes\"].includes(raw)) return true;\n    if ([\"0\", \"false\", \"no\"].includes(raw)) return false;\n    throw new Error(\"invalid boolean script option\");\n  };\n  const plugins: RumPluginConfig = {};\n  for (const [key, suffix] of Object.entries(mapping)) {\n    const value = boolean(`data-${suffix}`);\n    if (value !== undefined) plugins[key as keyof RumPluginConfig] = value;\n  }\n  const sampleRate = script.getAttribute(\"data-trace-sample-rate\");\n  const encoding = attr(script, \"data-encoding\");\n  const consent = attr(script, \"data-consent\");\n  if (sampleRate !== null && !sampleRate.trim()) throw new Error(\"empty trace sample rate\");\n  if (encoding && encoding !== \"json\") throw new Error(\"Only JSON encoding is supported\");\n  return {\n    // Missing and unrecognized CMP choices must never imply permission.\n    consent: consent === \"granted\" || consent === \"denied\" ? consent : \"pending\",\n    requireAnalyticsConsent: boolean(\"data-require-analytics-consent\") ?? true,\n    plugins,\n    debug: boolean(\"data-debug\") ?? false,\n    ...(sampleRate !== null ? { traceSampleRate: Number(sampleRate) } : {}),\n    ...(encoding ? { encoding: \"json\" as const } : {}),\n  };\n}\n", "/**\n * Browser IIFE entry for the Corridora CDN install tag.\n * Auto-inits from data-* attributes on the loading <script> tag.\n */\nimport {\n  getConsent,\n  getInitializationStatus,\n  init,\n  setConsent,\n  type CorridoraAgentConfig,\n} from \"./index.ts\";\nimport {\n  optionsFromScript,\n  resourceAttributesFromScript,\n  tracePropagationOriginsFromScript,\n} from \"./script-metadata.ts\";\n\nexport type { CorridoraAgentConfig };\nexport { getConsent, init, setConsent };\n\nexport interface CorridoraRumGlobal {\n  /** Version 2 supports live validity guards and absolute expiry deadlines. */\n  readonly consentVersion: 2;\n  init: typeof init;\n  getConsent: typeof getConsent;\n  setConsent: typeof setConsent;\n  getInitializationStatus: typeof getInitializationStatus;\n}\n\ndeclare global {\n  interface Window {\n    CorridoraRum?: CorridoraRumGlobal;\n  }\n}\n\nlet autoBootFailed = false;\n\n/** The beacon replaces this fixed-width marker without shifting source-map columns. */\nfunction withBeaconConsentPolicy(config: CorridoraAgentConfig): CorridoraAgentConfig {\n  const policy = String(\"__CORRIDORA_REQUIRE_ANALYTICS_CONSENT__\").trim();\n  return policy === \"true\" || policy === \"false\"\n    ? { ...config, requireAnalyticsConsent: policy === \"true\" }\n    : config;\n}\n\nfunction attr(script: Pick<HTMLScriptElement, \"getAttribute\">, name: string): string {\n  return (script.getAttribute(name) ?? \"\").trim();\n}\n\nfunction keyFromScriptUrl(script: HTMLScriptElement): string {\n  try {\n    return new URL(script.src, window.location.href).searchParams.get(\"ckid\")?.trim() ?? \"\";\n  } catch {\n    return \"\";\n  }\n}\n\n/** Boot from <script src=\"\u2026/corridora-rum.js\" data-endpoint data-key data-service \u2026>. */\nexport function bootFromScript(\n  script: HTMLScriptElement | null = document.currentScript as HTMLScriptElement | null,\n): void {\n  if (!script) return;\n  const endpoint = attr(script, \"data-endpoint\");\n  const ingestKey = attr(script, \"data-key\") || keyFromScriptUrl(script);\n  const serviceName = attr(script, \"data-service\") || window.location.hostname;\n  if (!endpoint || !ingestKey) return;\n\n  try {\n    init(\n      withBeaconConsentPolicy({\n        endpoint,\n        ingestKey,\n        serviceName,\n        ...optionsFromScript(script),\n        tracePropagationOrigins: tracePropagationOriginsFromScript(script),\n        resourceAttributes: resourceAttributesFromScript(script),\n      }),\n    );\n  } catch {\n    autoBootFailed = true;\n    /* never break the host page */\n  }\n}\n\nif (typeof window !== \"undefined\") {\n  window.CorridoraRum = {\n    consentVersion: 2,\n    init(config) {\n      const agent = init(withBeaconConsentPolicy(config));\n      autoBootFailed = false;\n      return agent;\n    },\n    getConsent,\n    setConsent,\n    getInitializationStatus: () =>\n      autoBootFailed && getInitializationStatus() !== \"ready\"\n        ? \"failed\"\n        : getInitializationStatus(),\n  };\n  bootFromScript();\n}\n"],
  "mappings": "2LAmBO,SAASA,GAAeC,EAAsD,CACnF,MAAO,CACL,aAAcA,GAAS,eAAiB,GACx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AiB,GAGrB,SAASC,GAAwBC,EAAoD,CACnF,IAAMC,EAAgB,0CAA2C,KAAK,EACtE,OAAOA,IAAW,QAAUA,IAAW,QACnC,CAAE,GAAGD,EAAQ,wBAAyBC,IAAW,MAAO,EACxDD,CACN,CAEA,SAASE,GAAKC,EAAiDC,EAAsB,CACnF,OAAQD,EAAO,aAAaC,CAAI,GAAK,IAAI,KAAK,CAChD,CAEA,SAASC,GAAiBF,EAAmC,CAC3D,GAAI,CACF,OAAO,IAAI,IAAIA,EAAO,IAAK,OAAO,SAAS,IAAI,EAAE,aAAa,IAAI,MAAM,GAAG,KAAK,GAAK,EACvF,MAAQ,CACN,MAAO,EACT,CACF,CAGO,SAASG,GACdH,EAAmC,SAAS,cACtC,CACN,GAAI,CAACA,EAAQ,OACb,IAAMI,EAAWL,GAAKC,EAAQ,eAAe,EACvCK,EAAYN,GAAKC,EAAQ,UAAU,GAAKE,GAAiBF,CAAM,EAC/DM,EAAcP,GAAKC,EAAQ,cAAc,GAAK,OAAO,SAAS,SACpE,GAAI,GAACI,GAAY,CAACC,GAElB,GAAI,CACFE,GACEX,GAAwB,CACtB,SAAAQ,EACA,UAAAC,EACA,YAAAC,EACA,GAAGE,GAAkBR,CAAM,EAC3B,wBAAyBS,GAAkCT,CAAM,EACjE,mBAAoBU,GAA6BV,CAAM,CACzD,CAAC,CACH,CACF,MAAQ,CACNL,GAAiB,EAEnB,CACF,CAEI,OAAO,OAAW,MACpB,OAAO,aAAe,CACpB,eAAgB,EAChB,KAAKE,EAAQ,CACX,IAAMc,EAAQJ,GAAKX,GAAwBC,CAAM,CAAC,EAClD,OAAAF,GAAiB,GACVgB,CACT,EACA,WAAAC,GACA,WAAAC,GACA,wBAAyB,IACvBlB,IAAkBmB,GAAwB,IAAM,QAC5C,SACAA,GAAwB,CAChC,EACAX,GAAe",
  "names": ["resolvePlugins", "plugins", "defaultRedactUrl", "url", "u", "key", "safeRedactUrl", "redact", "CAPTURE_EVENTS", "CAPTURE_BYTES", "createCaptureBudget", "now", "at", "events", "bytes", "dropped", "value", "current", "size", "CAPTURE_EVENTS", "CAPTURE_BYTES", "randomId", "n", "preflight", "createDiagnostics", "callback", "calls", "running", "code", "count", "firstMatch", "ua", "re", "parseUserAgent", "s", "browserName", "browserVersion", "deviceType", "buildResourceAttributes", "config", "ctx", "attrs", "normalizeConsent", "value", "trimTrailingSlash", "url", "normalizeOtlpBase", "endpoint", "base", "otlpSignalEndpoints", "root", "normalizeTracePropagationOrigins", "origins", "normalized", "raw", "resolveConfig", "config", "traceSampleRate", "resolvePlugins", "defaultRedactUrl", "createCaptureEpoch", "options", "invalidated", "startedAt", "now", "expiresAt", "isCurrent", "active", "checking", "valid", "isEpochTimestamp", "timestamp", "epoch", "timeOrigin", "isEpochResource", "attributes", "start", "key", "earlier", "matches", "entry", "longTaskAttributes", "entry", "startLongTaskPlugin", "emitter", "startedAt", "isActive", "observer", "list", "createNavigationContext", "url", "getSessionId", "newId", "randomId", "now", "document", "current", "history", "sessionId", "nextUrl", "sameDocument", "relativeMs", "item", "VERSION", "re", "_makeCompatibilityCheck", "ownVersion", "acceptedVersions", "rejectedVersions", "myVersionMatch", "ownVersionParsed", "globalVersion", "_reject", "v", "_accept", "globalVersionMatch", "globalVersionParsed", "isCompatible", "VERSION", "major", "VERSION", "GLOBAL_OPENTELEMETRY_API_KEY", "_global", "registerGlobal", "type", "instance", "diag", "allowOverride", "api", "_a", "err", "getGlobal", "globalVersion", "isCompatible", "_b", "unregisterGlobal", "DiagComponentLogger", "props", "args", "logProxy", "funcName", "namespace", "logger", "getGlobal", "DiagLogLevel", "createLogLevelDiagLogger", "maxLevel", "logger", "DiagLogLevel", "_filterFunc", "funcName", "theLevel", "theFunc", "API_NAME", "DiagAPI", "_DiagAPI", "_logProxy", "funcName", "args", "logger", "getGlobal", "self", "setLogger", "optionsOrLogLevel", "DiagLogLevel", "err", "_a", "oldLogger", "newLogger", "createLogLevelDiagLogger", "_b", "stack", "_c", "registerGlobal", "unregisterGlobal", "options", "DiagComponentLogger", "BaggageImpl", "_BaggageImpl", "entries", "key", "entry", "newBaggage", "keys", "diag", "DiagAPI", "createBaggage", "entries", "BaggageImpl", "createContextKey", "description", "BaseContext", "_BaseContext", "parentContext", "self", "key", "value", "context", "ROOT_CONTEXT", "consoleMap", "_originalConsoleMethods", "keys", "key", "DiagConsoleLogger", "_consoleFunc", "funcName", "args", "theFunc", "i", "NoopMeter", "_name", "_options", "NOOP_GAUGE_METRIC", "NOOP_HISTOGRAM_METRIC", "NOOP_COUNTER_METRIC", "NOOP_UP_DOWN_COUNTER_METRIC", "NOOP_OBSERVABLE_GAUGE_METRIC", "NOOP_OBSERVABLE_COUNTER_METRIC", "NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC", "_callback", "_observables", "NoopMetric", "NoopCounterMetric", "_value", "_attributes", "NoopUpDownCounterMetric", "NoopGaugeMetric", "NoopHistogramMetric", "NoopObservableMetric", "NoopObservableCounterMetric", "NoopObservableGaugeMetric", "NoopObservableUpDownCounterMetric", "NOOP_METER", "createNoopMeter", "defaultTextMapGetter", "carrier", "key", "defaultTextMapSetter", "value", "NoopContextManager", "ROOT_CONTEXT", "_context", "fn", "thisArg", "args", "target", "API_NAME", "NOOP_CONTEXT_MANAGER", "NoopContextManager", "ContextAPI", "_ContextAPI", "contextManager", "registerGlobal", "DiagAPI", "context", "fn", "thisArg", "args", "target", "getGlobal", "unregisterGlobal", "TraceFlags", "INVALID_SPANID", "INVALID_TRACEID", "INVALID_SPAN_CONTEXT", "TraceFlags", "NonRecordingSpan", "spanContext", "INVALID_SPAN_CONTEXT", "_key", "_value", "_attributes", "_name", "_link", "_links", "_status", "_endTime", "_exception", "_time", "SPAN_KEY", "createContextKey", "getSpan", "context", "getActiveSpan", "ContextAPI", "setSpan", "span", "deleteSpan", "setSpanContext", "spanContext", "NonRecordingSpan", "getSpanContext", "_a", "isHex", "isValidHex", "id", "length", "i", "isValidTraceId", "traceId", "INVALID_TRACEID", "isValidSpanId", "spanId", "INVALID_SPANID", "isSpanContextValid", "spanContext", "wrapSpanContext", "NonRecordingSpan", "contextApi", "ContextAPI", "NoopTracer", "name", "options", "context", "NonRecordingSpan", "parentFromContext", "getSpanContext", "isSpanContext", "isSpanContextValid", "arg2", "arg3", "arg4", "opts", "ctx", "fn", "parentContext", "span", "contextWithSpanSet", "setSpan", "spanContext", "NOOP_TRACER", "NoopTracer", "ProxyTracer", "provider", "name", "version", "options", "context", "_name", "_options", "_context", "_fn", "tracer", "NoopTracerProvider", "_name", "_version", "_options", "NoopTracer", "NOOP_TRACER_PROVIDER", "NoopTracerProvider", "ProxyTracerProvider", "name", "version", "options", "_a", "ProxyTracer", "delegate", "SamplingDecision", "SpanKind", "SpanStatusCode", "context", "ContextAPI", "diag", "DiagAPI", "NoopMeterProvider", "_name", "_version", "_options", "NOOP_METER", "NOOP_METER_PROVIDER", "API_NAME", "MetricsAPI", "_MetricsAPI", "provider", "registerGlobal", "DiagAPI", "getGlobal", "NOOP_METER_PROVIDER", "name", "version", "options", "unregisterGlobal", "metrics", "MetricsAPI", "NoopTextMapPropagator", "_context", "_carrier", "context", "BAGGAGE_KEY", "createContextKey", "getBaggage", "context", "getActiveBaggage", "ContextAPI", "setBaggage", "baggage", "deleteBaggage", "API_NAME", "NOOP_TEXT_MAP_PROPAGATOR", "NoopTextMapPropagator", "PropagationAPI", "_PropagationAPI", "createBaggage", "getBaggage", "getActiveBaggage", "setBaggage", "deleteBaggage", "propagator", "registerGlobal", "DiagAPI", "context", "carrier", "setter", "defaultTextMapSetter", "getter", "defaultTextMapGetter", "unregisterGlobal", "getGlobal", "propagation", "PropagationAPI", "API_NAME", "TraceAPI", "_TraceAPI", "ProxyTracerProvider", "wrapSpanContext", "isSpanContextValid", "deleteSpan", "getSpan", "getActiveSpan", "getSpanContext", "setSpan", "setSpanContext", "provider", "success", "registerGlobal", "DiagAPI", "getGlobal", "name", "version", "unregisterGlobal", "trace", "TraceAPI", "SeverityNumber", "NoopLogger", "_logRecord", "NOOP_LOGGER", "createNoopLogger", "GLOBAL_LOGS_API_KEY", "_global", "makeGetter", "requiredVersion", "instance", "fallback", "version", "API_BACKWARDS_COMPATIBILITY_VERSION", "NoopLoggerProvider", "_name", "_version", "_options", "NoopLogger", "NOOP_LOGGER_PROVIDER", "ProxyLogger", "provider", "name", "version", "options", "logRecord", "logger", "NOOP_LOGGER", "ProxyLoggerProvider", "name", "version", "options", "_a", "ProxyLogger", "NOOP_LOGGER_PROVIDER", "delegate", "LogsAPI", "_LogsAPI", "ProxyLoggerProvider", "provider", "_global", "GLOBAL_LOGS_API_KEY", "makeGetter", "API_BACKWARDS_COMPATIBILITY_VERSION", "NOOP_LOGGER_PROVIDER", "_b", "_a", "name", "version", "options", "logs", "LogsAPI", "SUPPRESS_TRACING_KEY", "createContextKey", "suppressTracing", "context", "isTracingSuppressed", "context", "SUPPRESS_TRACING_KEY", "sanitizeAttributes", "attributes", "out", "key", "isAttributeKey", "diag", "val", "isAttributeValue", "isHomogeneousAttributeValueArray", "isValidPrimitiveAttributeValueType", "arr", "type", "element", "elementType", "valType", "loggingErrorHandler", "ex", "diag", "stringifyException", "flattenException", "result", "current", "propertyName", "value", "delegateHandler", "loggingErrorHandler", "globalErrorHandler", "ex", "delegateHandler", "VERSION", "ATTR_ERROR_TYPE", "ATTR_EXCEPTION_MESSAGE", "ATTR_EXCEPTION_STACKTRACE", "ATTR_EXCEPTION_TYPE", "ATTR_HTTP_REQUEST_METHOD", "ATTR_HTTP_REQUEST_METHOD_ORIGINAL", "ATTR_HTTP_RESPONSE_STATUS_CODE", "ATTR_SERVER_ADDRESS", "ATTR_SERVER_PORT", "ATTR_SERVICE_NAME", "ATTR_TELEMETRY_SDK_LANGUAGE", "TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS", "ATTR_TELEMETRY_SDK_NAME", "ATTR_TELEMETRY_SDK_VERSION", "ATTR_URL_FULL", "ATTR_PROCESS_RUNTIME_NAME", "SDK_INFO", "ATTR_TELEMETRY_SDK_NAME", "ATTR_PROCESS_RUNTIME_NAME", "ATTR_TELEMETRY_SDK_LANGUAGE", "TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS", "ATTR_TELEMETRY_SDK_VERSION", "VERSION", "otperformance", "NANOSECOND_DIGITS", "NANOSECOND_DIGITS_IN_MILLIS", "MILLISECONDS_TO_NANOSECONDS", "SECOND_TO_NANOSECONDS", "millisToHrTime", "epochMillis", "epochSeconds", "seconds", "nanos", "hrTime", "performanceNow", "timeOrigin", "millisToHrTime", "otperformance", "now", "addHrTimes", "timeInputToHrTime", "time", "isTimeInputHrTime", "hrTimeDuration", "startTime", "endTime", "seconds", "nanos", "SECOND_TO_NANOSECONDS", "hrTimeToNanoseconds", "time", "SECOND_TO_NANOSECONDS", "isTimeInputHrTime", "value", "isTimeInput", "addHrTimes", "time1", "time2", "out", "SECOND_TO_NANOSECONDS", "ExportResultCode", "CompositePropagator", "config", "__publicField", "fields", "propagator", "propagatorFields", "field", "context", "carrier", "setter", "err", "diag", "getter", "ctx", "VALID_KEY_CHAR_RANGE", "VALID_KEY", "VALID_VENDOR_KEY", "VALID_KEY_REGEX", "VALID_VALUE_BASE_REGEX", "INVALID_VALUE_COMMA_EQUAL_REGEX", "validateKey", "key", "validateValue", "value", "MAX_TRACE_STATE_ITEMS", "MAX_TRACE_STATE_LEN", "LIST_MEMBERS_SEPARATOR", "LIST_MEMBER_KEY_VALUE_SPLITTER", "TraceState", "_TraceState", "rawTraceState", "__publicField", "key", "value", "validateKey", "validateValue", "currState", "currValue", "newLength", "newState", "serialized", "index", "entry", "vendorMembers", "vendorEntries", "currentLength", "member", "m", "idx", "futureLength", "state", "length", "traceState", "TRACE_PARENT_HEADER", "TRACE_STATE_HEADER", "VERSION", "VERSION_PART", "TRACE_ID_PART", "PARENT_ID_PART", "FLAGS_PART", "TRACE_PARENT_REGEX", "parseTraceParent", "traceParent", "match", "W3CTraceContextPropagator", "context", "carrier", "setter", "spanContext", "trace", "isTracingSuppressed", "isSpanContextValid", "TraceFlags", "getter", "traceParentHeader", "traceStateHeader", "state", "TraceState", "TimeoutError", "_TimeoutError", "message", "callWithTimeout", "promise", "timeout", "timeoutHandle", "timeoutPromise", "_resolve", "reject", "result", "reason", "Deferred", "__publicField", "resolve", "reject", "val", "err", "BindOnceFuture", "callback", "that", "__publicField", "Deferred", "args", "val", "err", "serviceName", "defaultServiceName", "argv0", "isPromiseLike", "val", "ResourceImpl", "_ResourceImpl", "resource", "options", "__publicField", "attributes", "k", "v", "isPromiseLike", "guardedRawAttributes", "validateSchemaUrl", "res", "_", "val", "i", "diag", "attrs", "mergedSchemaUrl", "mergeSchemaUrl", "mergedOptions", "resourceFromAttributes", "defaultResource", "resourceFromAttributes", "ATTR_SERVICE_NAME", "defaultServiceName", "ATTR_TELEMETRY_SDK_LANGUAGE", "SDK_INFO", "ATTR_TELEMETRY_SDK_NAME", "ATTR_TELEMETRY_SDK_VERSION", "guardedRawAttributes", "attributes", "k", "v", "isPromiseLike", "err", "diag", "validateSchemaUrl", "schemaUrl", "mergeSchemaUrl", "old", "updating", "oldSchemaUrl", "updatingSchemaUrl", "isOldEmpty", "isUpdatingEmpty", "ATTR_BROWSER_DOCUMENT_URL_FULL", "DocumentSpanProcessor", "documentProvider", "__publicField", "span", "_parentContext", "documentUrl", "ATTR_BROWSER_DOCUMENT_URL_FULL", "_", "LocationDocumentProvider", "config", "__publicField", "url", "error", "diag", "createDocumentSpanProcessor", "documentProvider", "DocumentSpanProcessor", "createLocationDocumentProvider", "config", "LocationDocumentProvider", "ATTR_SESSION_ID", "SessionSpanProcessor", "sessionIdProvider", "__publicField", "span", "_parentContext", "sessionId", "ATTR_SESSION_ID", "_", "createSessionSpanProcessor", "sessionProvider", "SessionSpanProcessor", "version", "enableInstrumentations", "instrumentations", "tracerProvider", "meterProvider", "loggerProvider", "i", "j", "instrumentation", "disableInstrumentations", "registerInstrumentations", "options", "tracerProvider", "trace", "meterProvider", "metrics", "loggerProvider", "logs", "instrumentations", "enableInstrumentations", "disableInstrumentations", "logger", "defineProperty", "obj", "name", "value", "enumerable", "wrap", "nodule", "wrapper", "original", "wrapped", "massWrap", "nodules", "names", "unwrap", "massUnwrap", "shimmer", "options", "InstrumentationAbstract", "instrumentationName", "instrumentationVersion", "config", "__publicField", "wrap", "unwrap", "massWrap", "massUnwrap", "diag", "trace", "metrics", "logs", "meterProvider", "loggerProvider", "initResult", "tracerProvider", "hookHandler", "triggerName", "span", "info", "e", "InstrumentationBase", "InstrumentationAbstract", "instrumentationName", "instrumentationVersion", "config", "safeExecuteInTheMiddle", "execute", "onFinish", "preventThrowingError", "error", "result", "e", "EXCEPTION_EVENT_NAME", "ErrorsInstrumentation", "InstrumentationBase", "config", "version", "event", "isRejection", "error", "capturedError", "safeExecuteInTheMiddle", "errorAttributes", "ATTR_EXCEPTION_MESSAGE", "ATTR_EXCEPTION_TYPE", "ATTR_EXCEPTION_STACKTRACE", "customAttributes", "logRecord", "SeverityNumber", "err", "hook", "result", "MAX_CAPACITY", "ContextRegistry", "__publicField", "span", "data", "ctx", "trace", "ROOT_CONTEXT", "key", "list", "record", "oldestRecord", "oldestKey", "oldestCtx", "lookup", "index", "r", "k", "filtered", "NetworkContextRegistry", "ContextRegistry", "data", "entry", "key", "_instance", "getNetworkContextRegistry", "DIAG_LOGGER", "diag", "isDocument", "value", "getFetchBodyLength", "args", "requestInit", "body", "length", "_getBodyNonDestructively", "getXHRBodyLength", "info", "getByteLength", "resolveLength", "lengthPromise", "resolve", "bodyReader", "controller", "done", "reason", "getFormDataSize", "TEXT_ENCODER", "s", "formData", "size", "key", "DEFAULT_KNOWN_METHODS", "normalizeHttpRequestMethod", "method", "methUpper", "parseUrl", "url", "matchesUrl", "urlsToMatch", "urlToMatch", "HTTP_PORT_FROM_PROTOCOL", "serverPortFromUrl", "serverPort", "ATTR_HTTP_REQUEST_BODY_SIZE", "hasBrowserPerformanceAPI", "FetchInstrumentation", "InstrumentationBase", "config", "version", "__publicField", "err", "original", "instrumentation", "args", "trucatedSpan", "endSpanOnError", "span", "error", "options", "endSpanOnSuccess", "response", "onSuccess", "body", "reader", "read", "done", "e", "onError", "instrConfig", "url", "parseUrl", "matchesUrl", "createdSpan", "getFetchBodyLength", "bodyLength", "ATTR_HTTP_REQUEST_BODY_SIZE", "fetchContext", "trace", "context", "attributes", "parsedUrl", "origMethod", "normMethod", "normalizeHttpRequestMethod", "serverPort", "serverPortFromUrl", "name", "sanitizeUrl", "ATTR_HTTP_REQUEST_METHOD", "ATTR_URL_FULL", "ATTR_SERVER_ADDRESS", "ATTR_SERVER_PORT", "ATTR_HTTP_REQUEST_METHOD_ORIGINAL", "SpanKind", "ATTR_HTTP_RESPONSE_STATUS_CODE", "SpanStatusCode", "errorType", "ATTR_ERROR_TYPE", "resource", "getNetworkContextRegistry", "request", "result", "applyCustomAttributesOnSpan", "safeExecuteInTheMiddle", "requestHook", "ctx", "urlsToPropagate", "urlOrigin", "propagation", "h", "k", "v", "headers", "ATTR_HTTP_REQUEST_BODY_SIZE", "XhrInstrumentation", "InstrumentationBase", "config", "version", "__publicField", "err", "original", "instrumentation", "args", "method", "urlArgument", "url", "parseUrl", "matchesUrl", "e", "xhrRecord", "span", "bodyLength", "getXHRBodyLength", "ATTR_HTTP_REQUEST_BODY_SIZE", "onAbort", "onError", "onTimeout", "onLoad", "xhrContext", "trace", "context", "origMethod", "normMethod", "normalizeHttpRequestMethod", "attributes", "sanitizeUrl", "ATTR_HTTP_REQUEST_METHOD", "ATTR_HTTP_REQUEST_METHOD_ORIGINAL", "ATTR_URL_FULL", "ATTR_SERVER_ADDRESS", "serverPort", "serverPortFromUrl", "ATTR_SERVER_PORT", "SpanKind", "xhr", "eventName", "k", "start", "ATTR_HTTP_RESPONSE_STATUS_CODE", "SpanStatusCode", "errorType", "ATTR_ERROR_TYPE", "getNetworkContextRegistry", "applyCustomAttributesOnSpan", "safeExecuteInTheMiddle", "error", "ctx", "urlsToPropagate", "propagation", "x", "v", "headers", "h", "BROWSER_NAVIGATION_EVENT_NAME", "ATTR_URL_FULL", "ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT", "ATTR_BROWSER_NAVIGATION_HASH_CHANGE", "ATTR_BROWSER_NAVIGATION_TYPE", "isHashChange", "fromUrl", "toUrl", "a", "b", "sameBase", "toHasHash", "hashesAreDifferent", "fromBase", "toBase", "fromHash", "toHash", "NavigationInstrumentation", "InstrumentationBase", "config", "version", "navigationApi", "event", "cfg", "logRecord", "BROWSER_NAVIGATION_EVENT_NAME", "SeverityNumber", "ATTR_URL_FULL", "ATTR_BROWSER_NAVIGATION_SAME_DOCUMENT", "ATTR_BROWSER_NAVIGATION_HASH_CHANGE", "changeState", "navigationEvent", "referrerUrl", "currentUrl", "navType", "sameDocument", "hashChange", "isHashChange", "ATTR_BROWSER_NAVIGATION_TYPE", "plugin", "original", "args", "result", "hook", "safeExecuteInTheMiddle", "error", "fromUrl", "toUrl", "fromURL", "toURL", "supportsIdleCallback", "requestIdleCallbackShim", "callback", "options", "start", "cancelIdleCallbackShim", "handle", "RESOURCE_TIMING_EVENT_NAME", "ATTR_RESOURCE_URL", "ATTR_RESOURCE_INITIATOR_TYPE", "ATTR_RESOURCE_DURATION", "ATTR_RESOURCE_FETCH_START", "ATTR_RESOURCE_DOMAIN_LOOKUP_START", "ATTR_RESOURCE_DOMAIN_LOOKUP_END", "ATTR_RESOURCE_CONNECT_START", "ATTR_RESOURCE_CONNECT_END", "ATTR_RESOURCE_SECURE_CONNECTION_START", "ATTR_RESOURCE_REQUEST_START", "ATTR_RESOURCE_RESPONSE_START", "ATTR_RESOURCE_RESPONSE_END", "ATTR_RESOURCE_TRANSFER_SIZE", "ATTR_RESOURCE_ENCODED_BODY_SIZE", "ATTR_RESOURCE_DECODED_BODY_SIZE", "ATTR_RESOURCE_REDIRECT_START", "ATTR_RESOURCE_REDIRECT_END", "ATTR_RESOURCE_WORKER_START", "ATTR_RESOURCE_NEXT_HOP_PROTOCOL", "ATTR_RESOURCE_RENDER_BLOCKING_STATUS", "DEFAULT_BATCH_SIZE", "DEFAULT_FORCE_PROCESSING_AFTER", "DEFAULT_MAX_PROCESSING_TIME", "DEFAULT_MAX_QUEUE_SIZE", "MIN_BATCH_SIZE", "MIN_FORCE_PROCESSING_AFTER", "MIN_PROCESSING_TIME", "MIN_QUEUE_SIZE", "ResourceTimingInstrumentation", "InstrumentationBase", "config", "version", "__publicField", "observer", "list", "maxQueueSize", "entries", "initiatorTypes", "entry", "matchesUrl", "e", "timeout", "requestIdleCallbackShim", "deadline", "maxTime", "batchSize", "startTime", "cursor", "elapsed", "noIdleTime", "record", "RESOURCE_TIMING_EVENT_NAME", "SeverityNumber", "ATTR_RESOURCE_URL", "ATTR_RESOURCE_INITIATOR_TYPE", "ATTR_RESOURCE_DURATION", "ATTR_RESOURCE_FETCH_START", "ATTR_RESOURCE_DOMAIN_LOOKUP_START", "ATTR_RESOURCE_DOMAIN_LOOKUP_END", "ATTR_RESOURCE_CONNECT_START", "ATTR_RESOURCE_CONNECT_END", "ATTR_RESOURCE_SECURE_CONNECTION_START", "ATTR_RESOURCE_REQUEST_START", "ATTR_RESOURCE_RESPONSE_START", "ATTR_RESOURCE_RESPONSE_END", "ATTR_RESOURCE_TRANSFER_SIZE", "ATTR_RESOURCE_ENCODED_BODY_SIZE", "ATTR_RESOURCE_DECODED_BODY_SIZE", "ATTR_RESOURCE_REDIRECT_START", "ATTR_RESOURCE_REDIRECT_END", "ATTR_RESOURCE_WORKER_START", "ATTR_RESOURCE_NEXT_HOP_PROTOCOL", "ATTR_RESOURCE_RENDER_BLOCKING_STATUS", "registry", "getNetworkContextRegistry", "ctx", "error", "cancelIdleCallbackShim", "createResource", "resource", "encoder", "result", "toAttributes", "schemaUrl", "createInstrumentationScope", "scope", "attributes", "key", "toKeyValue", "value", "toAnyValue", "t", "values", "i", "keys", "createExportLogsServiceRequest", "logRecords", "encoder", "logRecordsToResourceLogs", "createResourceMap", "resourceMap", "record", "resource", "instrumentationScope", "ismMap", "records", "processedResource", "createResource", "scopeLogs", "createInstrumentationScope", "log", "toLogRecord", "toAnyValue", "toAttributes", "hrTimeToNanos", "hrTime", "NANOSECONDS", "encodeAsString", "hrTime", "hrTimeToNanos", "encodeTimestamp", "hrTimeToNanoseconds", "identity", "value", "JSON_ENCODER", "encodeTimestamp", "identity", "bytes", "chars", "i", "JsonLogsSerializer", "arg", "request", "createExportLogsServiceRequest", "JSON_ENCODER", "decoder", "err", "diag", "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK", "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK", "buildSpanFlagsFrom", "traceFlags", "isRemote", "flags", "sdkSpanToOtlpSpan", "span", "encoder", "ctx", "status", "parentSpanId", "toAttributes", "event", "toOtlpSpanEvent", "link", "toOtlpLink", "timedEvent", "createExportTraceServiceRequest", "spans", "spanRecordsToResourceSpans", "createResourceMap", "readableSpans", "resourceMap", "record", "ilsMap", "instrumentationScopeKey", "records", "out", "entryIterator", "entry", "resource", "ilmMap", "scopeResourceSpans", "ilmIterator", "ilmEntry", "scopeSpans", "readableSpan", "createInstrumentationScope", "processedResource", "createResource", "transformedSpans", "JsonTraceSerializer", "arg", "request", "createExportTraceServiceRequest", "JSON_ENCODER", "decoder", "err", "diag", "RETRYABLE_STATUS", "MAX_KEEPALIVE_BYTES", "pendingKeepaliveBytes", "pendingKeepaliveRequests", "ConsentHttpExporter", "options", "fetch", "original", "records", "callback", "ExportResultCode", "data", "error", "asError", "operation", "timeoutMillis", "deadline", "finished", "controller", "retryTimer", "resolveDone", "resolve", "complete", "result", "timeout", "retry", "attempt", "response", "fallback", "delay", "retryAfter", "dispatch", "keepalive", "value", "date", "isLogAttributeValue", "val", "isLogAttributeValueInternal", "visited", "item", "obj", "key", "AddAttributeDecision", "addAttribute", "attributes", "limits", "currentAttributesCount", "value", "diag", "isNewKey", "truncateToSize", "limit", "truncatedObj", "k", "v", "normalizeScopeAttributes", "normalizedAttributes", "droppedAttributesCount", "decision", "LogRecordImpl", "_sharedState", "instrumentationScope", "logRecord", "__publicField", "timestamp", "observedTimestamp", "eventName", "severityNumber", "severityText", "body", "attributes", "exception", "context", "now", "timeInputToHrTime", "spanContext", "trace", "isSpanContextValid", "hrTime", "hrTimeObserved", "key", "value", "decision", "addAttribute", "AddAttributeDecision", "diag", "k", "v", "hasMinimumAttributes", "ATTR_EXCEPTION_MESSAGE", "exceptionObj", "ATTR_EXCEPTION_TYPE", "ATTR_EXCEPTION_STACKTRACE", "Logger", "instrumentationScope", "sharedState", "__publicField", "logRecord", "currentContext", "context", "logRecordInstance", "LogRecordImpl", "options", "loggerConfig", "severityNumber", "SeverityNumber", "spanContext", "trace", "isSpanContextValid", "TraceFlags", "enabledOpts", "processor", "NoopLogRecordProcessor", "_logRecord", "_context", "_options", "MultiLogRecordProcessor", "processors", "__publicField", "options", "timeout", "processor", "callWithTimeout", "logRecord", "context", "normalizeAnyValue", "value", "valueType", "a", "b", "k", "v", "getInstrumentationScopeKey", "scope", "METRIC_OTEL_SDK_LOG_CREATED", "METRIC_OTEL_SDK_PROCESSOR_LOG_PROCESSED", "METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY", "METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_SIZE", "ATTR_OTEL_COMPONENT_NAME", "ATTR_OTEL_COMPONENT_TYPE", "OTEL_COMPONENT_TYPE_VALUE_BATCHING_LOG_PROCESSOR", "ATTR_ERROR_TYPE", "LoggerMetrics", "meter", "__publicField", "METRIC_OTEL_SDK_LOG_CREATED", "VERSION", "DEFAULT_LOGGER_CONFIG", "SeverityNumber", "DEFAULT_LOGGER_CONFIGURATOR", "LoggerProviderSharedState", "resource", "logRecordLimits", "processors", "loggerConfigurator", "meterProvider", "__publicField", "MultiLogRecordProcessor", "NoopLogRecordProcessor", "meter", "VERSION", "createNoopMeter", "LoggerMetrics", "instrumentationScope", "key", "getInstrumentationScopeKey", "config", "DEFAULT_LOGGER_NAME", "LoggerProvider", "config", "__publicField", "mergedConfig", "defaultResource", "DEFAULT_LOGGER_CONFIGURATOR", "LoggerProviderSharedState", "BindOnceFuture", "name", "version", "options", "diag", "createNoopLogger", "instrumentationScope", "normalizeScopeAttributes", "key", "getInstrumentationScopeKey", "Logger", "componentCounter", "LogRecordProcessorMetrics", "componentType", "meter", "queueConfig", "__publicField", "counter", "ATTR_OTEL_COMPONENT_TYPE", "ATTR_OTEL_COMPONENT_NAME", "ATTR_ERROR_TYPE", "METRIC_OTEL_SDK_PROCESSOR_LOG_PROCESSED", "capacity", "getQueueSize", "METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY", "METRIC_OTEL_SDK_PROCESSOR_LOG_QUEUE_SIZE", "result", "count", "error", "attrs", "waitForResources", "logRecords", "pendingResources", "i", "len", "logRecord", "ExportOperation", "exporter", "exportTimeoutMillis", "metrics", "__publicField", "resolve", "context", "suppressTracing", "e", "globalErrorHandler", "reject", "timer", "result", "ExportResultCode", "BatchLogRecordProcessorBase", "options", "BindOnceFuture", "diag", "meter", "createNoopMeter", "LogRecordProcessorMetrics", "OTEL_COMPONENT_TYPE_VALUE_BATCHING_LOG_PROCESSOR", "toFlush", "inFlight", "batch", "exportOp", "error", "BatchLogRecordProcessor", "BatchLogRecordProcessorBase", "options", "__publicField", "ExceptionEventName", "inspectCustom", "settledResourceAttributes", "resource", "attrs", "k", "v", "formatInspect", "className", "payload", "depth", "options", "inspect", "tag", "childOptions", "SpanImpl", "opts", "__publicField", "SpanStatusCode", "now", "otperformance", "link", "key", "value", "diag", "isAttributeValue", "attributeCountLimit", "isNewKey", "attributes", "name", "attributesOrStartTime", "timeStamp", "eventCountLimit", "isTimeInput", "sanitized", "sanitizeAttributes", "attributePerEventCountLimit", "droppedAttributesCount", "eventAttributesCount", "attr", "attrVal", "linkCountLimit", "attributePerLinkCountLimit", "linkAttributesCount", "processedLink", "links", "status", "newStatus", "endTime", "hrTimeDuration", "inp", "hrTime", "millisToHrTime", "isTimeInputHrTime", "msDuration", "addHrTimes", "exception", "time", "ATTR_EXCEPTION_MESSAGE", "ATTR_EXCEPTION_TYPE", "ATTR_EXCEPTION_STACKTRACE", "ExceptionEventName", "error", "limit", "val", "inspectCustom", "depth", "options", "inspect", "payload", "settledResourceAttributes", "formatInspect", "SamplingDecision", "ATTR_OTEL_COMPONENT_NAME", "ATTR_OTEL_COMPONENT_TYPE", "ATTR_OTEL_SPAN_PARENT_ORIGIN", "ATTR_OTEL_SPAN_SAMPLING_RESULT", "METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED", "METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY", "METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE", "METRIC_OTEL_SDK_SPAN_LIVE", "METRIC_OTEL_SDK_SPAN_STARTED", "OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR", "TracerMetrics", "meter", "__publicField", "METRIC_OTEL_SDK_SPAN_STARTED", "METRIC_OTEL_SDK_SPAN_LIVE", "parentSpanCtx", "samplingDecision", "samplingDecisionStr", "samplingDecisionToString", "ATTR_OTEL_SPAN_PARENT_ORIGIN", "parentOrigin", "ATTR_OTEL_SPAN_SAMPLING_RESULT", "SamplingDecision", "liveSpanAttributes", "parentSpanContext", "decision", "VERSION", "Tracer", "instrumentationScope", "options", "__publicField", "meter", "VERSION", "TracerMetrics", "name", "context", "trace", "parentSpan", "isTracingSuppressed", "diag", "INVALID_SPAN_CONTEXT", "parentSpanContext", "spanId", "validParentSpanContext", "traceId", "traceState", "spanKind", "SpanKind", "links", "link", "sanitizeAttributes", "attributes", "samplingResult", "recordEndMetrics", "traceFlags", "SamplingDecision", "TraceFlags", "spanContext", "initAttributes", "SpanImpl", "arg2", "arg3", "arg4", "opts", "ctx", "fn", "parentContext", "span", "contextWithSpanSet", "inspectCustom", "depth", "inspect", "payload", "settledResourceAttributes", "formatInspect", "MultiSpanProcessor", "spanProcessors", "__publicField", "promises", "spanProcessor", "resolve", "error", "globalErrorHandler", "span", "context", "reject", "AlwaysOffSampler", "SamplingDecision", "AlwaysOnSampler", "SamplingDecision", "ParentBasedSampler", "config", "__publicField", "globalErrorHandler", "AlwaysOnSampler", "AlwaysOffSampler", "context", "traceId", "spanName", "spanKind", "attributes", "links", "parentContext", "trace", "isSpanContextValid", "TraceFlags", "componentCounter", "SpanProcessorMetrics", "componentType", "meter", "queueConfig", "__publicField", "counter", "ATTR_OTEL_COMPONENT_TYPE", "ATTR_OTEL_COMPONENT_NAME", "ATTR_ERROR_TYPE", "METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED", "capacity", "getQueueSize", "METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY", "METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE", "result", "count", "error", "attrs", "BatchSpanProcessorBase", "options", "__publicField", "BindOnceFuture", "diag", "meter", "createNoopMeter", "SpanProcessorMetrics", "OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR", "_span", "_parentContext", "span", "TraceFlags", "resolve", "reject", "promises", "count", "i", "j", "timer", "context", "suppressTracing", "spans", "doExport", "result", "ExportResultCode", "pendingResources", "len", "err", "globalErrorHandler", "flush", "e", "BatchSpanProcessor", "BatchSpanProcessorBase", "options", "__publicField", "error", "globalErrorHandler", "TRACE_BUFFER", "SPAN_BUFFER", "HEX", "_", "i", "randomFill", "buf", "toHex", "hex", "RandomIdGenerator", "ForceFlushState", "TracerProvider", "options", "__publicField", "defaultResource", "spanProcessors", "MultiSpanProcessor", "ParentBasedSampler", "AlwaysOnSampler", "RandomIdGenerator", "createNoopMeter", "name", "version", "key", "Tracer", "timeout", "promises", "spanProcessor", "resolve", "state", "timeoutInterval", "error", "reject", "results", "errors", "result", "inspectCustom", "depth", "inspect", "processors", "payload", "settledResourceAttributes", "p", "formatInspect", "TraceIdRatioBasedSampler", "ratio", "__publicField", "context", "traceId", "isValidTraceId", "SamplingDecision", "accumulation", "i", "part", "j", "c", "v", "DEFAULT_CROSS_ORIGIN_TOP_N", "RESOURCE_TIMING_EVENT", "classifyResourceUrl", "url", "pageOrigin", "raw", "origin", "resourceTimingUrl", "attrs", "full", "legacy", "resourceTimingDuration", "n", "selectResourceTimingEntries", "entries", "opts", "topN", "keep", "cross", "e", "a", "b", "ResourceTimingCapExporter", "inner", "options", "logs", "resultCallback", "ExportResultCode", "pass", "record", "resourceOrigin", "size", "r", "failure", "canceled", "records", "callback", "resolve", "done", "complete", "result", "timeout", "error", "selected", "value", "SCOPE_NAME", "VERSION", "resourceTimingExtraAttributes", "entry", "out", "timings", "timing", "URL_ATTRIBUTES", "RumSessionLogProcessor", "getSessionId", "record", "sanitizeAttributes", "attrs", "redact", "key", "value", "safeRedactUrl", "RumLogProcessor", "navigationAttributes", "createLocationDocumentProvider", "url", "classifyResourceUrl", "rawUrl", "entries", "start", "matches", "entry", "resourceTimingExtraAttributes", "RumSpanProcessor", "logger", "span", "_ctx", "SpanKind", "SpanStatusCode", "attributes", "SeverityNumber", "trace", "ROOT_CONTEXT", "createStackContextManager", "current", "ROOT_CONTEXT", "enabled", "manager", "context", "fn", "thisArg", "args", "previous", "target", "boundContext", "bound", "NO_PROPAGATION", "createContextKey", "TRACE_HEADERS", "injecting", "xhrRequests", "OTLP_URL", "originPatterns", "origins", "origin", "traceparentPropagator", "w3c", "W3CTraceContextPropagator", "ctx", "carrier", "setter", "parent", "trace", "clean", "c", "key", "value", "getter", "eligible", "url", "protectFetchInputs", "instrumented", "adapter", "input", "init", "args", "context", "request", "propagate", "headers", "protectXhrHeaders", "proto", "open", "send", "setHeader", "pending", "adaptedOpen", "method", "rest", "result", "target", "ignored", "adaptedHeader", "name", "record", "adaptedSend", "body", "diagnosticsConfigured", "startOtelRuntime", "config", "resourceAttributes", "getSessionId", "onNavigation", "captureBudget", "createCaptureBudget", "diagnostic", "createDiagnostics", "epoch", "cleanup", "captureOpen", "transportOpen", "active", "transportEpoch", "logAllowed", "record", "isEpochTimestamp", "isEpochResource", "gateLogProcessor", "processor", "ctx", "gateSpanProcessor", "span", "headers", "redact", "url", "safeRedactUrl", "session", "navigation", "createNavigationContext", "restoreVisit", "event", "navigationAttributes", "identity", "start", "origin", "exporter", "ResourceTimingCapExporter", "ConsentHttpExporter", "JsonLogsSerializer", "logBatch", "BatchLogRecordProcessor", "filteredBatch", "diag", "DiagConsoleLogger", "DiagLogLevel", "resource", "defaultResource", "resourceFromAttributes", "loggerProvider", "LoggerProvider", "RumLogProcessor", "RumSessionLogProcessor", "logs", "logger", "SCOPE_NAME", "VERSION", "spanExporter", "JsonTraceSerializer", "spanBatch", "BatchSpanProcessor", "sampler", "ParentBasedSampler", "TraceIdRatioBasedSampler", "consentSampler", "args", "propagator", "traceparentPropagator", "consentPropagator", "carrier", "setter", "getter", "tracerProvider", "TracerProvider", "createSessionSpanProcessor", "createDocumentSpanProcessor", "createLocationDocumentProvider", "RumSpanProcessor", "trace", "propagation", "context", "CompositePropagator", "createStackContextManager", "tracer", "p", "originalPush", "originalReplace", "instrumentedPush", "instrumentedReplace", "originalFetch", "xhrProto", "originalOpen", "originalSend", "restoreXhrHeaders", "protectXhrHeaders", "instrumentations", "instrumentation", "networkConfig", "OTLP_URL", "originPatterns", "ErrorsInstrumentation", "NavigationInstrumentation", "attrs", "ResourceTimingInstrumentation", "FetchInstrumentation", "XhrInstrumentation", "unregister", "instrumentedFetch", "instrumentedOpen", "instrumentedSend", "registerInstrumentations", "restoreFetchInputs", "protectFetchInputs", "stopped", "flushing", "forceFlush", "emitter", "finishing", "discardStarted", "cancellation", "cleanupErrors", "finish", "discard", "alreadyFinishing", "resolveFinish", "rejectFinish", "resolve", "reject", "target", "error", "stop", "fn", "results", "result", "SESSION_IDLE_MS", "SESSION_MAX_MS", "createSessionManager", "options", "now", "newId", "randomId", "key", "state", "cleared", "stored", "persist", "current", "at", "activeAgent", "initializationStatus", "getInitializationStatus", "getConsent", "setConsent", "state", "options", "startCapture", "resolved", "epoch", "stops", "otel", "sessions", "preflight", "storage", "createSessionManager", "session", "ctx", "resourceAttributes", "sanitizeAttributes", "buildResourceAttributes", "SCOPE_NAME", "VERSION", "key", "value", "SESSION_IDLE_MS", "SESSION_MAX_MS", "activity", "event", "captureBudget", "createCaptureBudget", "diagnostic", "createDiagnostics", "startOtelRuntime", "runtime", "startLongTaskPlugin", "flush", "hide", "stopPromise", "discard", "resolveStop", "rejectStop", "operation", "resolve", "reject", "failures", "stop", "error", "stopped", "init", "config", "resolveConfig", "consent", "normalizeConsent", "revision", "closed", "capture", "closeEpoch", "serial", "decision", "cleanupFailure", "starting", "shutdownPromise", "start", "epochRevision", "createCaptureEpoch", "withdraw", "finishStartup", "failStartup", "startup", "enqueue", "work", "resolveCleanup", "rejectCleanup", "barrier", "previous", "stopping", "agent", "next", "validity", "currentRevision", "resolveShutdown", "rejectShutdown", "current", "attr", "script", "name", "tracePropagationOriginsFromScript", "origin", "resourceAttributesFromScript", "serviceNamespace", "serviceVersion", "optionsFromScript", "mapping", "boolean", "value", "raw", "plugins", "key", "suffix", "sampleRate", "encoding", "consent", "autoBootFailed", "withBeaconConsentPolicy", "config", "policy", "attr", "script", "name", "keyFromScriptUrl", "bootFromScript", "endpoint", "ingestKey", "serviceName", "init", "optionsFromScript", "tracePropagationOriginsFromScript", "resourceAttributesFromScript", "agent", "getConsent", "setConsent", "getInitializationStatus"]
}
