veryfront 0.1.811 → 0.1.812
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/esm/deno.js +1 -1
- package/esm/src/agent/conversation/durable-contracts.d.ts +204 -0
- package/esm/src/agent/conversation/durable-contracts.d.ts.map +1 -0
- package/esm/src/agent/conversation/durable-contracts.js +168 -0
- package/esm/src/agent/conversation/durable.d.ts +3 -198
- package/esm/src/agent/conversation/durable.d.ts.map +1 -1
- package/esm/src/agent/conversation/durable.js +2 -167
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +2 -1
- package/esm/src/modules/manifest/route-module-manifest.d.ts.map +1 -1
- package/esm/src/modules/manifest/route-module-manifest.js +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +27 -9
- package/esm/src/observability/simple-metrics/index.d.ts +6 -3
- package/esm/src/observability/simple-metrics/index.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/index.js +5 -2
- package/esm/src/observability/simple-metrics/metrics-recorder.d.ts +4 -0
- package/esm/src/observability/simple-metrics/metrics-recorder.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/metrics-recorder.js +34 -0
- package/esm/src/observability/simple-metrics/metrics-state.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/metrics-state.js +24 -0
- package/esm/src/observability/simple-metrics/otel-instruments.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/otel-instruments.js +13 -0
- package/esm/src/observability/simple-metrics/types.d.ts +12 -0
- package/esm/src/observability/simple-metrics/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +1 -1
- package/esm/src/platform/compat/http/native-response.d.ts +10 -1
- package/esm/src/platform/compat/http/native-response.d.ts.map +1 -1
- package/esm/src/platform/compat/http/native-response.js +20 -14
- package/esm/src/proxy/handler.d.ts +1 -7
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +24 -160
- package/esm/src/proxy/proxy-access-control.d.ts +41 -0
- package/esm/src/proxy/proxy-access-control.d.ts.map +1 -0
- package/esm/src/proxy/proxy-access-control.js +151 -0
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +3 -1
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +1 -0
- package/esm/src/rendering/cache/stores/memory-store.d.ts +2 -0
- package/esm/src/rendering/cache/stores/memory-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/memory-store.js +2 -1
- package/esm/src/rendering/orchestrator/lifecycle.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/lifecycle.js +1 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +13 -25
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +27 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.js +28 -0
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +1 -0
- package/esm/src/server/handlers/dev/dashboard/api.d.ts +3 -0
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +41 -57
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +11 -1
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +14 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, CreateConversationRunAcceptedSchema, getConversationRunErrorSchema, resolveConversationRunTargets, } from "./durable-contracts.js";
|
|
3
|
+
export { AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, ConversationRunStatusSchema, ConversationRunTargetsSchema, CreateConversationRunAcceptedSchema, getAppendConversationRunEventsResponseSchema, getCompleteConversationRunResponseSchema, getConversationRunProjectionSchema, getConversationRunStatusSchema, getConversationRunTargetsSchema, getCreateConversationRunAcceptedSchema, resolveConversationRunTargets, } from "./durable-contracts.js";
|
|
3
4
|
const AGENT_RUN_API_TIMEOUT_MS = 15_000;
|
|
4
5
|
function createTimedAbortSignal(timeoutMs, abortSignal) {
|
|
5
6
|
const controller = new AbortController();
|
|
@@ -26,173 +27,7 @@ function createTimedAbortSignal(timeoutMs, abortSignal) {
|
|
|
26
27
|
},
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
/** Zod schema for get conversation run targets. */
|
|
30
|
-
export const getConversationRunTargetsSchema = defineSchema((v) => v.object({
|
|
31
|
-
sourceTargetKind: v.enum(["project", "preview_branch"]).nullable(),
|
|
32
|
-
runtimeTargetKind: v.enum(["main_branch", "preview_branch"]).nullable(),
|
|
33
|
-
targetBranchId: v.string().uuid().nullable(),
|
|
34
|
-
}));
|
|
35
|
-
/** Schema for conversation run targets.
|
|
36
|
-
* @deprecated Use getConversationRunTargetsSchema()
|
|
37
|
-
*/
|
|
38
|
-
export const ConversationRunTargetsSchema = lazySchema(getConversationRunTargetsSchema);
|
|
39
|
-
/** Resolves conversation run targets. */
|
|
40
|
-
export function resolveConversationRunTargets(input) {
|
|
41
|
-
return getConversationRunTargetsSchema().parse(!input.projectId
|
|
42
|
-
? {
|
|
43
|
-
sourceTargetKind: null,
|
|
44
|
-
runtimeTargetKind: null,
|
|
45
|
-
targetBranchId: null,
|
|
46
|
-
}
|
|
47
|
-
: input.branchId
|
|
48
|
-
? {
|
|
49
|
-
sourceTargetKind: "preview_branch",
|
|
50
|
-
runtimeTargetKind: "preview_branch",
|
|
51
|
-
targetBranchId: input.branchId,
|
|
52
|
-
}
|
|
53
|
-
: {
|
|
54
|
-
sourceTargetKind: "project",
|
|
55
|
-
runtimeTargetKind: "main_branch",
|
|
56
|
-
targetBranchId: null,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/** Zod schema for get conversation run status. */
|
|
60
|
-
export const getConversationRunStatusSchema = defineSchema((v) => v.enum(["pending", "running", "waiting_for_tool", "completed", "failed", "cancelled"]));
|
|
61
|
-
/** Schema for conversation run status.
|
|
62
|
-
* @deprecated Use getConversationRunStatusSchema()
|
|
63
|
-
*/
|
|
64
|
-
export const ConversationRunStatusSchema = lazySchema(getConversationRunStatusSchema);
|
|
65
|
-
/** Zod schema for get conversation run projection. */
|
|
66
|
-
export const getConversationRunProjectionSchema = defineSchema((v) => v.object({
|
|
67
|
-
runId: v.string().min(1).optional(),
|
|
68
|
-
run_id: v.string().min(1).optional(),
|
|
69
|
-
conversationId: v.string().uuid().optional(),
|
|
70
|
-
conversation_id: v.string().uuid().optional(),
|
|
71
|
-
messageId: v.string().uuid().optional(),
|
|
72
|
-
message_id: v.string().uuid().optional(),
|
|
73
|
-
latestEventId: v.number().int().nonnegative().optional(),
|
|
74
|
-
latest_event_id: v.number().int().nonnegative().optional(),
|
|
75
|
-
latestExternalEventSequence: v.number().int().nonnegative().optional(),
|
|
76
|
-
latest_external_event_sequence: v.number().int().nonnegative().optional(),
|
|
77
|
-
waitingToolCallId: v.string().min(1).nullable().optional(),
|
|
78
|
-
waiting_tool_call_id: v.string().min(1).nullable().optional(),
|
|
79
|
-
waitingToolName: v.string().nullable().optional(),
|
|
80
|
-
waiting_tool_name: v.string().nullable().optional(),
|
|
81
|
-
status: getConversationRunStatusSchema(),
|
|
82
|
-
})
|
|
83
|
-
.passthrough()
|
|
84
|
-
.transform((data) => {
|
|
85
|
-
const d = data;
|
|
86
|
-
const runId = (d.runId ?? d.run_id);
|
|
87
|
-
const conversationId = (d.conversationId ?? d.conversation_id);
|
|
88
|
-
const messageId = (d.messageId ?? d.message_id);
|
|
89
|
-
const latestEventId = (d.latestEventId ?? d.latest_event_id) ?? 0;
|
|
90
|
-
const latestExternalEventSequence = (d.latestExternalEventSequence ??
|
|
91
|
-
d.latest_external_event_sequence);
|
|
92
|
-
if (!runId || !conversationId || !messageId) {
|
|
93
|
-
throw new Error("Missing run identifiers in durable run response");
|
|
94
|
-
}
|
|
95
|
-
if (latestExternalEventSequence === undefined) {
|
|
96
|
-
throw new Error("Missing latestExternalEventSequence in durable run response");
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
runId,
|
|
100
|
-
conversationId,
|
|
101
|
-
messageId,
|
|
102
|
-
latestEventId,
|
|
103
|
-
latestExternalEventSequence,
|
|
104
|
-
waitingToolCallId: (d.waitingToolCallId ?? d.waiting_tool_call_id) ??
|
|
105
|
-
null,
|
|
106
|
-
waitingToolName: (d.waitingToolName ?? d.waiting_tool_name) ?? null,
|
|
107
|
-
status: d.status,
|
|
108
|
-
};
|
|
109
|
-
}));
|
|
110
|
-
/** Schema for conversation run projection.
|
|
111
|
-
* @deprecated Use getConversationRunProjectionSchema()
|
|
112
|
-
*/
|
|
113
|
-
export const ConversationRunProjectionSchema = lazySchema(getConversationRunProjectionSchema);
|
|
114
|
-
/** Zod schema for get create conversation run accepted. */
|
|
115
|
-
export const getCreateConversationRunAcceptedSchema = defineSchema((v) => v.object({
|
|
116
|
-
run: v.object({
|
|
117
|
-
runId: v.string().min(1).optional(),
|
|
118
|
-
run_id: v.string().min(1).optional(),
|
|
119
|
-
}).passthrough(),
|
|
120
|
-
})
|
|
121
|
-
.passthrough()
|
|
122
|
-
.transform((data) => {
|
|
123
|
-
const d = data;
|
|
124
|
-
const runId = (d.run.runId ?? d.run.run_id);
|
|
125
|
-
if (!runId) {
|
|
126
|
-
throw new Error("Missing run id in canonical create run response");
|
|
127
|
-
}
|
|
128
|
-
return { runId };
|
|
129
|
-
}));
|
|
130
|
-
/** Schema for create conversation run accepted.
|
|
131
|
-
* @deprecated Use getCreateConversationRunAcceptedSchema()
|
|
132
|
-
*/
|
|
133
|
-
export const CreateConversationRunAcceptedSchema = lazySchema(getCreateConversationRunAcceptedSchema);
|
|
134
|
-
/** Zod schema for get complete conversation run response. */
|
|
135
|
-
export const getCompleteConversationRunResponseSchema = defineSchema((v) => v.object({
|
|
136
|
-
completed: v.boolean(),
|
|
137
|
-
run: v.object({
|
|
138
|
-
runId: v.string().min(1).optional(),
|
|
139
|
-
run_id: v.string().min(1).optional(),
|
|
140
|
-
status: v.enum(["pending", "running", "waiting", "completed", "failed", "cancelled"]),
|
|
141
|
-
}).passthrough(),
|
|
142
|
-
}).passthrough());
|
|
143
|
-
/** Schema for complete conversation run response.
|
|
144
|
-
* @deprecated Use getCompleteConversationRunResponseSchema()
|
|
145
|
-
*/
|
|
146
|
-
export const CompleteConversationRunResponseSchema = lazySchema(getCompleteConversationRunResponseSchema);
|
|
147
|
-
/** Zod schema for get append conversation run events response. */
|
|
148
|
-
export const getAppendConversationRunEventsResponseSchema = defineSchema((v) => v.union([
|
|
149
|
-
v.object({
|
|
150
|
-
latestEventId: v.number().int().nonnegative(),
|
|
151
|
-
latestExternalEventSequence: v.number().int().nonnegative(),
|
|
152
|
-
appendedCount: v.number().int().nonnegative(),
|
|
153
|
-
run: v.object({
|
|
154
|
-
runId: v.string().min(1),
|
|
155
|
-
conversationId: v.string().uuid(),
|
|
156
|
-
latestEventId: v.number().int().nonnegative(),
|
|
157
|
-
latestExternalEventSequence: v.number().int().nonnegative(),
|
|
158
|
-
}).passthrough(),
|
|
159
|
-
}),
|
|
160
|
-
v.object({
|
|
161
|
-
latest_event_id: v.number().int().nonnegative(),
|
|
162
|
-
latest_external_event_sequence: v.number().int().nonnegative(),
|
|
163
|
-
appended_count: v.number().int().nonnegative(),
|
|
164
|
-
run: v.object({
|
|
165
|
-
run_id: v.string().min(1),
|
|
166
|
-
conversation_id: v.string().uuid(),
|
|
167
|
-
latest_event_id: v.number().int().nonnegative(),
|
|
168
|
-
latest_external_event_sequence: v.number().int().nonnegative(),
|
|
169
|
-
}).passthrough(),
|
|
170
|
-
}).transform((data) => {
|
|
171
|
-
const d = data;
|
|
172
|
-
const run = d.run;
|
|
173
|
-
return {
|
|
174
|
-
latestEventId: d.latest_event_id,
|
|
175
|
-
latestExternalEventSequence: d.latest_external_event_sequence,
|
|
176
|
-
appendedCount: d.appended_count,
|
|
177
|
-
run: {
|
|
178
|
-
...run,
|
|
179
|
-
runId: run.run_id,
|
|
180
|
-
conversationId: run.conversation_id,
|
|
181
|
-
latestEventId: run.latest_event_id,
|
|
182
|
-
latestExternalEventSequence: run.latest_external_event_sequence,
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
}),
|
|
186
|
-
]));
|
|
187
|
-
/** Schema for append conversation run events response.
|
|
188
|
-
* @deprecated Use getAppendConversationRunEventsResponseSchema()
|
|
189
|
-
*/
|
|
190
|
-
export const AppendConversationRunEventsResponseSchema = lazySchema(getAppendConversationRunEventsResponseSchema);
|
|
191
30
|
const DEFAULT_MAX_CONVERSATION_RUN_BATCH_BYTES = 512 * 1024;
|
|
192
|
-
const getConversationRunErrorSchema = defineSchema((v) => v.object({
|
|
193
|
-
detail: v.string().min(1).optional(),
|
|
194
|
-
error: v.string().min(1).optional(),
|
|
195
|
-
}));
|
|
196
31
|
/** Error shape for conversation run terminal state. */
|
|
197
32
|
export class ConversationRunTerminalStateError extends Error {
|
|
198
33
|
status;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/import-map/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/import-map/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAoIlD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,eAAe,CAAC,CAqC1B"}
|
|
@@ -28,9 +28,10 @@ function normalizeImportMapForRuntime(importMap) {
|
|
|
28
28
|
// Override React mappings AFTER all other processing to ensure single instance.
|
|
29
29
|
// Remove any "react/" prefix match since we have explicit mappings.
|
|
30
30
|
if (imports) {
|
|
31
|
+
const veryfrontSsrMap = Object.fromEntries(Object.entries(getDefaultImportMap().imports ?? {}).filter(([key]) => key.startsWith("veryfront/")));
|
|
31
32
|
const reactMap = getReactImportMap();
|
|
32
33
|
delete imports["react/"];
|
|
33
|
-
imports = { ...imports, ...reactMap };
|
|
34
|
+
imports = { ...imports, ...veryfrontSsrMap, ...reactMap };
|
|
34
35
|
}
|
|
35
36
|
return { imports, scopes };
|
|
36
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-module-manifest.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/manifest/route-module-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"route-module-manifest.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/manifest/route-module-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,aAAa;IACrB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E,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5E,CAcA;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAU/D;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { serverLogger } from "../../utils/index.js";
|
|
13
13
|
import { LRUCache } from "../../utils/lru-wrapper.js";
|
|
14
|
+
import { metrics } from "../../observability/simple-metrics/index.js";
|
|
14
15
|
const logger = serverLogger.component("route-module-manifest");
|
|
15
16
|
/** Bound on tracked routes; manifests are a regenerable preload optimization. */
|
|
16
17
|
const MAX_TRACKED_ROUTES = 2_000;
|
|
@@ -77,6 +78,7 @@ export function finishModuleCollection(requestId, projectSlug, route, criticalMo
|
|
|
77
78
|
export function getRouteManifest(projectSlug, route) {
|
|
78
79
|
const key = buildKey(projectSlug, route);
|
|
79
80
|
const manifest = manifestStore.get(key);
|
|
81
|
+
metrics.recordRouteManifestLookup(!!manifest);
|
|
80
82
|
logger.debug("Get manifest", {
|
|
81
83
|
key,
|
|
82
84
|
found: !!manifest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAsCtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwDrD,CAAC;AAiBF,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6XzF;AAwWD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGrD"}
|
|
@@ -8,6 +8,8 @@ import { getContentTypeForPath } from "../../server/handlers/utils/content-types
|
|
|
8
8
|
import { createSecureFs } from "../../security/index.js";
|
|
9
9
|
import { getErrorMessage } from "../../errors/veryfront-error.js";
|
|
10
10
|
import { getApiBaseUrlEnv } from "../../config/env.js";
|
|
11
|
+
import { profilePhase } from "../../observability/request-profiler.js";
|
|
12
|
+
import { metrics } from "../../observability/simple-metrics/index.js";
|
|
11
13
|
import { injectContext, withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
12
14
|
import { injectNodePositions } from "../../transforms/plugins/babel-node-positions.js";
|
|
13
15
|
import { parseProjectDomain } from "../../server/utils/domain-parser.js";
|
|
@@ -158,7 +160,7 @@ export function serveModule(req, options) {
|
|
|
158
160
|
codeLength: snippetCode.length,
|
|
159
161
|
});
|
|
160
162
|
try {
|
|
161
|
-
let transformedCode = await transformToESM(snippetCode, `_snippets/${hash}.tsx`, projectDir, adapter, { projectId: effectiveProjectId, dev, ssr: isSSR, reactVersion });
|
|
163
|
+
let transformedCode = await profileModuleTransform(() => transformToESM(snippetCode, `_snippets/${hash}.tsx`, projectDir, adapter, { projectId: effectiveProjectId, dev, ssr: isSSR, reactVersion }));
|
|
162
164
|
if (isSSR) {
|
|
163
165
|
transformedCode = await applySSRImportRewritesAsync(transformedCode, {
|
|
164
166
|
projectSlug: snippetProjectSlug,
|
|
@@ -230,13 +232,13 @@ export function serveModule(req, options) {
|
|
|
230
232
|
}
|
|
231
233
|
const userAgent = req.headers.get("user-agent") ?? "";
|
|
232
234
|
const isSSR = url.searchParams.get("ssr") === "true" || userAgent.startsWith("Deno/");
|
|
233
|
-
let code = await transformToESM(source, crossPath, projectDir, adapter, {
|
|
235
|
+
let code = await profileModuleTransform(() => transformToESM(source, crossPath, projectDir, adapter, {
|
|
234
236
|
projectId: effectiveProjectId,
|
|
235
237
|
dev,
|
|
236
238
|
ssr: isSSR,
|
|
237
239
|
moduleServerUrl: `http://${url.host}`,
|
|
238
240
|
reactVersion,
|
|
239
|
-
});
|
|
241
|
+
}));
|
|
240
242
|
if (isSSR) {
|
|
241
243
|
code = await applySSRImportRewritesAsync(code, {
|
|
242
244
|
crossProjectRef: projectRef,
|
|
@@ -286,13 +288,13 @@ export function serveModule(req, options) {
|
|
|
286
288
|
branch ??= parsedHost.branch;
|
|
287
289
|
}
|
|
288
290
|
try {
|
|
289
|
-
const findResult = await findSourceFile(secureFs, projectDir, filePathWithoutExt, {
|
|
291
|
+
const findResult = await profilePhase("module.source_lookup", () => findSourceFile(secureFs, projectDir, filePathWithoutExt, {
|
|
290
292
|
projectId: effectiveProjectId,
|
|
291
293
|
projectSlug,
|
|
292
294
|
branch,
|
|
293
295
|
releaseId: options.releaseId,
|
|
294
296
|
reactVersion,
|
|
295
|
-
}, modulePath);
|
|
297
|
+
}, modulePath));
|
|
296
298
|
if (!findResult) {
|
|
297
299
|
logger.warn("Module not found", {
|
|
298
300
|
modulePath,
|
|
@@ -300,9 +302,8 @@ export function serveModule(req, options) {
|
|
|
300
302
|
projectSlug,
|
|
301
303
|
projectDir,
|
|
302
304
|
});
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
headers: { "Content-Type": "text/plain" },
|
|
305
|
+
return createModuleResponse(method, "Module not found", HTTP_NOT_FOUND, {
|
|
306
|
+
"Content-Type": "text/plain",
|
|
306
307
|
});
|
|
307
308
|
}
|
|
308
309
|
const { path: sourceFile, isFrameworkFile, embeddedContent } = findResult;
|
|
@@ -346,7 +347,7 @@ export function serveModule(req, options) {
|
|
|
346
347
|
studioEmbed,
|
|
347
348
|
reactVersion,
|
|
348
349
|
};
|
|
349
|
-
code = await transformToESM(source, sourceFile, projectDir, adapter, transformOpts);
|
|
350
|
+
code = await profileModuleTransform(() => transformToESM(source, sourceFile, projectDir, adapter, transformOpts));
|
|
350
351
|
if (isSSR) {
|
|
351
352
|
code = await applySSRImportRewritesAsync(code, {
|
|
352
353
|
projectSlug,
|
|
@@ -699,7 +700,24 @@ function createDevModuleErrorBody(modulePath, errorMessage) {
|
|
|
699
700
|
}
|
|
700
701
|
return `// Transform Error\nthrow new Error(${JSON.stringify(errorMessage)});`;
|
|
701
702
|
}
|
|
703
|
+
async function profileModuleTransform(fn) {
|
|
704
|
+
const startedAt = performance.now();
|
|
705
|
+
try {
|
|
706
|
+
return await profilePhase("module.transform", fn);
|
|
707
|
+
}
|
|
708
|
+
finally {
|
|
709
|
+
metrics.recordModuleTransform(performance.now() - startedAt);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function classifyModuleServeStatus(status) {
|
|
713
|
+
if (status >= 200 && status < 300)
|
|
714
|
+
return "ok";
|
|
715
|
+
if (status === HTTP_NOT_FOUND)
|
|
716
|
+
return "not_found";
|
|
717
|
+
return "error";
|
|
718
|
+
}
|
|
702
719
|
function createModuleResponse(method, body, status, headers) {
|
|
720
|
+
metrics.recordModuleServe(classifyModuleServeStatus(status));
|
|
703
721
|
return new Response(method === "HEAD" ? null : body, { status, headers });
|
|
704
722
|
}
|
|
705
723
|
async function fetchCrossProjectSource(projectRef, filePath) {
|
|
@@ -7,9 +7,9 @@ export type { MetricsState, ObservabilityMetrics, OtelInstruments, RSCRequestKin
|
|
|
7
7
|
export { getObservabilityMetrics, resetObservabilityLoader } from "./observability-loader.js";
|
|
8
8
|
export { ensureOtelInstruments, getOtelInstruments, resetOtelInstruments, safeLogWarn, safeOtelOperation, } from "./otel-instruments.js";
|
|
9
9
|
export { createSnapshot, getRequestCount, getSSRBoundaries, resetMetrics, state, } from "./metrics-state.js";
|
|
10
|
-
export { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
11
|
-
export type { ContentCacheLayer } from "./metrics-recorder.js";
|
|
12
|
-
import { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR } from "./metrics-recorder.js";
|
|
10
|
+
export { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordModuleServe, recordModuleTransform, recordRouteManifestLookup, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
11
|
+
export type { ContentCacheLayer, ModuleServeStatus } from "./metrics-recorder.js";
|
|
12
|
+
import { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordModuleServe, recordModuleTransform, recordRouteManifestLookup, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR } from "./metrics-recorder.js";
|
|
13
13
|
import { createSnapshot, getRequestCount, resetMetrics } from "./metrics-state.js";
|
|
14
14
|
export declare const metrics: {
|
|
15
15
|
incRequest: typeof incRequest;
|
|
@@ -26,6 +26,9 @@ export declare const metrics: {
|
|
|
26
26
|
recordApiRetry: typeof recordApiRetry;
|
|
27
27
|
recordContentCacheHit: typeof recordContentCacheHit;
|
|
28
28
|
recordContentNetworkFetch: typeof recordContentNetworkFetch;
|
|
29
|
+
recordModuleServe: typeof recordModuleServe;
|
|
30
|
+
recordModuleTransform: typeof recordModuleTransform;
|
|
31
|
+
recordRouteManifestLookup: typeof recordRouteManifestLookup;
|
|
29
32
|
snapshot: typeof createSnapshot;
|
|
30
33
|
reset: typeof resetMetrics;
|
|
31
34
|
getRequestCount: typeof getRequestCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE9F,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,GACN,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE9F,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,GACN,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEnF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;CAqBnB,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
export { getObservabilityMetrics, resetObservabilityLoader } from "./observability-loader.js";
|
|
7
7
|
export { ensureOtelInstruments, getOtelInstruments, resetOtelInstruments, safeLogWarn, safeOtelOperation, } from "./otel-instruments.js";
|
|
8
8
|
export { createSnapshot, getRequestCount, getSSRBoundaries, resetMetrics, state, } from "./metrics-state.js";
|
|
9
|
-
export { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
10
|
-
import { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
9
|
+
export { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordModuleServe, recordModuleTransform, recordRouteManifestLookup, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
10
|
+
import { incRequest, recordApiRequest, recordApiRetry, recordCacheGet, recordCacheInvalidate, recordCacheSet, recordContentCacheHit, recordContentNetworkFetch, recordCorsRejection, recordHttp, recordModuleServe, recordModuleTransform, recordRouteManifestLookup, recordRSC, recordRSCStreamDuration, recordSecurityHeaders, recordSSR, } from "./metrics-recorder.js";
|
|
11
11
|
import { createSnapshot, getRequestCount, resetMetrics } from "./metrics-state.js";
|
|
12
12
|
export const metrics = {
|
|
13
13
|
incRequest,
|
|
@@ -24,6 +24,9 @@ export const metrics = {
|
|
|
24
24
|
recordApiRetry,
|
|
25
25
|
recordContentCacheHit,
|
|
26
26
|
recordContentNetworkFetch,
|
|
27
|
+
recordModuleServe,
|
|
28
|
+
recordModuleTransform,
|
|
29
|
+
recordRouteManifestLookup,
|
|
27
30
|
snapshot: createSnapshot,
|
|
28
31
|
reset: resetMetrics,
|
|
29
32
|
getRequestCount,
|
|
@@ -57,6 +57,10 @@ export declare function recordCacheSet(): void;
|
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
export declare function recordCacheInvalidate(n: number): void;
|
|
60
|
+
export type ModuleServeStatus = "ok" | "not_found" | "error";
|
|
61
|
+
export declare function recordModuleServe(status: ModuleServeStatus): void;
|
|
62
|
+
export declare function recordModuleTransform(durationMs: number): void;
|
|
63
|
+
export declare function recordRouteManifestLookup(hit: boolean): void;
|
|
60
64
|
/**
|
|
61
65
|
* Record SSR render duration
|
|
62
66
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-recorder.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/metrics-recorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAejD;;;;;;;GAOG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAQhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAUxF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAajD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAWrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAalD;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAehE;AAqBD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAIpD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAQD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAYpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAmBtF"}
|
|
1
|
+
{"version":3,"file":"metrics-recorder.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/metrics-recorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAejD;;;;;;;GAOG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAQhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAUxF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,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
const otel = getOtelInstruments();
|
|
114
114
|
void safeOtelOperation(() => otel.cacheInvalidateCounter?.add(count), "cache invalidate counter add failed");
|
|
115
115
|
}
|
|
116
|
+
export function recordModuleServe(status) {
|
|
117
|
+
state.moduleServeTotal++;
|
|
118
|
+
switch (status) {
|
|
119
|
+
case "ok":
|
|
120
|
+
state.moduleServeOk++;
|
|
121
|
+
break;
|
|
122
|
+
case "not_found":
|
|
123
|
+
state.moduleServeNotFound++;
|
|
124
|
+
break;
|
|
125
|
+
case "error":
|
|
126
|
+
state.moduleServeError++;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
const otel = getOtelInstruments();
|
|
130
|
+
void safeOtelOperation(() => otel.moduleServeCounter?.add(1, { status }), "module serve counter add failed");
|
|
131
|
+
}
|
|
132
|
+
export function recordModuleTransform(durationMs) {
|
|
133
|
+
const duration = Math.max(0, Math.floor(durationMs));
|
|
134
|
+
state.moduleTransformTotal++;
|
|
135
|
+
state.moduleTransformDurationMsTotal += duration;
|
|
136
|
+
const otel = getOtelInstruments();
|
|
137
|
+
void safeOtelOperation(() => {
|
|
138
|
+
otel.moduleTransformCounter?.add(1);
|
|
139
|
+
otel.moduleTransformDurationHistogram?.record(duration);
|
|
140
|
+
}, "module transform metrics record failed");
|
|
141
|
+
}
|
|
142
|
+
export function recordRouteManifestLookup(hit) {
|
|
143
|
+
if (hit)
|
|
144
|
+
state.routeManifestLruHits++;
|
|
145
|
+
else
|
|
146
|
+
state.routeManifestLruMisses++;
|
|
147
|
+
const otel = getOtelInstruments();
|
|
148
|
+
void safeOtelOperation(() => otel.routeManifestLookupCounter?.add(1, { hit: hit ? "true" : "false" }), "route manifest lookup counter add failed");
|
|
149
|
+
}
|
|
116
150
|
/**
|
|
117
151
|
* Record SSR render duration
|
|
118
152
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-state.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/metrics-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMjE,eAAO,MAAM,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"metrics-state.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/metrics-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMjE,eAAO,MAAM,KAAK,EAAE,YA0CnB,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C;AAED,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAEtD;AAED,wBAAgB,cAAc,IAAI,gBAAgB,CAqDjD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAyCnC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -16,6 +16,14 @@ export const state = {
|
|
|
16
16
|
cacheMisses: 0,
|
|
17
17
|
cacheSets: 0,
|
|
18
18
|
cacheInvalidations: 0,
|
|
19
|
+
moduleServeTotal: 0,
|
|
20
|
+
moduleServeOk: 0,
|
|
21
|
+
moduleServeNotFound: 0,
|
|
22
|
+
moduleServeError: 0,
|
|
23
|
+
moduleTransformTotal: 0,
|
|
24
|
+
moduleTransformDurationMsTotal: 0,
|
|
25
|
+
routeManifestLruHits: 0,
|
|
26
|
+
routeManifestLruMisses: 0,
|
|
19
27
|
ssrHistogram: undefined,
|
|
20
28
|
rscStreamHistogram: undefined,
|
|
21
29
|
corsRejections: 0,
|
|
@@ -58,6 +66,14 @@ export function createSnapshot() {
|
|
|
58
66
|
cacheMisses: state.cacheMisses,
|
|
59
67
|
cacheSets: state.cacheSets,
|
|
60
68
|
cacheInvalidations: state.cacheInvalidations,
|
|
69
|
+
moduleServeTotal: state.moduleServeTotal,
|
|
70
|
+
moduleServeOk: state.moduleServeOk,
|
|
71
|
+
moduleServeNotFound: state.moduleServeNotFound,
|
|
72
|
+
moduleServeError: state.moduleServeError,
|
|
73
|
+
moduleTransformTotal: state.moduleTransformTotal,
|
|
74
|
+
moduleTransformDurationMsTotal: state.moduleTransformDurationMsTotal,
|
|
75
|
+
routeManifestLruHits: state.routeManifestLruHits,
|
|
76
|
+
routeManifestLruMisses: state.routeManifestLruMisses,
|
|
61
77
|
corsRejections: state.corsRejections,
|
|
62
78
|
securityHeadersApplied: state.securityHeadersApplied,
|
|
63
79
|
apiRequests2xx: state.apiRequests2xx,
|
|
@@ -103,6 +119,14 @@ export function resetMetrics() {
|
|
|
103
119
|
state.cacheMisses = 0;
|
|
104
120
|
state.cacheSets = 0;
|
|
105
121
|
state.cacheInvalidations = 0;
|
|
122
|
+
state.moduleServeTotal = 0;
|
|
123
|
+
state.moduleServeOk = 0;
|
|
124
|
+
state.moduleServeNotFound = 0;
|
|
125
|
+
state.moduleServeError = 0;
|
|
126
|
+
state.moduleTransformTotal = 0;
|
|
127
|
+
state.moduleTransformDurationMsTotal = 0;
|
|
128
|
+
state.routeManifestLruHits = 0;
|
|
129
|
+
state.routeManifestLruMisses = 0;
|
|
106
130
|
state.corsRejections = 0;
|
|
107
131
|
state.securityHeadersApplied = 0;
|
|
108
132
|
state.apiRequests2xx = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/otel-instruments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAMlE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"otel-instruments.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/otel-instruments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAMlE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8D3D;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACrC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C"}
|
|
@@ -58,6 +58,19 @@ export async function ensureOtelInstruments() {
|
|
|
58
58
|
otel.cacheInvalidateCounter = meter.createCounter("veryfront.cache.invalidations", {
|
|
59
59
|
description: "Cache invalidations",
|
|
60
60
|
});
|
|
61
|
+
otel.moduleServeCounter = meter.createCounter("veryfront.module.serve.total", {
|
|
62
|
+
description: "Module server responses by status",
|
|
63
|
+
});
|
|
64
|
+
otel.moduleTransformCounter = meter.createCounter("veryfront.module.transform.total", {
|
|
65
|
+
description: "Module transforms",
|
|
66
|
+
});
|
|
67
|
+
otel.moduleTransformDurationHistogram = meter.createHistogram("veryfront.module.transform.duration", {
|
|
68
|
+
description: "Module transform duration (ms)",
|
|
69
|
+
unit: "ms",
|
|
70
|
+
});
|
|
71
|
+
otel.routeManifestLookupCounter = meter.createCounter("veryfront.route_manifest.lookup.total", {
|
|
72
|
+
description: "Route module manifest LRU lookups by hit status",
|
|
73
|
+
});
|
|
61
74
|
}
|
|
62
75
|
catch (e) {
|
|
63
76
|
safeLogWarn("[metrics] OpenTelemetry init failed", e);
|
|
@@ -32,6 +32,14 @@ export interface VeryfrontMetrics {
|
|
|
32
32
|
cacheMisses: number;
|
|
33
33
|
cacheSets: number;
|
|
34
34
|
cacheInvalidations: number;
|
|
35
|
+
moduleServeTotal: number;
|
|
36
|
+
moduleServeOk: number;
|
|
37
|
+
moduleServeNotFound: number;
|
|
38
|
+
moduleServeError: number;
|
|
39
|
+
moduleTransformTotal: number;
|
|
40
|
+
moduleTransformDurationMsTotal: number;
|
|
41
|
+
routeManifestLruHits: number;
|
|
42
|
+
routeManifestLruMisses: number;
|
|
35
43
|
ssrHistogram?: {
|
|
36
44
|
boundaries: number[];
|
|
37
45
|
counts: number[];
|
|
@@ -69,5 +77,9 @@ export interface OtelInstruments {
|
|
|
69
77
|
cacheMissCounter?: Counter;
|
|
70
78
|
cacheSetCounter?: Counter;
|
|
71
79
|
cacheInvalidateCounter?: Counter;
|
|
80
|
+
moduleServeCounter?: Counter;
|
|
81
|
+
moduleTransformCounter?: Counter;
|
|
82
|
+
moduleTransformDurationHistogram?: Histogram;
|
|
83
|
+
routeManifestLookupCounter?: Counter;
|
|
72
84
|
}
|
|
73
85
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/simple-metrics/types.ts"],"names":[],"mappings":"AAAA;;;oDAGoD;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,aAAa,CAAC;AAElB,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,gBAAgB,EAAE,CAChB,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,GAA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":["../../../../../../src/src/platform/adapters/runtime/shared/shared-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-watcher.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/shared/shared-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAC;AAEvE,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACP,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,OAAO,CAAC;IACtB,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7E,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3F,QAAQ,EAAE,KAAK,CAAC,OAAO,SAAS,EAAE,SAAS,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,GACA,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import { createFileWatcher, createWatcherIterator, enqueueWatchEvent } from "./watcher-queue.js";
|
|
3
2
|
export { createFileWatcher, createWatcherIterator, enqueueWatchEvent };
|
|
4
3
|
export async function setupNodeFsWatcher(path, options) {
|
|
5
4
|
try {
|
|
6
5
|
const fs = await import("node:fs");
|
|
7
6
|
const fsPromises = await import("node:fs/promises");
|
|
7
|
+
const { join } = await import("node:path");
|
|
8
8
|
let exists;
|
|
9
9
|
try {
|
|
10
10
|
await fsPromises.access(path);
|
|
@@ -12,11 +12,19 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module platform/compat/http/native-response
|
|
14
14
|
*/
|
|
15
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
16
|
+
type NativeResponseHost = {
|
|
17
|
+
Response: typeof Response;
|
|
18
|
+
};
|
|
19
|
+
type NativeDenoHost = {
|
|
20
|
+
Deno?: unknown;
|
|
21
|
+
};
|
|
22
|
+
export declare function getNativeResponseFromHost(host: NativeResponseHost): typeof Response;
|
|
23
|
+
export declare function getNativeDenoFromHost(host: NativeDenoHost): typeof dntShim.Deno | undefined;
|
|
15
24
|
/**
|
|
16
25
|
* The native `Response` constructor, accessed via `self` to bypass the dnt
|
|
17
26
|
* shim transform (dnt rewrites bare `Response` to undici's polyfill).
|
|
18
27
|
*/
|
|
19
|
-
import * as dntShim from "../../../../_dnt.shims.js";
|
|
20
28
|
export declare function getNativeResponse(): typeof Response;
|
|
21
29
|
/**
|
|
22
30
|
* The native `Deno` namespace, accessed via `self` to bypass the dnt shim
|
|
@@ -41,4 +49,5 @@ export declare function getNativeDeno(): typeof dntShim.Deno | undefined;
|
|
|
41
49
|
* into a fresh native `Response`.
|
|
42
50
|
*/
|
|
43
51
|
export declare function toNativeResponse(response: Response, NativeResponse: typeof Response): Response;
|
|
52
|
+
export {};
|
|
44
53
|
//# sourceMappingURL=native-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-response.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/native-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"native-response.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/native-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAGrD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAC3B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAWF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,QAAQ,CAEnF;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,OAAO,CAAC,IAAI,GAAG,SAAS,CAG3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,QAAQ,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,SAAS,CAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,OAAO,QAAQ,GAC9B,QAAQ,CAYV"}
|