Skip to content

Telemetry, webhooks and audit

Daytona records what happens in your organization in three places. Sandboxes send telemetry (logs, traces and metrics) to Daytona’s collector, or to your own OpenTelemetry backend. Webhooks deliver events about your sandboxes and snapshots to endpoints you add. And the audit log keeps every change made to the organization: who or what did it, the action, and the object it touched, including the stops and archives Daytona makes on its own.

Audit log · acmeDaytona's own actions
timeactiontarget
10:02createsandbox user-sam
10:05update_network_settingssandbox user-sam
10:20auto_stopsandbox user-sam
11:41startsandbox user-sam
+7 daysauto_archivesandbox user-sam
src/Telemetry.ts
import * as Daytona from "@alchemy.run/daytona";
import * as Config from "effect/Config";
export const Telemetry = Daytona.OrganizationOtelConfig("Telemetry", {
endpoint: "https://api.axiom.co",
headers: { Authorization: Config.Redacted("AXIOM_TOKEN"), "X-Axiom-Dataset": "daytona" },
});

Every sandbox in the organization sends its logs, traces and metrics to your backend. One sandbox can send its own elsewhere with otelEndpointOverride; its telemetry then doesn’t show in Daytona’s dashboard.

const logs = yield* sandbox.getSandboxLogs({ from, to });
src/Webhooks.ts
import * as Daytona from "@alchemy.run/daytona";
export const Events = Daytona.Webhooks("Events", {});

Add endpoints in Daytona’s webhook portal. A Worker gets a link to the portal from ReadOrganization’s getWebhookControllerAppPortalAccess.

const usage = yield* Daytona.ReadUsage();
const rows = yield* usage.listOrganizationUsageSandbox({ from, to });

The Worker’s key has read:billing, and the rows break down usage per sandbox.

const audit = yield* Daytona.ReadAuditLogs();
const page = yield* audit.getOrganizationAuditLogs({ limit: 50 });

Each entry has the actor (an email, or the prefix of the API key used), the action, the target and its id, and the response status. The Worker’s key has read:audit_logs.