Ecs Observability 标志

Ecs Observability

组织
aws-samples
ecs-observability

为 Amazon ECS 可观测性架构提供建议——根据合规要求、现有工具、规模、预算和启动类型(EC2、Fargate、Managed Instances、ECS Anywhere),选择日志/指标/追踪技术栈(CloudWatch、Container Insights、X-Ray、ADOT/OpenTelemetry、Managed Prometheus/Grafana、通过 FireLens 接入第三方工具)。适用于“应该如何监控 ECS 服务”“ECS 用 Container Insights 还是 Prometheus”“ECS 容器日志是不是丢了”“在 Fargate 上设置追踪”“ECS 日志记录最佳实践”“ECS 用 Datadog 还是 CloudWatch”“ECS 任务的 GPU 指标”或“规划对 ECS 任务进行实时调试访问”等问题。任何有关 ECS 日志、指标、追踪或告警设计的问题都适用,即使没有提到“可观测性”。以下情况请勿使用:EKS/Kubernetes(使用 eks-* 技能);部署机制/CI-CD/部署故障诊断(使用 ecs-devops;部署故障告警仍适用此技能);超出可观测性审计日志范围的安全态势(使用 ecs-security);正在运行的环境审查(使用 ecs-operation-review);可观测性支出的 FinOps 审查。

Add to TypingMind

概览

发布者aws-samples
代码仓库sample-apex-skills
技能名称ecs-observability
星标数
90
复刻数
20
附带文件
5
许可协议MIT-0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 aws-samples 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Ecs Observability AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/aws-samples/sample-apex-skills/tree/main/skills/ecs-observability
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aws-samples/sample-apex-skills.git /tmp/sample-apex-skills
mkdir -p .claude/skills
cp -r /tmp/sample-apex-skills/skills/ecs-observability .claude/skills/ecs-observability
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Ecs Observability,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Ecs Observability。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Ecs Observability 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

ECS Observability

Advisory skill for designing the observability architecture of Amazon ECS workloads — which logging pipeline, which metrics stack, which tracing path, driven by the customer's compliance posture, existing tooling, scale, budget, and the launch types they actually run. This is primarily a design-and-selection brain: it produces recommendations and decision rationale, with AWS documentation URLs for every load-bearing fact — and it carries the diagnostic facts (the log-loss gate, ECS Exec constraints) that troubleshooting asks need, without being a step-by-step runbook.

The accuracy bar (non-negotiable for this skill). Launch-type scope-bleed is the #1 error class in this domain — capabilities documented for one launch type get silently generalized to all four. Every capability claim in this skill is scoped to EC2 / Fargate / Managed Instances (MI) / ECS Anywhere (EXTERNAL), and where AWS docs are silent the claim is marked "undocumented — verify". Never state launch-type support you cannot cite to an AWS-published source. When you can't ground a claim, say so — do not synthesize.

When to Use This Skill

Activate when the user wants to:

  • Choose between CloudWatch-native (Container Insights, X-Ray, Application Signals), open-source-flavored (ADOT, Amazon Managed Prometheus, Amazon Managed Grafana), or third-party (Datadog, Splunk, SIEM via FireLens) observability for ECS
  • Design log delivery — awslogs vs FireLens, blocking vs non-blocking mode, buffer sizing, multi-destination routing
  • Decide standard vs enhanced Container Insights, or how to get GPU telemetry from ECS tasks
  • Pick a tracing path for new or existing ECS services (ADOT/OTel vs legacy X-Ray SDK/daemon)
  • Understand what observability each launch type (EC2, Fargate, Managed Instances, ECS Anywhere) can and cannot support
  • Plan live-debugging access (ECS Exec) including private-subnet VPC endpoint requirements
  • Weigh compliance requirements (no log loss, session auditing, KMS encryption) against availability and cost

Do NOT use this skill for:

  • EKS or any Kubernetes observability → use eks-best-practices (design guidance) or eks-operation-review (live-cluster audit), or the other eks-* skills
  • ECS deployment mechanics — circuit breaker configuration, rollback strategy, CI/CD pipelines → use ecs-devops. Deployment-failure alerting and visibility (e.g., EventBridge on SERVICE_DEPLOYMENT_FAILED) stays here.
  • ECS security posture, IAM hardening, compliance audits beyond observability's audit-logging angle → use ecs-security
  • Scoring or auditing a live ECS estate against a rubric → use ecs-operation-review
  • Overall ECS architecture — compute selection, networking, service design → use ecs-architect
  • GenAI/LLM workload design on ECS (GPU serving stacks, model hosting) → use ecs-genai; come back here for the GPU telemetry question
  • Cost optimization of an existing observability bill as a FinOps exercise — this skill flags cost levers during design but does not audit spend

