// @bun
// src/components/docs/advanced/AdvancedWorkflowMonitoringPage.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function AdvancedWorkflowMonitoringPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "Workflow Monitoring"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground text-lg",
            children: "Production workflows need robust observability. ContractSpec provides SLA monitoring, distributed tracing, and audit logging out of the box."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "SLA Monitoring"
          }),
          /* @__PURE__ */ jsxs("p", {
            children: [
              "Use the ",
              /* @__PURE__ */ jsx("code", {
                children: "SLAMonitor"
              }),
              " to detect when workflows or individual steps exceed their budgeted duration."
            ]
          }),
          /* @__PURE__ */ jsx("pre", {
            className: "bg-muted rounded-lg border 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);`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Telemetry & Tracing"
          }),
          /* @__PURE__ */ jsx("p", {
            children: "Workflows automatically generate OpenTelemetry spans for:"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "list-disc space-y-2 pl-6",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Overall workflow execution"
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Individual steps"
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Retries and compensation"
              })
            ]
          }),
          /* @__PURE__ */ jsx("p", {
            children: "Configure your OpenTelemetry exporter to send traces to Jaeger, Datadog, or Honeycomb."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Dashboarding"
          }),
          /* @__PURE__ */ jsxs("p", {
            children: [
              "You can build a custom dashboard using ",
              /* @__PURE__ */ jsx("code", {
                children: "DataViews"
              }),
              " over your workflow state database. See the DataViews tutorial for how to visualize ",
              /* @__PURE__ */ jsx("code", {
                children: "WorkflowState"
              }),
              " records."
            ]
          })
        ]
      })
    ]
  });
}
export {
  AdvancedWorkflowMonitoringPage
};
