@stacksjs/ts-cloud 0.7.89 → 0.7.90
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/dist/bin/cli.js +241 -241
- package/dist/bin/dashboard-server.js +377 -377
- package/dist/{chunk-bg8gr1n1.js → chunk-hcdewpt6.js} +39 -19
- package/dist/deploy/index.js +1 -1
- package/dist/deploy/telemetry-collection.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/ui/account/automation.html +4 -4
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +4 -4
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +3 -3
- package/dist/ui/data/services.html +4 -4
- package/dist/ui/data/volumes.html +3 -3
- package/dist/ui/index.html +4 -4
- package/dist/ui/operations/alerts.html +4 -4
- package/dist/ui/operations/configuration.html +4 -4
- package/dist/ui/operations/jobs.html +4 -4
- package/dist/ui/operations/maintenance.html +3 -3
- package/dist/ui/operations/observability.html +3 -3
- package/dist/ui/operations/previews.html +3 -3
- package/dist/ui/operations/queue.html +4 -4
- package/dist/ui/operations/regions.html +3 -3
- package/dist/ui/operations/releases.html +4 -4
- package/dist/ui/operations/workloads.html +3 -3
- package/dist/ui/server/actions.html +3 -3
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +4 -4
- package/dist/ui/server/database.html +4 -4
- package/dist/ui/server/deployments.html +4 -4
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +4 -4
- package/dist/ui/server/fleet.html +4 -4
- package/dist/ui/server/logs.html +4 -4
- package/dist/ui/server/metrics.html +4 -4
- package/dist/ui/server/services.html +2 -2
- package/dist/ui/server/sites.html +4 -4
- package/dist/ui/server/ssh-keys.html +4 -4
- package/dist/ui/server/team.html +4 -4
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +4 -4
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +4 -4
- package/dist/ui/serverless/firewall.html +2 -2
- package/dist/ui/serverless/functions.html +4 -4
- package/dist/ui/serverless/logs.html +4 -4
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +4 -4
- package/dist/ui/serverless/secrets.html +4 -4
- package/dist/ui/serverless/traces.html +4 -4
- package/dist/ui/serverless.html +3 -3
- package/package.json +3 -3
|
@@ -42151,8 +42151,26 @@ class TelemetryCollectionCache {
|
|
|
42151
42151
|
this.entries.delete(key2);
|
|
42152
42152
|
}
|
|
42153
42153
|
}
|
|
42154
|
+
|
|
42155
|
+
class TelemetryMaintenanceGate {
|
|
42156
|
+
now;
|
|
42157
|
+
lastRun = new Map;
|
|
42158
|
+
constructor(now = Date.now) {
|
|
42159
|
+
this.now = now;
|
|
42160
|
+
}
|
|
42161
|
+
shouldRun(key2, intervalMs, force = false) {
|
|
42162
|
+
const now = this.now();
|
|
42163
|
+
const lastRun = this.lastRun.get(key2);
|
|
42164
|
+
if (!force && lastRun != null && now - lastRun < intervalMs)
|
|
42165
|
+
return false;
|
|
42166
|
+
this.lastRun.set(key2, now);
|
|
42167
|
+
return true;
|
|
42168
|
+
}
|
|
42169
|
+
}
|
|
42154
42170
|
var collectionCache = new TelemetryCollectionCache;
|
|
42171
|
+
var maintenanceGate = new TelemetryMaintenanceGate;
|
|
42155
42172
|
var MAX_COLLECTED_LOGS = 2000;
|
|
42173
|
+
var RETENTION_MAINTENANCE_INTERVAL_MS = 60 * 60000;
|
|
42156
42174
|
function retainedByPolicy(record3, policy3) {
|
|
42157
42175
|
if (record3.kind === "log" && !policy3.collectLogs)
|
|
42158
42176
|
return false;
|
|
@@ -42602,30 +42620,32 @@ async function collectNow(context) {
|
|
|
42602
42620
|
} catch (error2) {
|
|
42603
42621
|
errors.push({ source: "runtime", message: error2 instanceof Error ? error2.message : String(error2) });
|
|
42604
42622
|
}
|
|
42605
|
-
|
|
42606
|
-
const
|
|
42607
|
-
|
|
42608
|
-
|
|
42609
|
-
|
|
42610
|
-
|
|
42611
|
-
|
|
42612
|
-
|
|
42613
|
-
|
|
42614
|
-
|
|
42615
|
-
|
|
42616
|
-
|
|
42617
|
-
|
|
42618
|
-
|
|
42619
|
-
|
|
42620
|
-
|
|
42621
|
-
|
|
42622
|
-
|
|
42623
|
+
if (!context.lightweight)
|
|
42624
|
+
for (const event of context.controlPlane.listEvents({ projectId: context.projectId, limit: 1000 })) {
|
|
42625
|
+
const payload2 = event.payload;
|
|
42626
|
+
records.push({
|
|
42627
|
+
...scope2,
|
|
42628
|
+
id: `telemetry:event:${event.id}`,
|
|
42629
|
+
resourceId: event.resourceId,
|
|
42630
|
+
kind: "event",
|
|
42631
|
+
source: "control-plane",
|
|
42632
|
+
name: event.type,
|
|
42633
|
+
timestamp: event.createdAt,
|
|
42634
|
+
level: event.level,
|
|
42635
|
+
message: event.type,
|
|
42636
|
+
deploymentId: event.operationId,
|
|
42637
|
+
releaseId: typeof payload2.releaseId === "string" ? payload2.releaseId : undefined,
|
|
42638
|
+
traceId: event.correlationId,
|
|
42639
|
+
attributes: payload2
|
|
42640
|
+
});
|
|
42641
|
+
}
|
|
42623
42642
|
const retained = records.filter((record3) => retainedByPolicy(record3, policy3)).map((record3) => ({
|
|
42624
42643
|
...record3,
|
|
42625
42644
|
sampled: policy3.samplingRate < 1 && (record3.kind === "log" || record3.kind === "trace" || record3.kind === "request" || record3.name.startsWith("request."))
|
|
42626
42645
|
}));
|
|
42627
42646
|
const inserted = telemetry2.appendMany(retained).length;
|
|
42628
|
-
|
|
42647
|
+
if (maintenanceGate.shouldRun(context.projectId, RETENTION_MAINTENANCE_INTERVAL_MS, !context.lightweight))
|
|
42648
|
+
telemetry2.enforceRetention(policy3, context.projectId);
|
|
42629
42649
|
const statuses = telemetry2.status(context.projectId, context.environmentId, policy3.rawDays, policy3.samplingRate);
|
|
42630
42650
|
for (const error2 of errors)
|
|
42631
42651
|
if (!statuses.some((status) => status.source === error2.source))
|
package/dist/deploy/index.js
CHANGED
|
@@ -11,6 +11,12 @@ export declare class TelemetryCollectionCache<T> {
|
|
|
11
11
|
}>;
|
|
12
12
|
invalidate(prefix: string): void;
|
|
13
13
|
}
|
|
14
|
+
export declare class TelemetryMaintenanceGate {
|
|
15
|
+
private readonly now;
|
|
16
|
+
private readonly lastRun;
|
|
17
|
+
constructor(now?: () => number);
|
|
18
|
+
shouldRun(key: string, intervalMs: number, force?: boolean): boolean;
|
|
19
|
+
}
|
|
14
20
|
export interface TelemetryCollectionResult {
|
|
15
21
|
collected: number;
|
|
16
22
|
cached: boolean;
|