> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Datadog 每日运行状况简报

export const UseCaseHero = ({title, description, prompt, category, features, devinUrl, agent, intent, playbookId, type}) => {
  const encodedPrompt = encodeURIComponent(prompt || '');
  const tag = 'docs-use-case-gallery';
  const utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=hero-cta';
  const agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  const devinHref = type === 'schedule' ? 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + (prompt ? '&prompt=' + encodedPrompt : '') : type === 'review' ? 'https://app.devin.ai/review?' + utm : agent === 'ada' ? 'https://app.devin.ai/search?' + utm + '&noSubmit=true' + (prompt ? '&prompt=' + encodedPrompt : '') : devinUrl ? devinUrl.includes('?') ? devinUrl + '&' + utm + agentParams : devinUrl + '?' + utm + agentParams : prompt ? 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encodedPrompt : 'https://app.devin.ai/?' + utm + agentParams;
  const buttonLabel = type === 'schedule' ? 'Schedule in Devin ↗' : type === 'review' ? 'Set Up Devin Review ↗' : agent === 'advanced' ? 'Try in Devin ↗' : agent === 'dana' ? 'Try in Dana ↗' : agent === 'ada' ? 'Try in Ask Devin ↗' : 'Try in Devin ↗';
  const featureList = features ? features.split(',').map(f => f.trim()) : [];
  return <div className="uc-hero">
      <div className="uc-hero-inner">
        <div className="uc-hero-left">
          <h1 className="uc-hero-title">{title}</h1>
          <p className="uc-hero-desc">{description}</p>
          <div>
            <a href={devinHref} target="_blank" rel="noopener noreferrer" className="try-in-devin-btn">
              {buttonLabel}
            </a>
          </div>
        </div>
        <div className="uc-hero-meta">
          <div className="uc-meta-item">
            <span className="uc-meta-label">Author</span>
            <span className="uc-meta-value">Cognition</span>
          </div>
          <div className="uc-meta-item">
            <span className="uc-meta-label">Category</span>
            <span className="uc-meta-value">{category}</span>
          </div>
          {featureList.length > 0 && <div className="uc-meta-item">
              <span className="uc-meta-label">Features</span>
              <span className="uc-meta-value">{featureList.join(', ')}</span>
            </div>}
        </div>
      </div>
    </div>;
};

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<UseCaseHero title="Datadog 每日健康状况摘要" description="每日会话，用于扫描 Datadog 中的错误，并将健康摘要发送到 Slack。" prompt="通过 MCP 连接到 Datadog。检查错误率、p99 延迟，以及过去 24 小时内的监控告警。根据严重等级汇总发现，并给出推荐的后续步骤。" category="自动化" features="计划任务, MCP, 集成" type="schedule" />