The Decision Framework

Elicit these five criteria before recommending a stack — each one prunes the option space:

CriterionAskWhy it decides
Launch types in useEC2, Fargate, Managed Instances, EXTERNAL — which, today and planned?Hard eliminator. ADOT/AMP is unsupported on EXTERNAL; agentless GPU metrics are MI-only; Fargate forbids host agents; App Signals daemon strategy excludes Fargate. Check references/launch-type-matrix.md before every claim.
Compliance needsCan any log record be lost? Are debug sessions audited? Customer-managed KMS?Drives the blocking vs non-blocking log gate, FireLens filesystem buffering, ECS Exec session logging, and KMS endpoint/key-policy work.
Existing toolingGrafana/PromQL estate? Datadog/Splunk/SIEM contract? OTel standardization?Existing Grafana → ADOT+AMP+AMG. Third-party APM/SIEM → FireLens routing. No estate → CloudWatch-native is the lowest-friction default.
ScaleLog MB/s per task, task count, metric cardinalityHigh log throughput breaks default buffers (silent loss); container-level enhanced CI multiplies metric series; sidecar-per-task overhead compounds with task count.
BudgetAppetite for custom-metric, log-ingestion, and AMP/AMG spendFree vended metrics + EventBridge events are the zero-cost floor; enhanced CI and high-cardinality Prometheus are the main cost levers. Link https://aws.amazon.com/cloudwatch/pricing/ — never quote prices.

Default recommendation shape

For a CloudWatch-centric customer with no contrary criteria (EC2/Fargate fleets — EXTERNAL needs a different shape, since ADOT and Container Insights are not documented there): awslogs (with an explicit, documented delivery-mode decision) + Container Insights enhanced + ADOT sidecar for traces + EventBridge alerting on service action ERROR events. Enhanced is AWS's recommended Container Insights tier (per https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/deploy-container-insights-ECS-cluster.html) — but it adds container-level metric cardinality, a cost lever to surface (Advisory Rule 3; cost posture in references/metrics-stacks.md). For MI fleets the logs + metrics + EventBridge parts carry over, but the ADOT-sidecar tracing leg is not documented for Managed Instances as of 2026-07-10 (the ADOT integration page enumerates Fargate + EC2 only, per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application-metrics-prometheus.html) — verify against the live doc before recommending it there (see the matrix's ADOT row). Deviate per the criteria above.

Logs — the decision gate every engagement must surface

Facts verified 2026-07-09 against https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html and https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html

