@astroscope/opentelemetry 0.2.2 → 0.2.4
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/README.md
CHANGED
|
@@ -75,21 +75,17 @@ function createOpenTelemetryMiddleware(options = {}) {
|
|
|
75
75
|
finalize(response.status, 0);
|
|
76
76
|
return response;
|
|
77
77
|
}
|
|
78
|
-
const [measureStream, clientStream] = response.body.tee();
|
|
79
78
|
let responseSize = 0;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
responseSize += value.length;
|
|
87
|
-
}
|
|
88
|
-
} finally {
|
|
79
|
+
const transform = new TransformStream({
|
|
80
|
+
transform(chunk, controller) {
|
|
81
|
+
responseSize += chunk.length;
|
|
82
|
+
controller.enqueue(chunk);
|
|
83
|
+
},
|
|
84
|
+
flush() {
|
|
89
85
|
finalize(response.status, responseSize);
|
|
90
86
|
}
|
|
91
|
-
})
|
|
92
|
-
return new Response(
|
|
87
|
+
});
|
|
88
|
+
return new Response(response.body.pipeThrough(transform), {
|
|
93
89
|
status: response.status,
|
|
94
90
|
headers: response.headers
|
|
95
91
|
});
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astroscope/opentelemetry",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "OpenTelemetry for Astro — tracing, metrics, and component instrumentation that works in dev mode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@opentelemetry/api": "^1.9.0",
|
|
58
|
-
"@opentelemetry/core": "^2.
|
|
59
|
-
"astro": "^5.
|
|
58
|
+
"@opentelemetry/core": "^2.5.0",
|
|
59
|
+
"astro": "^5.17.1",
|
|
60
60
|
"tsup": "^8.5.1",
|
|
61
61
|
"typescript": "^5.9.3"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@astroscope/excludes": "^0.1.
|
|
64
|
+
"@astroscope/excludes": "^0.1.3",
|
|
65
65
|
"@opentelemetry/api": "^1.0.0",
|
|
66
66
|
"@opentelemetry/core": "^2.0.0",
|
|
67
67
|
"astro": "^5.0.0"
|