<div className="uc-detail-wrapper">
  <Tip>如需更详细的 Datadog 集成指南，请[点击此处](/zh/enterprise/integrations/datadog)。</Tip>

  <Steps>
    <Step title="启用 Datadog MCP">
      前往 **Settings > Connections > MCP 服务器**，搜索 **Datadog**。点击 **Enable**，选择你的 Datadog 站点/区域，并添加两个请求头：

      * `DD-API-KEY` — 可在 Datadog 的 [Organization Settings > API Keys](https://app.datadoghq.com/organization-settings/api-keys) 中找到
      * `DD-APPLICATION-KEY` — 可在 [Organization Settings > Application Keys](https://app.datadoghq.com/organization-settings/application-keys) 中找到
    </Step>

    <Step title="创建每日日程">
      在 [app.devin.ai](https://app.devin.ai/?utm_source=docs\&utm_medium=use-case-gallery) 的左侧边栏中进入 **Schedules**，然后点击 **Create schedule**：

      * **Frequency：** Daily — 选择在站会前 30–60 分钟的时间，这样团队可以在会议期间查看检查结果
      * **Slack channel：** 选择一个频道 (例如 `#ops-alerts`) ，让你的团队自动收到汇总
      * **Prompt：** 对阈值要写清楚——像“查找问题”这样的模糊指令会产生噪声很大的摘要，容易被忽略

      <PromptBlock type="schedule">
        ```txt Daily health check prompt theme={null}
        使用 Datadog MCP 检查过去 24 小时的系统健康状况：

        1. 错误率 — 标记任何错误率超过 1% 的服务
        2. p99 延迟 — 标记任何超过 500ms 的接口
        3. CPU 和内存 — 标记任何利用率超过 80% 的项
        4. 监控状态 — 列出当前处于 Alert 或 Warn 状态的所有监控
        5. 新出现的重复错误 — 之前已解决但再次出现的错误

        对于每一项发现，请包括：
        - 严重级别（Critical / Warning / Info）
        - 受影响的服务及当前指标数值
        - 建议的后续处置步骤

        如果一切正常，请确认一切正常（all-clear）。
        ```
      </PromptBlock>

      为你的服务添加 [Knowledge](/zh/product-guides/knowledge) 条目，以便 Devin 能区分正常与异常——例如：*“payments 服务通常 p99 延迟为 200ms；超过 400ms 就值得关注。search 服务的已知基线错误率为 0.5%。”*
    </Step>

    <Step title="你的团队在 Slack 中看到的内容">
      每天早晨，Devin 通过 MCP 查询 Datadog，将结果与你设定的阈值进行对比，并将简报发送到你的频道：

      ```
      Daily Health Digest — Feb 10, 2026

      CRITICAL
        payments-service: Error rate at 3.2% (threshold: 1%)
        Started 4h ago, correlates with deploy #487.
        -> Check /api/checkout handler and recent changes.

      WARNING
        search-service: p99 latency at 620ms (threshold: 500ms)
        Gradual increase over 3 days. Likely index degradation.
        -> Review query plans for the product search endpoint.

        web-app: Memory at 82% (threshold: 80%)
        Trending upward since Tuesday.
        -> Investigate session handler for possible memory leak.

      INFO
        All other services within normal parameters.
        2 monitors recovered in past 24h: cdn-latency, db-replication-lag.
      ```

      在 Slack 线程中回复以深入调查任何发现 — Devin 会保留扫描的完整上下文：

      <PromptBlock>
        ```txt 排查关键问题 theme={null}
        payments-service 的错误率激增与部署 #487 存在相关性。
        从 Datadog 拉取过去 6 小时的错误日志，找出根本原因，
        如果可以的话提交一个包含修复的 PR。
        ```
      </PromptBlock>

      <PromptBlock>
        ```txt 添加每周趋势报告 theme={null}
        每周五，为每个指标额外生成一份 7 天趋势报告——错误率是在
        改善还是在恶化？包含按周环比对比，并发布到
        #engineering-metrics 频道。
        ```
      </PromptBlock>
    </Step>

    <Step title="安排每周的 Knowledge 更新">
      您的每日健康检查会源源不断地产生[knowledge suggestions](/zh/product-guides/knowledge)——尤其是在您针对检查结果给出类似 "this is a known baseline" 或 "ignore this monitor during deploys." 之类的反馈时。安排每周一次的 Devin 会话来处理这些建议，这样后续的运行就能自动变得更智能。

      <PromptBlock type="schedule" agent="advanced">
        ```txt Weekly Datadog knowledge maintenance theme={null}
        Review all pending knowledge suggestions related to Datadog,
        monitoring, alerting, and infrastructure health. Pay special
        attention to suggestions that came from user feedback on daily
        digest sessions — these capture real-world context about what
        matters and what's noise.

        Incorporate useful suggestions into existing knowledge entries
        or create new ones. Dismiss suggestions that are too vague or
        already covered. If any existing entries contradict recent
        feedback, update them.
        ```
      </PromptBlock>

      将其设置为每周运行一次 (例如周一早上) 的 Devin 会话，这样它就可以访问 Knowledge 管理工具。随着时间推移，这个反馈循环会让您的每日摘要更加准确——更少的误报、更合理的严重性评级，以及更智能的推荐。
    </Step>
  </Steps>
</div>