Since June 25, 2025, the ECS default log delivery mode is non-blocking — and non-blocking mode silently drops logs when its in-memory buffer (default max-buffer-size: 10 MiB) fills. No metric, no daemon log line, no signal (per https://aws.amazon.com/blogs/containers/preventing-log-loss-with-non-blocking-mode-in-the-awslogs-container-log-driver/). The alternative, blocking, preserves every record but can hang the application and fail health checks if the log pipeline backs up. This is a compliance-versus-availability decision, and since the 2025 default change the risky posture is what customers get by not deciding:

  • Availability-first (user-facing services, tolerable loss): keep non-blocking, size max-buffer-size to ~25 MB for in-Region delivery at up to ~5 MB/s per container (AWS benchmark guidance — "no observed loss" in AWS's test runs, not a guarantee); above 6 MB/s AWS calls the driver's behavior "less predictable and consistent" — that becomes a FireLens conversation (see reference). Document the accepted loss risk.
  • Completeness-first (audit/financial/security logs): set mode: blocking per container or set the defaultLogDriverMode account setting — a per-Region setting, repeat it in every Region running tasks — and accept that a CloudWatch disruption can stall the app.
  • Both required: FireLens (Fluent Bit) with filesystem buffering — loss-resistant without blocking stdout/stderr.
  • Always audit the effective account default first: aws ecs list-account-settings --name defaultLogDriverMode --effective-settings.

FireLens is also the usual routing layer when the destination is not CloudWatch (Splunk, Datadog, OpenSearch, S3, Firehose, SIEMs) — though the native splunk log driver is documented on both Fargate and EC2 as a FireLens-free path to Splunk. FireLens is documented for Linux tasks on Fargate and EC2 only; MI and EXTERNAL support is undocumented — verify before advising.

For buffer benchmarks, FireLens rules, and high-throughput patterns, see: Log Delivery Reference

Metrics — Container Insights tiers and the GPU trap

Facts verified 2026-07-09 against https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-container-insights.html and https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-enhanced-observability-metrics-ECS.html

  • Standard Container Insights (containerInsights=enabled): task/service/cluster-level metrics. Enhanced (enhanced, released Dec 2024): adds container-level metrics, per-TaskId dimensions, and health-status metrics — AWS's recommended default, at the cost of more metric series (cardinality is the main cost lever — link https://aws.amazon.com/cloudwatch/pricing/, never quote prices). Documented launch types: EC2 (agent ≥ 1.29), Fargate, Managed Instances; EXTERNAL is not listed — don't claim it.
  • GPU telemetry is the sharpest launch-type trap: agentless GPU/DCGM metrics (utilization, memory, power, temperature at container/task/instance level) are Managed Instances-ONLY and require enhanced CI (per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/monitoring-managed-instances.html). The EC2 launch type gets only the free GPU reservation metric — GPU utilization there means customer-managed DCGM/CloudWatch-agent tooling. Never generalize in either direction.
  • Prometheus/Grafana route: ADOT sidecar remote-writes to Amazon Managed Service for Prometheus, visualized in Amazon Managed Grafana — documented for Fargate and EC2 only; EXTERNAL explicitly unsupported, MI not documented as of 2026-07-10 (see the ADOT row of references/launch-type-matrix.md for the source quote) — verify before advising MI. Alternative keeping data in CloudWatch: the CloudWatch agent's Prometheus scrape support.
  • Zero-cost floor available everywhere: free vended CPU/memory metrics + EventBridge service/task/deployment events + container health checks.

For metric tables, instance-level collection, and AMP vs CloudWatch-agent-Prometheus selection, see: Metrics Stacks Reference

Traces — OTel is the path; X-Ray SDK/daemon is legacy

Facts verified 2026-07-10 against https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-daemon-timeline.html

  • The X-Ray SDKs and daemon entered maintenance mode on February 25, 2026 (security fixes only); AWS recommends OpenTelemetry. Steer all new tracing to the ADOT sidecar collector (public.ecr.aws/aws-observability/aws-otel-collector), which still delivers traces to the X-Ray backend — the maintenance-mode timeline names only the SDKs and daemon, not the backend service (inference from https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-daemon-timeline.html, which covers SDKs/daemon only; the migration guide keeps X-Ray as the trace destination).
  • CloudWatch Application Signals on ECS is custom setup with no autodiscovery — service names are wired via env vars. Sidecar strategy: EC2 + Fargate, requires awsvpc. Daemon strategy: one agent per cluster, excludes Fargate. MI: not documented for either strategy as of 2026-07-10; EXTERNAL: sidecar structurally excluded (awsvpc required), daemon undocumented (see the App Signals rows of the matrix).
  • Placement rule: Fargate → sidecar only (no host access); EC2 → sidecar or daemon-scheduled collector; MI → neither pattern is documented as of 2026-07-10 (the ADOT page enumerates Fargate + EC2 only — per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application-metrics-prometheus.html; verify against the live doc before advising, see the matrix's ADOT row); EXTERNAL → ADOT unsupported.

For migration gotchas, IAM, and Application Signals strategy details, see: Tracing and Signals Reference

Live debugging — ECS Exec

Facts verified 2026-07-09 against https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html

  • Works on all four launch types (one of the few capabilities that does), and is the sole shell path on Managed Instances (no SSH there).
  • Private-subnet precision, for tasks in a VPC (EC2/Fargate/MI): ECS Exec needs the ssmmessages interface VPC endpoint — not the full ssm/ec2messages trio (per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) — plus a KMS endpoint only when sessions are encrypted with a customer-managed key. On EXTERNAL (ECS Anywhere) the host must reach ssm + ec2messages + ssmmessages regardless — an SSM Agent registration prerequisite (per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-anywhere.html).
  • Compliance anchors: session logging via cluster executeCommandConfiguration, CloudTrail ExecuteCommand events, and an IAM deny on ssm:StartSession to close the unlogged side door. Commands run as root; readonlyRootFilesystem unsupported.

For full constraints and audit setup, see: Native Visibility and ECS Exec Reference

Launch-Type Discipline

Before asserting any capability, check references/launch-type-matrix.md — the per-capability EC2/Fargate/MI/EXTERNAL matrix with a source URL per row. The matrix is the single source of truth for these facts; the recurring traps (restated here per the matrix, verified 2026-07-10 — re-check the matrix row before load-bearing use):

  • Agentless GPU/DCGM → MI only (EC2 gets reservation-only).
  • ADOT/AMP → documented for Fargate + EC2; EXTERNAL explicitly unsupported; MI undocumented — verify before advising.
  • FireLens → Linux Fargate/EC2 documented; MI/EXTERNAL undocumented — verify before advising.
  • Application Signals daemon → no Fargate; sidecar → requires awsvpc (which EXTERNAL cannot run).
  • EXTERNAL supports bridge/host/none networking only — anything demanding awsvpc is structurally out.
  • Fargate has no host — every agent is an in-task sidecar; MI's AMI is AWS-owned — nothing can be baked into it.

How to Use the References

This skill uses progressive disclosure — essential decision guidance is in this file; detailed reference material is loaded on demand:

ReferenceLoad when the task is about…
log-delivery.mdblocking vs non-blocking details, buffer-size benchmarks, awslogs options, FireLens/Fluent Bit configuration, filesystem buffering, high-throughput logging, routing to third-party destinations (Datadog, Splunk, SIEMs) and awslogs-vs-FireLens selection
metrics-stacks.mdContainer Insights standard vs enhanced metric tables, GPU/DCGM scoping, instance-level metrics, ADOT+AMP+AMG vs CloudWatch-agent Prometheus, metric cost levers
tracing-and-signals.mdX-Ray maintenance-mode details and migration, ADOT collector setup and IAM, Application Signals sidecar vs daemon, language support
launch-type-matrix.mdany "does X work on launch type Y" question — check before every capability claim
native-visibility-and-exec.mdEventBridge events, service events, container health checks, ECS Exec constraints and VPC endpoints, monitoring-plan baseline

Advisory Rules

  1. Scope every capability claim by launch type. If the matrix row says "undocumented — verify", say exactly that to the customer and check the live AWS doc.
  2. Always surface the log delivery-mode gate in any logging discussion — the customer must consciously choose a failure mode; the post-2025 default chooses silent loss for them.
  3. Never quote prices or assert the enhanced-CI pricing model for ECS — link https://aws.amazon.com/cloudwatch/pricing/ instead.
  4. Do not recommend X-Ray SDK/daemon for new builds — ADOT/OTel, always, since the 2026-02-25 maintenance date.
  5. Recommend the zero-cost floor first (vended metrics, EventBridge ERROR-event alerting, health checks) — it survives every stack decision and every launch type.
  6. Cite as you advise — every load-bearing recommendation carries its AWS documentation URL, dated where the fact is volatile.

Sources


This skill is provided as sample code for educational and demonstration purposes only. Recommendations should be validated against current AWS documentation before acting on them. See the project's README and LICENSE for full terms.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Ecs Observability AI 技能有什么作用?

为 Amazon ECS 可观测性架构提供建议——根据合规要求、现有工具、规模、预算和启动类型(EC2、Fargate、Managed Instances、ECS Anywhere),选择日志/指标/追踪技术栈(CloudWatch、Container Insights、X-Ray、ADOT/OpenTelemetry、Managed Prometheus/Grafana、通过 FireLens 接入第三方工具)。适用于“应该如何监控 ECS 服务”“ECS 用 Container Insights 还是 Prometheus”“ECS 容器日志是不是丢了”“在 Fargate 上设置追踪”“ECS 日志记录最佳实践”“ECS 用 Datadog 还是 CloudWatch”“ECS 任务的 GPU 指标”或“规划对 ECS 任务进行实时调试访问”等问题。任何有关 ECS 日志、指标、追踪或告警设计的问题都适用,即使没有提到“可观测性”。以下情况请勿使用:EKS/Kubernetes(使用 eks-* 技能);部署机制/CI-CD/部署故障诊断(使用 ecs-devops;部署故障告警仍适用此技能);超出可观测性审计日志范围的安全态势(使用 ecs-security);正在运行的环境审查(使用 ecs-operation-review);可观测性支出的 FinOps 审查。

为什么在 TypingMind 中使用 Ecs Observability?

因为您只需安装一次,就能搭配任何模型使用。Ecs Observability 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Ecs Observability?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/aws-samples/sample-apex-skills/tree/main/skills/ecs-observability。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Ecs Observability?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Ecs Observability 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Ecs Observability 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Ecs Observability AI 技能免费吗?

是的。aws-samples 已在 GitHub 上根据 MIT-0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