@clickhouse/clickstack-node 0.0.0-stage → 1.0.0-rc.1
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.
- package/LICENSE +203 -0
- package/README.md +282 -2
- package/dist/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/body/http.cjs +115 -0
- package/dist/body/http.mjs +115 -0
- package/dist/body/rules.cjs +225 -0
- package/dist/body/rules.mjs +220 -0
- package/dist/body/undici.cjs +88 -0
- package/dist/body/undici.mjs +87 -0
- package/dist/compose.cjs +107 -0
- package/dist/compose.mjs +107 -0
- package/dist/config.cjs +27 -0
- package/dist/config.d.cts +61 -0
- package/dist/config.d.mts +61 -0
- package/dist/config.mjs +27 -0
- package/dist/env.cjs +88 -0
- package/dist/env.mjs +84 -0
- package/dist/exception.cjs +54 -0
- package/dist/exception.mjs +54 -0
- package/dist/hook.cjs +47 -0
- package/dist/hook.mjs +45 -0
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +3 -0
- package/dist/init.cjs +139 -0
- package/dist/init.d.cts +28 -0
- package/dist/init.d.mts +28 -0
- package/dist/init.mjs +137 -0
- package/dist/lifecycle.cjs +249 -0
- package/dist/lifecycle.d.cts +68 -0
- package/dist/lifecycle.d.mts +68 -0
- package/dist/lifecycle.mjs +245 -0
- package/dist/register.cjs +12 -0
- package/dist/register.d.cts +1 -0
- package/dist/register.d.mts +1 -0
- package/dist/register.mjs +14 -0
- package/dist/semconv.cjs +16 -0
- package/dist/semconv.mjs +13 -0
- package/dist/state.cjs +12 -0
- package/dist/state.mjs +12 -0
- package/dist/version.cjs +4 -0
- package/dist/version.mjs +4 -0
- package/package.json +114 -4
package/dist/semconv.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/semconv.ts
|
|
2
|
+
/** `http.request.body.size`: semantic-conventions v1.43.0, development. */
|
|
3
|
+
const ATTR_HTTP_REQUEST_BODY_SIZE = "http.request.body.size";
|
|
4
|
+
/** `http.response.body.size`: semantic-conventions v1.43.0, development. */
|
|
5
|
+
const ATTR_HTTP_RESPONSE_BODY_SIZE = "http.response.body.size";
|
|
6
|
+
/**
|
|
7
|
+
* `http.request.body.content`: development. Added on semantic-conventions `main`
|
|
8
|
+
* by PR #3521 (commit bcd7e291081f, 2026-08-14); not in a release as of v1.44.0.
|
|
9
|
+
*/
|
|
10
|
+
const ATTR_HTTP_REQUEST_BODY_CONTENT = "http.request.body.content";
|
|
11
|
+
/** `http.response.body.content`: same source as {@link ATTR_HTTP_REQUEST_BODY_CONTENT}. */
|
|
12
|
+
const ATTR_HTTP_RESPONSE_BODY_CONTENT = "http.response.body.content";
|
|
13
|
+
export { ATTR_HTTP_REQUEST_BODY_CONTENT, ATTR_HTTP_REQUEST_BODY_SIZE, ATTR_HTTP_RESPONSE_BODY_CONTENT, ATTR_HTTP_RESPONSE_BODY_SIZE };
|
package/dist/state.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/state.ts
|
|
2
|
+
const KEY = Symbol.for("@clickhouse/clickstack-node");
|
|
3
|
+
/**
|
|
4
|
+
* Returns the per-thread shared state, creating it on first use.
|
|
5
|
+
*
|
|
6
|
+
* @returns The state stored on `globalThis`.
|
|
7
|
+
*/
|
|
8
|
+
function getState() {
|
|
9
|
+
const slot = globalThis;
|
|
10
|
+
return slot[KEY] ??= {};
|
|
11
|
+
}
|
|
12
|
+
exports.getState = getState;
|
package/dist/state.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/state.ts
|
|
2
|
+
const KEY = Symbol.for("@clickhouse/clickstack-node");
|
|
3
|
+
/**
|
|
4
|
+
* Returns the per-thread shared state, creating it on first use.
|
|
5
|
+
*
|
|
6
|
+
* @returns The state stored on `globalThis`.
|
|
7
|
+
*/
|
|
8
|
+
function getState() {
|
|
9
|
+
const slot = globalThis;
|
|
10
|
+
return slot[KEY] ??= {};
|
|
11
|
+
}
|
|
12
|
+
export { getState };
|
package/dist/version.cjs
ADDED
package/dist/version.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,116 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickhouse/clickstack-node",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"description": "OpenTelemetry Node.js for ClickHouse Observability",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"opentelemetry",
|
|
7
|
+
"otel",
|
|
8
|
+
"clickstack",
|
|
9
|
+
"clickhouse",
|
|
10
|
+
"tracing",
|
|
11
|
+
"observability",
|
|
12
|
+
"distro"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/ClickHouse/clickstack-node#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/ClickHouse/clickstack-node/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/ClickHouse/clickstack-node.git"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/index.d.mts",
|
|
28
|
+
"default": "./dist/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/index.d.cts",
|
|
32
|
+
"default": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./register": {
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/register.d.mts",
|
|
38
|
+
"default": "./dist/register.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/register.d.cts",
|
|
42
|
+
"default": "./dist/register.cjs"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"main": "./dist/index.cjs",
|
|
48
|
+
"types": "./dist/index.d.cts",
|
|
49
|
+
"files": [
|
|
50
|
+
"dist"
|
|
51
|
+
],
|
|
52
|
+
"sideEffects": [
|
|
53
|
+
"./dist/register.mjs",
|
|
54
|
+
"./dist/register.cjs"
|
|
55
|
+
],
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22.15.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsdown",
|
|
61
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
62
|
+
"lint": "eslint --max-warnings 0 .",
|
|
63
|
+
"format": "prettier --write .",
|
|
64
|
+
"format:check": "prettier --check .",
|
|
65
|
+
"test": "vitest run --project unit --coverage",
|
|
66
|
+
"test:e2e": "vitest run --project e2e",
|
|
67
|
+
"spell": "cspell lint --no-progress --dot --gitignore \"**\"",
|
|
68
|
+
"pack:check": "node -e \"require('node:fs').mkdirSync('pack', { recursive: true })\" && npm pack --pack-destination pack --silent && publint --strict pack/*.tgz && attw --profile node16 pack/*.tgz",
|
|
69
|
+
"check": "npm run spell && npm run format:check && npm run lint && npm run typecheck && npm run test && npm run build && npm run pack:check && npm run test:e2e"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@opentelemetry/api-logs": "^0.223.0",
|
|
73
|
+
"@opentelemetry/auto-instrumentations-node": "^0.81.0",
|
|
74
|
+
"@opentelemetry/core": "^2.12.0",
|
|
75
|
+
"@opentelemetry/instrumentation": "^0.223.0",
|
|
76
|
+
"@opentelemetry/instrumentation-console": "^0.5.0",
|
|
77
|
+
"@opentelemetry/resources": "^2.12.0",
|
|
78
|
+
"@opentelemetry/sdk-node": "^0.223.0",
|
|
79
|
+
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
80
|
+
"import-in-the-middle": "^3.5.2"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"@opentelemetry/api": ">=1.9.1 <1.10.0"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
87
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.8.1",
|
|
88
|
+
"@eslint/js": "10.0.1",
|
|
89
|
+
"@opentelemetry/api": "1.9.1",
|
|
90
|
+
"@types/node": "22.20.5",
|
|
91
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
92
|
+
"cspell": "10.4.0",
|
|
93
|
+
"eslint": "10.13.0",
|
|
94
|
+
"eslint-plugin-tsdoc": "0.5.4",
|
|
95
|
+
"globals": "17.13.0",
|
|
96
|
+
"prettier": "3.9.10",
|
|
97
|
+
"publint": "0.3.25",
|
|
98
|
+
"tsdown": "0.23.1",
|
|
99
|
+
"typescript": "6.0.3",
|
|
100
|
+
"typescript-eslint": "8.72.0",
|
|
101
|
+
"vitest": "5.0.5"
|
|
102
|
+
},
|
|
103
|
+
"devEngines": {
|
|
104
|
+
"runtime": {
|
|
105
|
+
"name": "node",
|
|
106
|
+
"version": "^24.11.0 || >=26.0.0",
|
|
107
|
+
"onFail": "error"
|
|
108
|
+
},
|
|
109
|
+
"packageManager": {
|
|
110
|
+
"name": "npm",
|
|
111
|
+
"version": ">=11.11.0 <12",
|
|
112
|
+
"onFail": "error"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"packageManager": "npm@11.19.1"
|
|
116
|
+
}
|