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.
Three records of what happened
Section titled “Three records of what happened”| time | action | target |
|---|---|---|
| 10:02 | create | sandbox user-sam |
| 10:05 | update_network_settings | sandbox user-sam |
| 10:20 | auto_stop | sandbox user-sam |
| 11:41 | start | sandbox user-sam |
| +7 days | auto_archive | sandbox user-sam |
Export telemetry to your backend
Section titled “Export telemetry to your backend”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.
Read a sandbox’s logs
Section titled “Read a sandbox’s logs”const logs = yield* sandbox.getSandboxLogs({ from, to });Turn on webhooks
Section titled “Turn on webhooks”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.
Read usage
Section titled “Read usage”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.
Read the audit log
Section titled “Read the audit log”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.