// @bun
import{jsx as e,jsxs as o}from"react/jsx-runtime";function t(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Workflow Monitoring"}),e("p",{className:"text-lg text-muted-foreground",children:"Production workflows need robust observability. ContractSpec provides SLA monitoring, distributed tracing, and audit logging out of the box."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"SLA Monitoring"}),o("p",{children:["Use the ",e("code",{children:"SLAMonitor"})," to detect when workflows or individual steps exceed their budgeted duration."]}),e("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { SLAMonitor } from '@contractspec/lib.contracts-spec/workflow/sla-monitor';

const monitor = new SLAMonitor((event, payload) => {
  if (event === 'workflow.sla_breach') {
    console.error('SLA Breach!', payload);
    // Send to PagerDuty / Slack
  }
});

// Check periodically
monitor.check(currentState, workflowSpec);`})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Telemetry & Tracing"}),e("p",{children:"Workflows automatically generate OpenTelemetry spans for:"}),o("ul",{className:"list-disc space-y-2 pl-6",children:[e("li",{children:"Overall workflow execution"}),e("li",{children:"Individual steps"}),e("li",{children:"Retries and compensation"})]}),e("p",{children:"Configure your OpenTelemetry exporter to send traces to Jaeger, Datadog, or Honeycomb."})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Dashboarding"}),o("p",{children:["You can build a custom dashboard using ",e("code",{children:"DataViews"})," over your workflow state database. See the DataViews tutorial for how to visualize ",e("code",{children:"WorkflowState"})," records."]})]})]})}export{t as AdvancedWorkflowMonitoringPage};
