@opentelemetry/instrumentation-http 0.222.0-development.0 → 0.300.0-development.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +0 -2
  2. package/dist/_virtual/_rolldown/runtime.mjs +5 -0
  3. package/dist/http.cjs +425 -0
  4. package/dist/http.cjs.map +1 -0
  5. package/dist/http.d.cts +61 -0
  6. package/dist/http.d.cts.map +1 -0
  7. package/dist/http.d.mts +61 -0
  8. package/dist/http.d.mts.map +1 -0
  9. package/dist/http.mjs +425 -0
  10. package/dist/http.mjs.map +1 -0
  11. package/dist/index.cjs +3 -0
  12. package/dist/index.d.cts +3 -0
  13. package/dist/index.d.mts +3 -0
  14. package/dist/index.mjs +2 -0
  15. package/dist/internal-types.cjs +32 -0
  16. package/dist/internal-types.cjs.map +1 -0
  17. package/dist/internal-types.mjs +29 -0
  18. package/dist/internal-types.mjs.map +1 -0
  19. package/dist/semconv.cjs +18 -0
  20. package/dist/semconv.cjs.map +1 -0
  21. package/dist/semconv.mjs +17 -0
  22. package/dist/semconv.mjs.map +1 -0
  23. package/dist/types.d.cts +112 -0
  24. package/dist/types.d.cts.map +1 -0
  25. package/dist/types.d.mts +112 -0
  26. package/dist/types.d.mts.map +1 -0
  27. package/dist/utils.cjs +486 -0
  28. package/dist/utils.cjs.map +1 -0
  29. package/dist/utils.mjs +471 -0
  30. package/dist/utils.mjs.map +1 -0
  31. package/dist/version.cjs +6 -0
  32. package/dist/version.cjs.map +1 -0
  33. package/dist/version.mjs +6 -0
  34. package/dist/version.mjs.map +1 -0
  35. package/package.json +31 -21
  36. package/build/src/http.d.ts +0 -61
  37. package/build/src/http.js +0 -562
  38. package/build/src/http.js.map +0 -1
  39. package/build/src/index.d.ts +0 -3
  40. package/build/src/index.js +0 -10
  41. package/build/src/index.js.map +0 -1
  42. package/build/src/internal-types.d.ts +0 -42
  43. package/build/src/internal-types.js +0 -32
  44. package/build/src/internal-types.js.map +0 -1
  45. package/build/src/semconv.d.ts +0 -17
  46. package/build/src/semconv.js +0 -29
  47. package/build/src/semconv.js.map +0 -1
  48. package/build/src/types.d.ts +0 -115
  49. package/build/src/types.js +0 -3
  50. package/build/src/types.js.map +0 -1
  51. package/build/src/utils.d.ts +0 -105
  52. package/build/src/utils.js +0 -655
  53. package/build/src/utils.js.map +0 -1
  54. package/build/src/version.d.ts +0 -2
  55. package/build/src/version.js +0 -10
  56. package/build/src/version.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAUA,4CAAuE;AACvE,8EAiB6C;AAC7C,uCAImB;AASnB,8CAA8D;AAC9D,2BAA2B;AAM3B,qDAA6E;AAC7E,qDAG0B;AAC1B,iEAAiE;AACjE,kDAAmD;AAEnD,MAAM,2BAA2B,GAAG,KAAK,CAAC,IAAI,CAAC,gDAA+B,CAAC,CAAC;AAEhF;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAC/B,YAA6B,EAC7B,cAAwB,EAChB,EAAE;IACV,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;QAClC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACrB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,6BAAY,CAAC,CAAC;SACjC;KACF;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B;AAEF;;GAEG;AACI,MAAM,cAAc,GAAG,CAC5B,UAAuC,EACvC,OAAkD,EAClD,gBAAgB,GAAG,OAAO,EAC1B,sBAAgC,KAAK,CAAC,IAAI,CAAC,gDAA+B,CAAC,EACnE,EAAE;IACV,MAAM,YAAY,GAAG,UAAU,IAAI,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,YAAY,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ifier: Apache-2.0\n */\nimport type {\n Attributes,\n Span,\n DiagLogger,\n AttributeValue,\n} from '@opentelemetry/api';\nimport { SpanStatusCode, context, SpanKind } from '@opentelemetry/api';\nimport {\n ATTR_CLIENT_ADDRESS,\n ATTR_ERROR_TYPE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_HTTP_REQUEST_METHOD_ORIGINAL,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_ROUTE,\n ATTR_NETWORK_PEER_ADDRESS,\n ATTR_NETWORK_PEER_PORT,\n ATTR_NETWORK_PROTOCOL_VERSION,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_URL_FULL,\n ATTR_URL_PATH,\n ATTR_URL_QUERY,\n ATTR_URL_SCHEME,\n ATTR_USER_AGENT_ORIGINAL,\n} from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_USER_AGENT_SYNTHETIC_TYPE,\n USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT,\n USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST,\n} from './semconv';\nimport type {\n IncomingHttpHeaders,\n IncomingMessage,\n OutgoingHttpHeader,\n OutgoingHttpHeaders,\n RequestOptions,\n ServerResponse,\n} from 'http';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\nimport * as url from 'url';\nimport type {\n Err,\n IgnoreMatcher,\n ParsedRequestOptions,\n} from './internal-types';\nimport { SYNTHETIC_BOT_NAMES, SYNTHETIC_TEST_NAMES } from './internal-types';\nimport {\n DEFAULT_QUERY_STRINGS_TO_REDACT,\n STR_REDACTED,\n} from './internal-types';\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nimport forwardedParse = require('forwarded-parse');\n\nconst defaultQueryStringsToRedact = Array.from(DEFAULT_QUERY_STRINGS_TO_REDACT);\n\n/**\n * Redacts sensitive query parameters from a query string (without leading '?').\n * Returns the input unchanged if it cannot be parsed.\n */\nexport const redactQueryString = (\n searchParams: URLSearchParams,\n paramsToRedact: string[]\n): string => {\n const params = new URLSearchParams(searchParams);\n for (const param of paramsToRedact) {\n if (params.has(param)) {\n params.set(param, STR_REDACTED);\n }\n }\n return params.toString();\n};\n\n/**\n * Get an absolute url\n */\nexport const getAbsoluteUrl = (\n requestUrl: ParsedRequestOptions | null,\n headers: IncomingHttpHeaders | OutgoingHttpHeaders,\n fallbackProtocol = 'http:',\n redactedQueryParams: string[] = Array.from(DEFAULT_QUERY_STRINGS_TO_REDACT)\n): string => {\n const reqUrlObject = requestUrl || {};\n const protocol = reqUrlObject.protocol || fallbackProtocol;\n const port = (reqUrlObject.port || '').toString();\n let path = reqUrlObject.path || '/';\n let host =\n reqUrlObject.host || reqUrlObject.hostname || headers.host || 'localhost';\n // if there is no port in host and there is a port\n // it should be displayed if it's not 80 and 443 (default ports)\n if (\n (host as string).indexOf(':') === -1 &&\n port &&\n port !== '80' &&\n port !== '443'\n ) {\n host += `:${port}`;\n }\n if (path.includes('?')) {\n try {\n const parsedUrl = new URL(path, 'http://localhost');\n const redacted = redactQueryString(\n parsedUrl.searchParams,\n redactedQueryParams\n );\n path = `${parsedUrl.pathname}?${redacted}`;\n } catch {\n // Ignore error, as the path was not a valid URL.\n }\n }\n const authPart = reqUrlObject.auth ? `${STR_REDACTED}:${STR_REDACTED}@` : '';\n return `${protocol}//${authPart}${host}${path}`;\n};\n\n/**\n * Parse status code from HTTP response. [More details](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md#status)\n */\nexport const parseResponseStatus = (\n kind: SpanKind,\n statusCode?: number\n): SpanStatusCode => {\n const upperBound = kind === SpanKind.CLIENT ? 400 : 500;\n // 1xx, 2xx, 3xx are OK on client and server\n // 4xx is OK on server\n if (statusCode && statusCode >= 100 && statusCode < upperBound) {\n return SpanStatusCode.UNSET;\n }\n\n // All other codes are error\n return SpanStatusCode.ERROR;\n};\n\n/**\n * Check whether the given obj match pattern\n * @param constant e.g URL of request\n * @param pattern Match pattern\n */\nexport const satisfiesPattern = (\n constant: string,\n pattern: IgnoreMatcher\n): boolean => {\n if (typeof pattern === 'string') {\n return pattern === constant;\n } else if (pattern instanceof RegExp) {\n return pattern.test(constant);\n } else if (typeof pattern === 'function') {\n return pattern(constant);\n } else {\n throw new TypeError('Pattern is in unsupported datatype');\n }\n};\n\n/**\n * Sets the span with the error passed in params\n * @param {Span} span the span that need to be set\n * @param {Error} error error that will be set to span\n */\nexport const setSpanWithError = (span: Span, error: Err): void => {\n const message = error.message;\n span.setAttribute(ATTR_ERROR_TYPE, error.name);\n span.setStatus({ code: SpanStatusCode.ERROR, message });\n span.recordException(error);\n};\n\nexport const isCompressed = (\n headers: OutgoingHttpHeaders | IncomingHttpHeaders\n): boolean => {\n const encoding = headers['content-encoding'];\n\n return !!encoding && encoding !== 'identity';\n};\n\n/**\n * Mimics Node.js conversion of URL strings to RequestOptions expected by\n * `http.request` and `https.request` APIs.\n *\n * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437\n *\n * @param stringUrl\n * @throws TypeError if the URL is not valid.\n */\nfunction stringUrlToHttpOptions(\n stringUrl: string\n): RequestOptions & { pathname: string } {\n // This is heavily inspired by Node.js handling of the same situation, trying\n // to follow it as closely as possible while keeping in mind that we only\n // deal with string URLs, not URL objects.\n const {\n hostname,\n pathname,\n port,\n username,\n password,\n search,\n protocol,\n hash,\n href,\n origin,\n host,\n } = new URL(stringUrl);\n\n const options: RequestOptions & {\n pathname: string;\n hash: string;\n search: string;\n href: string;\n origin: string;\n } = {\n protocol: protocol,\n hostname:\n hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname,\n hash: hash,\n search: search,\n pathname: pathname,\n path: `${pathname || ''}${search || ''}`,\n href: href,\n origin: origin,\n host: host,\n };\n if (port !== '') {\n options.port = Number(port);\n }\n if (username || password) {\n options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(\n password\n )}`;\n }\n return options;\n}\n\n/**\n * Makes sure options is an url object\n * return an object with default value and parsed options\n * @param logger component logger\n * @param options original options for the request\n * @param [extraOptions] additional options for the request\n */\nexport const getRequestInfo = (\n logger: DiagLogger,\n options: url.URL | RequestOptions | string,\n extraOptions?: RequestOptions\n): {\n origin: string;\n pathname: string;\n method: string;\n invalidUrl: boolean;\n optionsParsed: RequestOptions;\n} => {\n let pathname: string;\n let origin: string;\n let optionsParsed: RequestOptions;\n let invalidUrl = false;\n if (typeof options === 'string') {\n try {\n const convertedOptions = stringUrlToHttpOptions(options);\n optionsParsed = convertedOptions;\n pathname = convertedOptions.pathname || '/';\n } catch (e) {\n invalidUrl = true;\n logger.verbose(\n 'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:',\n e\n );\n // for backward compatibility with how url.parse() behaved.\n optionsParsed = {\n path: options,\n };\n pathname = optionsParsed.path || '/';\n }\n\n origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else if (options instanceof url.URL) {\n optionsParsed = {\n protocol: options.protocol,\n hostname:\n typeof options.hostname === 'string' && options.hostname.startsWith('[')\n ? options.hostname.slice(1, -1)\n : options.hostname,\n path: `${options.pathname || ''}${options.search || ''}`,\n };\n if (options.port !== '') {\n optionsParsed.port = Number(options.port);\n }\n if (options.username || options.password) {\n optionsParsed.auth = `${options.username}:${options.password}`;\n }\n pathname = options.pathname;\n origin = options.origin;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else {\n optionsParsed = Object.assign(\n { protocol: options.host ? 'http:' : undefined },\n options\n );\n\n const hostname =\n optionsParsed.host ||\n (optionsParsed.port != null\n ? `${optionsParsed.hostname}${optionsParsed.port}`\n : optionsParsed.hostname);\n origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;\n\n pathname = (options as url.URL).pathname;\n if (!pathname && optionsParsed.path) {\n try {\n const parsedUrl = new URL(optionsParsed.path, origin);\n pathname = parsedUrl.pathname || '/';\n } catch {\n pathname = '/';\n }\n }\n }\n\n // some packages return method in lowercase..\n // ensure upperCase for consistency\n const method = optionsParsed.method\n ? optionsParsed.method.toUpperCase()\n : 'GET';\n\n return { origin, pathname, method, optionsParsed, invalidUrl };\n};\n\n/**\n * Makes sure options is of type string or object\n * @param options for the request\n */\nexport const isValidOptionsType = (options: unknown): boolean => {\n if (!options) {\n return false;\n }\n\n const type = typeof options;\n return type === 'string' || (type === 'object' && !Array.isArray(options));\n};\n\nexport const extractHostnameAndPort = (\n requestOptions: Pick<\n ParsedRequestOptions,\n 'hostname' | 'host' | 'port' | 'protocol'\n >\n): { hostname: string; port: number | string } => {\n if (requestOptions.hostname && requestOptions.port) {\n return { hostname: requestOptions.hostname, port: requestOptions.port };\n }\n const matches = requestOptions.host?.match(/^([^:/ ]+)(:\\d{1,5})?/) || null;\n const hostname =\n requestOptions.hostname || (matches === null ? 'localhost' : matches[1]);\n let port = requestOptions.port;\n if (!port) {\n if (matches && matches[2]) {\n // remove the leading \":\". The extracted port would be something like \":8080\"\n port = matches[2].substring(1);\n } else {\n port = requestOptions.protocol === 'https:' ? '443' : '80';\n }\n }\n return { hostname, port };\n};\n\n/**\n * Returns outgoing request attributes scoped to the options passed to the request\n * @param {ParsedRequestOptions} requestOptions the same options used to make the request\n * @param {{ component: string, hostname: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes\n */\nexport const getOutgoingRequestAttributes = (\n requestOptions: ParsedRequestOptions,\n options: {\n component: string;\n hostname: string;\n port: string | number;\n hookAttributes?: Attributes;\n redactedQueryParams?: string[];\n },\n enableSyntheticSourceDetection: boolean\n): Attributes => {\n const hostname = options.hostname;\n const port = options.port;\n const method = requestOptions.method ?? 'GET';\n const normalizedMethod = normalizeMethod(method);\n const headers = (requestOptions.headers || {}) as OutgoingHttpHeaders;\n const userAgent = headers['user-agent'];\n const urlFull = getAbsoluteUrl(\n requestOptions,\n headers,\n `${options.component}:`,\n options.redactedQueryParams\n );\n\n const attributes: Attributes = {\n // Required attributes\n [ATTR_HTTP_REQUEST_METHOD]: normalizedMethod,\n [ATTR_SERVER_ADDRESS]: hostname,\n [ATTR_SERVER_PORT]: Number(port),\n [ATTR_URL_FULL]: urlFull,\n [ATTR_USER_AGENT_ORIGINAL]: userAgent,\n // leaving out protocol version, it is not yet negotiated\n // leaving out protocol name, it is only required when protocol version is set\n // retries and redirects not supported\n\n // Opt-in attributes left off for now\n };\n\n // conditionally required if request method required case normalization\n if (method !== normalizedMethod) {\n attributes[ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method;\n }\n\n if (enableSyntheticSourceDetection && userAgent) {\n attributes[ATTR_USER_AGENT_SYNTHETIC_TYPE] = getSyntheticType(userAgent);\n }\n return Object.assign(attributes, options.hookAttributes);\n};\n\n/**\n * Returns the type of synthetic source based on the user agent\n * @param {OutgoingHttpHeader} userAgent the user agent string\n */\nconst getSyntheticType = (\n userAgent: OutgoingHttpHeader\n): AttributeValue | undefined => {\n const userAgentString: string = String(userAgent).toLowerCase();\n for (const name of SYNTHETIC_TEST_NAMES) {\n if (userAgentString.includes(name)) {\n return USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST;\n }\n }\n for (const name of SYNTHETIC_BOT_NAMES) {\n if (userAgentString.includes(name)) {\n return USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT;\n }\n }\n return;\n};\n\n/**\n * Returns outgoing request attributes scoped to the response data\n * @param {IncomingMessage} response the response object\n */\nexport const getOutgoingRequestAttributesOnResponse = (\n response: IncomingMessage\n): Attributes => {\n const { statusCode, socket } = response;\n const attributes: Attributes = {};\n\n if (statusCode != null) {\n attributes[ATTR_HTTP_RESPONSE_STATUS_CODE] = statusCode;\n }\n\n if (socket) {\n const { remoteAddress, remotePort } = socket;\n\n // Recommended\n attributes[ATTR_NETWORK_PEER_ADDRESS] = remoteAddress;\n attributes[ATTR_NETWORK_PEER_PORT] = remotePort;\n attributes[ATTR_NETWORK_PROTOCOL_VERSION] = response.httpVersion;\n }\n return attributes;\n};\n\n/**\n * Returns outgoing request Metric attributes scoped to the response data\n * @param {Attributes} spanAttributes the span attributes\n */\nexport const getOutgoingStableRequestMetricAttributesOnResponse = (\n spanAttributes: Attributes\n): Attributes => {\n const metricAttributes: Attributes = {};\n\n if (spanAttributes[ATTR_NETWORK_PROTOCOL_VERSION]) {\n metricAttributes[ATTR_NETWORK_PROTOCOL_VERSION] =\n spanAttributes[ATTR_NETWORK_PROTOCOL_VERSION];\n }\n\n const statusCode = spanAttributes[ATTR_HTTP_RESPONSE_STATUS_CODE];\n if (statusCode) {\n metricAttributes[ATTR_HTTP_RESPONSE_STATUS_CODE] = statusCode;\n if (\n typeof statusCode === 'number' &&\n statusCode >= 400 &&\n statusCode < 600\n ) {\n metricAttributes[ATTR_ERROR_TYPE] ??= String(statusCode);\n }\n }\n return metricAttributes;\n};\n\nfunction parseHostHeader(\n hostHeader: string,\n proto?: string\n): { host: string; port?: string } {\n const parts = hostHeader.split(':');\n\n // no semicolon implies ipv4 dotted syntax or host name without port\n // x.x.x.x\n // example.com\n if (parts.length === 1) {\n if (proto === 'http') {\n return { host: parts[0], port: '80' };\n }\n\n if (proto === 'https') {\n return { host: parts[0], port: '443' };\n }\n\n return { host: parts[0] };\n }\n\n // single semicolon implies ipv4 dotted syntax or host name with port\n // x.x.x.x:yyyy\n // example.com:yyyy\n if (parts.length === 2) {\n return {\n host: parts[0],\n port: parts[1],\n };\n }\n\n // more than 2 parts implies ipv6 syntax with multiple colons\n // [x:x:x:x:x:x:x:x]\n // [x:x:x:x:x:x:x:x]:yyyy\n if (parts[0].startsWith('[')) {\n if (parts[parts.length - 1].endsWith(']')) {\n if (proto === 'http') {\n return { host: hostHeader, port: '80' };\n }\n\n if (proto === 'https') {\n return { host: hostHeader, port: '443' };\n }\n } else if (parts[parts.length - 2].endsWith(']')) {\n return {\n host: parts.slice(0, -1).join(':'),\n port: parts[parts.length - 1],\n };\n }\n }\n\n // if nothing above matches just return the host header\n return { host: hostHeader };\n}\n\n/**\n * Get server.address and port according to http semconv 1.27\n * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes\n */\nfunction getServerAddress(\n request: IncomingMessage,\n component: 'http' | 'https'\n): { host: string; port?: string } | null {\n const forwardedHeader = request.headers['forwarded'];\n if (forwardedHeader) {\n for (const entry of parseForwardedHeader(forwardedHeader)) {\n if (entry.host) {\n return parseHostHeader(entry.host, entry.proto);\n }\n }\n }\n\n const xForwardedHost = request.headers['x-forwarded-host'];\n if (typeof xForwardedHost === 'string') {\n if (typeof request.headers['x-forwarded-proto'] === 'string') {\n return parseHostHeader(\n xForwardedHost,\n request.headers['x-forwarded-proto']\n );\n }\n\n if (Array.isArray(request.headers['x-forwarded-proto'])) {\n return parseHostHeader(\n xForwardedHost,\n request.headers['x-forwarded-proto'][0]\n );\n }\n\n return parseHostHeader(xForwardedHost);\n } else if (\n Array.isArray(xForwardedHost) &&\n typeof xForwardedHost[0] === 'string' &&\n xForwardedHost[0].length > 0\n ) {\n if (typeof request.headers['x-forwarded-proto'] === 'string') {\n return parseHostHeader(\n xForwardedHost[0],\n request.headers['x-forwarded-proto']\n );\n }\n\n if (Array.isArray(request.headers['x-forwarded-proto'])) {\n return parseHostHeader(\n xForwardedHost[0],\n request.headers['x-forwarded-proto'][0]\n );\n }\n\n return parseHostHeader(xForwardedHost[0]);\n }\n\n const host = request.headers['host'];\n if (typeof host === 'string' && host.length > 0) {\n return parseHostHeader(host, component);\n }\n\n return null;\n}\n\n/**\n * Get server.address and port according to http semconv 1.27\n * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes\n */\nexport function getRemoteClientAddress(\n request: IncomingMessage\n): string | null {\n const forwardedHeader = request.headers['forwarded'];\n if (forwardedHeader) {\n for (const entry of parseForwardedHeader(forwardedHeader)) {\n if (entry.for) {\n return removePortFromAddress(entry.for);\n }\n }\n }\n\n const xForwardedFor = request.headers['x-forwarded-for'];\n if (xForwardedFor) {\n let xForwardedForVal;\n if (typeof xForwardedFor === 'string') {\n xForwardedForVal = xForwardedFor;\n } else if (Array.isArray(xForwardedFor)) {\n xForwardedForVal = xForwardedFor[0];\n }\n\n if (typeof xForwardedForVal === 'string') {\n xForwardedForVal = xForwardedForVal.split(',')[0].trim();\n return removePortFromAddress(xForwardedForVal);\n }\n }\n\n const remote = request.socket.remoteAddress;\n if (remote) {\n return remote;\n }\n\n return null;\n}\n\nfunction removePortFromAddress(input: string): string {\n // This function can be replaced with SocketAddress.parse() once the minimum\n // supported Node.js version allows it.\n try {\n const { hostname: address } = new URL(`http://${input}`);\n\n if (address.startsWith('[') && address.endsWith(']')) {\n return address.slice(1, -1);\n }\n\n return address;\n } catch {\n return input;\n }\n}\n\nfunction getInfoFromIncomingMessage(\n component: 'http' | 'https',\n request: IncomingMessage,\n logger: DiagLogger\n): { pathname?: string; search?: string; toString: () => string } {\n try {\n if (request.headers.host) {\n return new URL(\n request.url ?? '/',\n `${component}://${request.headers.host}`\n );\n } else {\n const unsafeParsedUrl = new URL(\n request.url ?? '/',\n // using localhost as a workaround to still use the URL constructor for parsing\n `${component}://localhost`\n );\n // since we use localhost as a workaround, ensure we hide the rest of the properties to avoid\n // our workaround leaking though.\n return {\n pathname: unsafeParsedUrl.pathname,\n search: unsafeParsedUrl.search,\n toString: function () {\n // we cannot use the result of unsafeParsedUrl.toString as it's potentially wrong.\n return unsafeParsedUrl.pathname + unsafeParsedUrl.search;\n },\n };\n }\n } catch (e) {\n // something is wrong, use undefined - this *should* never happen, logging\n // for troubleshooting in case it does happen.\n logger.verbose('Unable to get URL from request', e);\n return {};\n }\n}\n\n/**\n * Returns incoming request attributes scoped to the request data\n * @param {IncomingMessage} request the request object\n * @param {{ component: string, hookAttributes?: Attributes, enableSyntheticSourceDetection: boolean }} options used to pass data needed to create attributes\n */\nexport const getIncomingRequestAttributes = (\n request: IncomingMessage,\n options: {\n component: 'http' | 'https';\n hookAttributes?: Attributes;\n enableSyntheticSourceDetection: boolean;\n redactedQueryParams?: string[];\n },\n logger: DiagLogger\n): Attributes => {\n const {\n component,\n enableSyntheticSourceDetection,\n hookAttributes,\n redactedQueryParams,\n } = options;\n const { headers, method } = request;\n const { 'user-agent': userAgent } = headers;\n const parsedUrl = getInfoFromIncomingMessage(component, request, logger);\n\n // Stable attributes are used.\n const normalizedMethod = normalizeMethod(method);\n const serverAddress = getServerAddress(request, component);\n const remoteClientAddress = getRemoteClientAddress(request);\n\n const attributes: Attributes = {\n [ATTR_HTTP_REQUEST_METHOD]: normalizedMethod,\n [ATTR_URL_SCHEME]: component,\n [ATTR_SERVER_ADDRESS]: serverAddress?.host,\n [ATTR_NETWORK_PEER_ADDRESS]: request.socket.remoteAddress,\n [ATTR_NETWORK_PEER_PORT]: request.socket.remotePort,\n [ATTR_NETWORK_PROTOCOL_VERSION]: request.httpVersion,\n [ATTR_USER_AGENT_ORIGINAL]: userAgent,\n };\n\n if (parsedUrl.pathname != null) {\n attributes[ATTR_URL_PATH] = parsedUrl.pathname;\n }\n\n if (parsedUrl.search) {\n // Remove leading '?' from URL search (https://developer.mozilla.org/en-US/docs/Web/API/URL/search).\n const paramsToRedact = redactedQueryParams ?? defaultQueryStringsToRedact;\n attributes[ATTR_URL_QUERY] = redactQueryString(\n new URLSearchParams(parsedUrl.search.slice(1)),\n paramsToRedact\n );\n }\n\n if (remoteClientAddress != null) {\n attributes[ATTR_CLIENT_ADDRESS] = remoteClientAddress;\n }\n\n if (serverAddress?.port != null) {\n attributes[ATTR_SERVER_PORT] = Number(serverAddress.port);\n }\n\n // Conditionally required if request method required case normalization.\n if (method !== normalizedMethod) {\n attributes[ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method;\n }\n\n if (enableSyntheticSourceDetection && userAgent) {\n attributes[ATTR_USER_AGENT_SYNTHETIC_TYPE] = getSyntheticType(userAgent);\n }\n\n return Object.assign(attributes, hookAttributes);\n};\n\n/**\n * Returns incoming request attributes scoped to the response data\n * @param {(ServerResponse & { socket: Socket; })} response the response object\n */\nexport const getIncomingRequestAttributesOnResponse = (\n response: ServerResponse\n): Attributes => {\n const { statusCode } = response;\n\n const attributes: Attributes = {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: statusCode,\n };\n\n const rpcMetadata = getRPCMetadata(context.active());\n if (rpcMetadata?.type === RPCType.HTTP && rpcMetadata.route !== undefined) {\n attributes[ATTR_HTTP_ROUTE] = rpcMetadata.route;\n }\n\n return attributes;\n};\n\n/**\n * Returns incoming stable request Metric attributes scoped to the request data\n * @param {Attributes} spanAttributes the span attributes\n */\nexport const getIncomingStableRequestMetricAttributesOnResponse = (\n spanAttributes: Attributes\n): Attributes => {\n const metricAttributes: Attributes = {};\n if (spanAttributes[ATTR_HTTP_ROUTE] !== undefined) {\n metricAttributes[ATTR_HTTP_ROUTE] = spanAttributes[ATTR_HTTP_ROUTE];\n }\n\n // required if and only if one was sent, same as span requirement\n const statusCode = spanAttributes[ATTR_HTTP_RESPONSE_STATUS_CODE];\n if (statusCode) {\n metricAttributes[ATTR_HTTP_RESPONSE_STATUS_CODE] = statusCode;\n if (\n typeof statusCode === 'number' &&\n statusCode >= 500 &&\n statusCode < 600\n ) {\n metricAttributes[ATTR_ERROR_TYPE] ??= String(statusCode);\n }\n }\n\n return metricAttributes;\n};\n\nexport function headerCapture(type: 'request' | 'response', headers: string[]) {\n const normalizedHeaders = new Map<string, string>();\n for (let i = 0, len = headers.length; i < len; i++) {\n const capturedHeader = headers[i].toLowerCase();\n normalizedHeaders.set(capturedHeader, capturedHeader);\n }\n\n return (\n getHeader: (key: string) => undefined | string | string[] | number\n ): Attributes => {\n const attributes: Attributes = {};\n for (const capturedHeader of normalizedHeaders.keys()) {\n const value = getHeader(capturedHeader);\n\n if (value === undefined) {\n continue;\n }\n\n const normalizedHeader = normalizedHeaders.get(capturedHeader);\n const key = `http.${type}.header.${normalizedHeader}`;\n\n if (typeof value === 'string') {\n attributes[key] = [value];\n } else if (Array.isArray(value)) {\n attributes[key] = value;\n } else {\n attributes[key] = [value];\n }\n }\n return attributes;\n };\n}\n\nconst KNOWN_METHODS = new Set([\n // methods from https://www.rfc-editor.org/rfc/rfc9110.html#name-methods\n 'GET',\n 'HEAD',\n 'POST',\n 'PUT',\n 'DELETE',\n 'CONNECT',\n 'OPTIONS',\n 'TRACE',\n\n // PATCH from https://www.rfc-editor.org/rfc/rfc5789.html\n 'PATCH',\n\n // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/\n 'QUERY',\n]);\n\nfunction normalizeMethod(method?: string | null) {\n if (method == null) {\n return 'GET';\n }\n\n const upper = method.toUpperCase();\n if (KNOWN_METHODS.has(upper)) {\n return upper;\n }\n\n return '_OTHER';\n}\n\nfunction parseForwardedHeader(header: string): Record<string, string>[] {\n try {\n return forwardedParse(header);\n } catch {\n return [];\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare const VERSION = "0.222.0-development.0";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1,10 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.VERSION = void 0;
8
- // this is autogenerated file, see scripts/version-update.js
9
- exports.VERSION = '0.222.0-development.0';
10
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,uBAAuB,CAAC","sourcesContent":["/*\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.222.0-development.0';\n"]}