@opentelemetry/instrumentation-http 0.222.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
package/package.json CHANGED
@@ -1,26 +1,38 @@
1
1
  {
2
2
  "name": "@opentelemetry/instrumentation-http",
3
- "version": "0.222.0",
3
+ "version": "0.300.0-development.0",
4
4
  "description": "OpenTelemetry instrumentation for `node:http` and `node:https` http client and server modules",
5
- "main": "build/src/index.js",
6
- "types": "build/src/index.d.ts",
5
+ "main": "./dist/index.cjs",
6
+ "types": "./dist/index.d.cts",
7
+ "exports": {
8
+ ".": {
9
+ "import": {
10
+ "types": "./dist/index.d.mts",
11
+ "default": "./dist/index.mjs"
12
+ },
13
+ "require": {
14
+ "types": "./dist/index.d.cts",
15
+ "default": "./dist/index.cjs"
16
+ }
17
+ }
18
+ },
7
19
  "repository": "open-telemetry/opentelemetry-js",
8
20
  "scripts": {
9
21
  "prepublishOnly": "npm run compile",
10
- "compile": "tsc --build",
11
- "clean": "tsc --build --clean",
22
+ "compile": "tsdown && tsdown -c tsdown.test.config.ts",
23
+ "clean": "rimraf dist build",
12
24
  "test:cjs": "nyc --silent mocha test/**/*.test.ts",
13
- "test:esm": "nyc --silent --no-clean node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../node_modules/mocha/bin/mocha 'test/**/*.test.mjs'",
14
- "test:double-instr": "nyc --silent --no-clean node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../node_modules/mocha/bin/mocha 'test/integrations/double-instr.test.cjs'",
25
+ "test:esm": "nyc --silent --no-clean node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../scripts/run-mocha.mjs 'test/**/*.test.mjs'",
26
+ "test:double-instr": "nyc --silent --no-clean node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../scripts/run-mocha.mjs 'test/integrations/double-instr.test.cjs'",
15
27
  "test": "npm run test:cjs && npm run test:esm && npm run test:double-instr && nyc report",
16
28
  "tdd": "npm run test -- --watch-extensions ts --watch",
17
29
  "lint": "eslint .",
18
30
  "lint:fix": "eslint . --fix",
19
31
  "version": "node ../../../scripts/version-update.js",
20
- "watch": "tsc --build --watch",
32
+ "watch": "tsdown --watch --no-clean",
21
33
  "prewatch": "node ../../../scripts/version-update.js",
22
- "peer-api-check": "node ../../../scripts/peer-api-check.js",
23
- "align-api-deps": "node ../../../scripts/align-api-deps.js",
34
+ "peer-api-check": "node ../../../scripts/peer-api-check.mjs",
35
+ "align-api-deps": "node ../../../scripts/align-api-deps.mjs",
24
36
  "maint:regenerate-test-certs": "cd test/fixtures && ./regenerate.sh"
25
37
  },
26
38
  "keywords": [
@@ -34,24 +46,22 @@
34
46
  "author": "OpenTelemetry Authors",
35
47
  "license": "Apache-2.0",
36
48
  "engines": {
37
- "node": "^18.19.0 || >=20.6.0"
49
+ "node": ">=22.15.0"
38
50
  },
39
51
  "files": [
40
- "build/src/**/*.js",
41
- "build/src/**/*.js.map",
42
- "build/src/**/*.d.ts",
43
52
  "doc",
44
53
  "LICENSE",
45
- "README.md"
54
+ "README.md",
55
+ "dist"
46
56
  ],
47
57
  "publishConfig": {
48
58
  "access": "public"
49
59
  },
50
60
  "devDependencies": {
51
61
  "@opentelemetry/api": "1.9.1",
52
- "@opentelemetry/context-async-hooks": "2.11.0",
53
- "@opentelemetry/sdk-metrics": "2.11.0",
54
- "@opentelemetry/sdk-trace": "2.11.0",
62
+ "@opentelemetry/context-async-hooks": "3.0.0-development.0",
63
+ "@opentelemetry/sdk-metrics": "3.0.0-development.0",
64
+ "@opentelemetry/sdk-trace": "3.0.0-development.0",
55
65
  "@types/mocha": "10.0.10",
56
66
  "@types/node": "18.19.130",
57
67
  "@types/request-promise-native": "1.0.21",
@@ -69,12 +79,12 @@
69
79
  "@opentelemetry/api": "^1.3.0"
70
80
  },
71
81
  "dependencies": {
72
- "@opentelemetry/core": "2.11.0",
73
- "@opentelemetry/instrumentation": "0.222.0",
82
+ "@opentelemetry/core": "3.0.0-development.0",
83
+ "@opentelemetry/instrumentation": "0.300.0-development.0",
74
84
  "@opentelemetry/semantic-conventions": "^1.29.0",
75
85
  "forwarded-parse": "2.1.2"
76
86
  },
77
87
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http",
78
88
  "sideEffects": false,
79
- "gitHead": "0b72a81636fa476e8f1f1afd2ae0c90a1362194c"
89
+ "gitHead": "ad3499bf70ee996f5565e5cd00f2c5fcb2e87042"
80
90
  }
@@ -1,61 +0,0 @@
1
- import type { HttpInstrumentationConfig } from './types';
2
- import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
- /**
4
- * `node:http` and `node:https` instrumentation for OpenTelemetry
5
- */
6
- export declare class HttpInstrumentation extends InstrumentationBase<HttpInstrumentationConfig> {
7
- /** keep track on spans not ended */
8
- private readonly _spanNotEnded;
9
- private _headerCapture;
10
- private _httpPatched;
11
- private _httpsPatched;
12
- private _httpServerDurationHistogram;
13
- private _httpClientDurationHistogram;
14
- constructor(config?: HttpInstrumentationConfig);
15
- protected _updateMetricInstruments(): void;
16
- private _recordServerDuration;
17
- private _recordClientDuration;
18
- setConfig(config?: HttpInstrumentationConfig): void;
19
- init(): [
20
- InstrumentationNodeModuleDefinition,
21
- InstrumentationNodeModuleDefinition
22
- ];
23
- private _getHttpInstrumentation;
24
- private _getHttpsInstrumentation;
25
- /**
26
- * Creates spans for incoming requests, restoring spans' context if applied.
27
- */
28
- private _getPatchIncomingRequestFunction;
29
- /**
30
- * Creates spans for outgoing requests, sending spans' context for distributed
31
- * tracing.
32
- */
33
- private _getPatchOutgoingRequestFunction;
34
- private _getPatchOutgoingGetFunction;
35
- /** Patches HTTPS outgoing requests */
36
- private _getPatchHttpsOutgoingRequestFunction;
37
- private _setDefaultOptions;
38
- /** Patches HTTPS outgoing get requests */
39
- private _getPatchHttpsOutgoingGetFunction;
40
- /**
41
- * Attach event listeners to a client request to end span and add span attributes.
42
- *
43
- * @param request The original request object.
44
- * @param span representing the current operation
45
- * @param startTime representing the start time of the request to calculate duration in Metric
46
- * @param metricAttributes metric attributes for the request duration metric
47
- */
48
- private _traceClientRequest;
49
- private _incomingRequestFunction;
50
- private _outgoingRequestFunction;
51
- private _onServerResponseFinish;
52
- private _onOutgoingRequestError;
53
- private _onServerResponseError;
54
- private _startHttpSpan;
55
- private _closeHttpSpan;
56
- private _callResponseHook;
57
- private _callRequestHook;
58
- private _callStartSpanHook;
59
- private _createHeaderCapture;
60
- }
61
- //# sourceMappingURL=http.d.ts.map